Fail2Ban works fine with the built-in jails, but my custom OpenVPN jail doesn't ban anything, neither does my NGINX-DoS jail. The output of
sudo fail2ban-client status openvpn is:
Status for the jail: openvpn |- Filter | |- Currently failed: 0 | |- Total failed: 0 | `- File list: /var/log/openvpn.log - Actions |- Currently banned: 2 |- Total banned: 2 `- Banned IP list: 220.127.116.11 18.104.22.168
I changed the IP addresses, BTW. So the jail is working, but the output of
iptables-save | grep 22.214.171.124 returns nothing, so the IP is not being blocked. All other jails work fine.
openvpn.conf file in
# Fail2Ban filter for selected OpenVPN rejections # # [INCLUDES] before = common.conf [Definition] failregex = ^ TLS Error: incoming packet authentication failed from \ [AF_INET\]<HOST>:\d+$ ^ <HOST>:\d+ Connection reset, restarting ^ <HOST>:\d+ TLS Auth Error ^ <HOST>:\d+ TLS Error: TLS handshake failed$ ^ <HOST>:\d+ VERIFY ERROR ignoreregex =
and the section in
[openvpn] enabled = true port = 1194 protocol = tcp backend = auto filter = openvpn logpath = /var/log/openvpn.log action = sendmail[name=openvpn, dest=my_email@my_domain.com] banaction = iptables-multiport
The same thing is happening with my NGINX jail, fail2ban-client says its banned, and I get an email saying an IP was banned, but nothing happens.