Setting up fail2ban on Caddy

OS: Debian Buster
Caddy: v2.1.1
Docker: v19.03.12

I’m trying to setup fail2ban on top of Caddy so I can block all suspicious traffic hitting my external services. How can I set this up? I have Caddy running in a Docker container, and fail2ban running on bare metal.

Unfortunately Caddy isn’t really equipped to make this easy right now, since fail2ban relies on reading server logs to make ban decisions.

If you’re willing to help test and give feedback, the following PR could possibly be reopened to add functionality in Caddy to make this easier:

Please read the discussion on that PR and the issue attached to get an idea of the problem at hand

1 Like

Thanks. I’ve commend on the PR.