tomMoulard / fail2ban

Traefik plugin on fail2ban middleware
MIT License
190 stars 10 forks source link

Banning based on forwarded IP #84

Open stashymane opened 8 months ago

stashymane commented 8 months ago

As noted in this discussion, fail2ban currently only uses the request's IP for banning. This makes it impossible to properly ban IPs when behind a proxy, like Cloudflare. A configuration option to pull the IP from a request header or other source would be ideal.

fliot commented 6 months ago

100% agree on this very important feature.

zhangjunjie6b commented 5 months ago

I have to turn off the proxy function of Cloudflare for the same issue

johnbizokk commented 3 months ago

Indeed! Without support for blocking the IP address from the x-forwarded-for header, the plugin is non-functional when the traefik is behind a proxy (such as Cloudflare).

tomMoulard commented 3 months ago

Indeed this could be a very important feature. It would be nice to have a configuration like the source criterion of the InFlightReq middleware. I'll be waiting for a PR until I'll do it myself in a while.