maxlerebourg / crowdsec-bouncer-traefik-plugin

Traefik plugin for Crowdsec - WAF and IP protection
Apache License 2.0
259 stars 13 forks source link

How to verify setup and configurations? #61

Closed jorgnyg closed 1 year ago

jorgnyg commented 1 year ago

Used the docker-compose in repo as baseline. Any way to verify my setup? Like, to find out if the setup is actually working. The bouncers appear in app.crowdsec.net and an additional KEYTRAEFIK... is added to the bouncers tab.

mathieuHa commented 1 year ago

Hi @jorgnyg,

Yes, you can verify your setup. In the README.md we added the following information to simulate a "ban" from Crowdsec, and see the result in Traefik.

Here is the extract:

Manually add an IP to the blocklist (for testing purposes)

docker-compose up -d crowdsec
docker exec crowdsec cscli decisions add --ip 10.0.0.10 -d 10m # this will be effective 10min
docker exec crowdsec cscli decisions remove --ip 10.0.0.10

(Replace 10.0.0.10 by your IP seen by Traefik)

I'll try to develop a bit tomorrow. If you have more specific question, just shoot.

Mathieu

jorgnyg commented 1 year ago

@mathieuHa great, thanks. Looks like manually banning is working.

Is it normal for the api key to "time out"/become inactive after one day like this? image

mathieuHa commented 1 year ago

Hi,

I don't really know what are the conditions for the bouncer to be active/inactive. You should take a look at the docker "bouncer" logs and see what he is doing.

You can use the cscli inside to get informations.

Maybe you're webservices are not exposed (enough ?). I've tested successfully to block one of my public IP using nikto. on one of the website behing Traefik / crowdsec. Note that it didn't work from my internal network, I had to use an external IP.

Mathieu

mathieuHa commented 1 year ago

Hey @jorgnyg to follow up, is everything working for you regarding the initial question ? I'd like to close this issue if it's all good.

Mathieu

jorgnyg commented 1 year ago

All good. Things are working as expected!