portfolio & blog

Fail2Ban: Set a permanent ban per IP

Fail2Ban is a really good piece of software that allows to understand when someone (a bot) is trying to offend your server using a brute force attack.

Let’s say that you don’t want to apply a permanent ban as a default rule (because it is possibile, setting the bantime at -1 in the relative filter of the jail.conf file).
Let’s say that you see an offending IP that is continuosly banned.
Let’s say that you don’t want to see it anymore!

To ban permanently an IP a really simple way is to add the following line under the “actionstart” rule (the actions used when fail2ban starts/restarts):