• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

Resolved Fail2Ban is ignoring maxretry/ ip found after ban

KarleyLo

New Pleskian
We are Blocking a Bruteforce with Fail2Ban and i discovered that sometimes the IPs are not blocked after the maxretry or the IP is found after ban.

We have set the maxretry to 3 :

[ssh]
enabled = true
filter = sshd
action = iptables[name=SSH, port=ssh, protocol=tcp]
iptables-allports[chain="INPUT", name="default", port="ssh", protocol="tcp", blocktype="REJECT --reject-with icmp-port-unreachable", returntype="RETURN", lockingopt="-w", iptables="iptables <lockingopt>"]
logpath = /var/log/secure
maxretry = 3

but when i check the logs i can see that sometime, the same ip is found more than 3 times :

/var/log/fail2ban.log:
ban1.PNG

grep "Failed pass" /var/log/secure:
ban2.PNG

Can someone help us with this?
 
Regarding @Brujo 's comment: It is correct that in this case Fail2Ban simply isn't fast enough to block the IP before it exceeds the set limit. No worries about that. Simply leave your configuraton as it is.

Regarding the "WARNING" message: If your system is not using Fail2Ban version 0.10 or new that can utilize ip6tables to block IPv6 attacks, it is strongly recommended to disable IPv6 altogether on the system, because else attacks can be launched successfully using an IPv6 route. These will never be blocked by the normal Fail2Ban and iptables.
 
Back
Top