Installation
sudo apt-get install fail2ban
Configuration
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local &&
nano /etc/fail2ban/jail.local
Modifier comme ceci
ignoreip = 127.0.0.1/8 ##YOUR_HOME_IP##
bantime = 3600
findtime = 3600
maxretry = 6
mta = mail
destemail = admin@vsweb.be
sendername = Fail2BanAlerts
action = %(action_mwl)s
enabled = true
port = http,https
filter = apache-auth
logpath = /var/log/apache*/*error.log
maxretry = 6
enabled = true
enabled = true
port = http,https
filter = apache-overflows
logpath = /var/log/apache*/*error.log
maxretry = 2
enabled = true
port = http,https
filter = apache-badbots
logpath = /var/log/apache*/*error.log
maxretry = 2
enabled = true
port = http,https
filter = php-url-fopen
logpath = /var/log/apache*/*access.log
Redémarrer
sudo service fail2ban restart
© 2019 VsWeb