PLEASE NOTE
To pass through the correct IP, you will need to enable the real-ip plugin for traefik.
The aim here is to implement a bouncer for the router to block malicious IP to access your services. For this, it leverages and query CrowdSec with client IP. If the client IP is on ban list, it will get a http code 403 response. Otherwise, request will continue as usual.
Parsers take log formats and breaks it into readable information for the CrowdSec app. We will be using the Traefik parser to take the Traefik access logs and pass that information over to the CrowdSec app to make decisions.
Bouncers react to decision made by CrowdSec. In this case, the Traefik bouncer will take the decision made by CrowdSec and either allow or deny the traffic going through Traefik. CrowdSec on its own will just make the decisions to ban IP's. It will do this by connecting back to the mothership to get the information required to make the decisions locally.
A scenario is a behaviour, i.e. is it a brute force attack that is happening. You can choose which Scenarios you would like to check the traffic against. In this Traefik collection, we will be using the typical http behaviours.
PLEASE NOTE
This is the only time the api will be shown, make sure to note down this API key somewhere safe.
Now we need to add the Traefik collection to the CrowdSec compose file and also the bouncer install along with the API key.
Check out available bouncers on the