IP address banning (Fail2Ban) is an automated way to protect your server from brute force attacks. Fail2Ban uses regular expressions to monitor log files for patterns corresponding to authentication failures, seeking for exploits, and other entries that can be considered suspicious. Such log entries are counted, and, when their number reaches some predefined value, Fail2Ban either sends a notification email or bans the attacker’s IP for a pre-defined length of time. When the ban period is over, the IP address is automatically unbanned.
Fail2Ban logic is determined by a number of jails. A jail is a set of rules covering an individual scenario. The settings of the jail determine what is to be done once an attack is detected according to a predefined filter (a set of one or more regular expressions for monitoring the logs). For more information, see Fail2Ban Jails Management.
Note: To use Fail2Ban, administrators who upgrade from Plesk 11.5 must obtain a new Plesk Onyx license key either directly from Plesk or from their vendor.
To set up Plesk to automatically ban IP addresses and networks that generate malicious traffic:
Now all active Fail2Ban jails will be used to monitor the log files and to ban suspicious IP addresses.
Fail2Ban in Plesk has the following limitations and peculiarities:
numiptent) might affect the work of Fail2Ban. When this limit is exceeded, Fail2Ban will stop working properly and in the Fail2Ban log you will find a line such as:
fail2ban.actions.action: ERROR iptables -I fail2ban-plesk-proftpd 1 -s 126.96.36.199 -j REJECT --reject-with icmp-port-unreachable returned 100
If an IP address should not be blocked:
You can view and download Fail2Ban log files in Tools & Settings > IP Address Banning (Fail2Ban) > the Logs tab.
You can view the list of banned IP addresses, unban them, or move them to the list of trusted addresses in Tools & Settings > IP Address Banning (Fail2Ban) > the Banned IP Addresses tab.
You can view the list of IP addresses that will never be banned, add IP addresses to and remove from this list in Tools & Settings > IP Address Banning (Fail2Ban) > the Trusted IP Addresses tab.