WIP: feat: adds crowdsec #122
Draft
devydave
wants to merge 3 commits from
devydave/traefik:feat-crowdsec into master
pull from: devydave/traefik:feat-crowdsec
merge into: :master
:master
:anubis-geoip
:code-owners
:codeowners
:rate-limits
:access-logs-docs
:dont-generate-wildcard-certs
:MAINTENANCE
:forwarded-headers
:adding-matrix-room
:pgsql-port-open
:anubis-metrics
:trust-forward-header
:large-uploads
:anubis-log-level
:compose.matrix
:garage
:cve_patch
:chore-5.0.0+v3.6.10
:feat-release-notes-next
:add-onion-support
:remove-default-timeout
:feat-pull-request-template
:improve-docs
:anubis
:sixsmith-v3-update-only
:feature/irc
:revert-logmaxAge
:qbit
:feature/v3
:error-pages-again
:metrics
:basic-auth
:error-messages-attempt
:error-pages-attempt
:minecraft
:forward-auth-2
:error-pages
:rejig-compose-vars
:self-signed
No labels
Milestone
No items
No Milestone
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
BornDeleuze (Born Deleuze)
Brooke
carla
cas (Cassowary)
coopcloud
dannygroenewegen (Danny Groenewegen)
decentral1se (d1)
devydave
fauno (fauno)
hex (Josh Dukes)
javielico (Javielico)
jjsfunhouse
kawaiipunk (KawaiiPunk)
knoflook
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1 (p4u1)
renovate-bot (Comrade Renovate Bot)
simon
stevensting (stevensting)
trav (Trav Fryer)
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/traefik#122
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
We were in urgent need of some DDOS protection, because one of our projects got attacked. This is the solution that is currently running as a mitigation in production.
Feel free to review :)
abra.sh@@ -1,3 +1,4 @@export TRAEFIK_YML_VERSION=v32export FILE_PROVIDER_YML_VERSION=v12export TRAEFIK_YML_VERSION=v33export FILE_PROVIDER_YML_VERSION=v15will fix the version skip when I have more time ^^
@devydave can you rebase and integrate the access log feature from fauno?
@devydave can you rebase and integrate the access log feature from fauno?
@hex here's previous art on getting a waf into traefik
@hex @fauno if there is more interest I can try to finish it, we do not use it anymore at the moment but the recent CVE problems showed it would be nice to have
The brotli issue would be far from solved with a WAF, but a WAF would definitely reduce the attack surface. I do think it would help.
@devydave i think this is only working option for traefik so far in term of wafs, right? i've been looking into coraza but the open source plugin is unmaintained and the production plugin is for traefik enterprise edition. it'd be great if you had the time to finish it, otherwise i can try soon!
@@ -78,0 +114,4 @@When there are not bans yet you can try by banning your own IP.```abra app run <domain> crowdsec cscli decisions add --ip <your-ip> -d 10m # this will be effective 10minThis command is not working at the moment because the flags get parsed as abra flags and when I wrap them in " the cli is not found inside the container. For me it feels like a bug ideas anyone?
would you try any of these combinations?
toolshed/abra#790
@fauno I adjusted the PR with your access log changes with the following env it works. Maybe I will adjust the pattern like the access log that
CROWDSEC_ENABLEDis not needed.What will be your use case for the crowdsec integration? When you enable it on a service the traefik logs get scanned for patterns and bans sus behaviour and bans the IP for 4h. A ban results in a 403 being sent. There is an option for captcha, that could be implemented.

@@ -77,1 +77,4 @@## CrowdsecIMPORTANT even though Crowdsec is Open Source, the software sends information of the attacker IP and what decision(ban or captcha) to a centralized server for communit managed block lists.there's a typo in communit[y]. also, does it mean to say that any visitor ip address is sent to crowdsec? or is there a local decision about what looks like an attack?
I did not find out to configure it yet, but there are both options. You can only make decisions locally and do not upstream the IP, but then you do not get access to the full provided community ban list. The other option is you upstream the IPs which get banned and get full access to the ban list.
@@ -78,0 +91,4 @@abra app run <domain> crowdsec cscli bouncers add crowdsecBouncer```After that insert the LAPI key(command below) and redeploy traefik with `CROWDSEC_BOUNCER_ENABLED=1` and `CROWDSEC_TRAEFIK_CONFIG_VERSION=v2`.did you actually need to increase the config version? the template doesn't change so docker should accept it even if the rendered config is different
Oh yeah that is a mistake
@@ -0,0 +13,4 @@COLLECTIONS: "crowdsecurity/traefik"volumes:- crowdsec-db:/var/lib/crowdsec/data/- crowdsec-config:/etc/crowdsec/what does this volume store?
@@ -25,0 +27,4 @@plugin:bouncer:enabled: {{ if eq (env "CROWDSEC_BOUNCER_ENABLED") "1" }}true{{ else }}false{{ end }}logLevel: DEBUGcan this be made configurable?
Sure, also this is in by mistake from a debugging session, I think the default should be INFO?
@@ -191,0 +197,4 @@plugins:bouncer:moduleName: github.com/maxlerebourg/crowdsec-bouncer-traefik-pluginversion: v1.8.1do the versions need to match?
I think this is a coincendence
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.