Docker – Blacklisting IPs with Docker, Traefik and DigitalOcean

dockerufw

I’m currently using Traefik on a digitalocean instance with Docker provider enabled. It’s working well with several containers (frontends and backends). The problem is that most DO IPs are recycled and the several that I’ve tried keep getting noisy traffic trying to “connect” to my root IP. I’ve tried searching everywhere but it seems DO firewall doesn’t support “deny” rules and Traefik bypasses local UFW settings since everything is thru Docker. Any suggestions on how I can blacklist a handful of bad IPs with this set up? My Traefik “health” dashboard is useless since the 307 requests are many magnitudes larger then regular traffic.

Thank you!

Best Answer

Looks like "for now" it is impossible with Traefik: https://github.com/containous/traefik/pull/4454

So you need something like fail2ban.

Related Topic