Fail2ban

Fail2ban

Fail2ban

Description

Fail2ban : Analyseur et blocage de tentative de connexions illégitimes

Paramétrage

/etc/fail2ban

Étapes d'installation

apt install fail2ban

Configuration

Éditer le fichier jail.local

[DEFAULT]
destemail = admin@example.com
banaction = ufw
[pam-generic]
enabled = true
[apache]
enabled = true
[postfix]
enabled = true

Paramétrage Wordpress/Piwik

Documentation /etc/fail2ban/filter.d/bruteforce.conf

[Definition]
failregex = <insert here a regex to match in the log files> 
ignoreregex =

[apache-services-bruteforce]
enabled  = true
port     = http,https
filter   = bruteforce
logpath = /var/log/apache2/other_vhosts_access.log
maxretry = 8

Paramétrage Postfix

https://superuser.com/questions/576751/example-of-fail2ban-configuration-to-ban-servers-spamming-my-postfix-server

Paramétrage OpenVPN

https://www.fail2ban.org/wiki/index.php/HOWTO_fail2ban_with_OpenVPN

Unban

fail2ban-client set JAILNAME unbanip IPADDRESS

où l'on remplacera JAILNAME par le nom de la "jail" de Fail2ban à l'origine du bannissement et IPADDRESS par l'adresse bannie.

Par exemple : fail2ban-client set ssh unbanip 1.2.3.4

Article précédent Article suivant