Um WordPress mittels Fail2ban ab zu sichern auf einem bestehenden ISPConfig3.1 Server sit nicht viel zu tun. Mit folgenden Anpassungen könnt ihr eure WordPress Systeme mit Fail2ban absichern

 

Folgendes zeilen in die /etc/fail2ban/jail.local einfügen

[nginx-wp-login]
enabled = true
port = http,https
filter = nginx-wp-login
logpath = /var/log/ispconfig/httpd/*/access.log

[nginx-wp-xmlrpc]
enabled = true
port = http,https
filter = nginx-wp-xmlrpc
logpath = /var/log/ispconfig/httpd/*/access.log

danach werden zwei Filter neu  erstellt

nano /etc/fail2ban/filter.d/nginx-wp-login.conf

[Definition]
failregex = ^<HOST> .*POST .*wp-login\.php HTTP.* 200.*
ignoreregex =

Speichern und das selbe noch malfür die wp-xmlrpc

/etc/fail2ban/filter.d/nginx-wp-xmlrpc.conf

[Definition]
failregex = ^<HOST> .*POST .*xmlrpc\.php.* 200.*
ignoreregex =

Mit folgendem Befehl Prüfen ob die Dateien vorhanden

ls /etc/fail2ban/filter.d/|grep nginx-wp

Es sollten beide Dateien nun angezeigt werden

nginx-wp-login.conf
nginx-wp-xmlrpc.conf

Danach fail2ban neustarten

/etc/init.d/fail2ban restart

Dann Logfiles von Fail2ban Prüfen

cat /var/log/fail2ban.log

2017-06-13 13:48:54,198 fail2ban.jail   [15774]: INFO    Jail 'ssh' started
2017-06-13 13:48:54,203 fail2ban.jail   [15774]: INFO    Jail 'dovecot-pop3imap' started
2017-06-13 13:48:54,205 fail2ban.jail   [15774]: INFO    Jail 'pureftpd' started
2017-06-13 13:48:54,210 fail2ban.jail   [15774]: INFO    Jail 'postfix-sasl' started
2017-06-13 13:48:54,211 fail2ban.jail   [15774]: INFO    Jail 'nginx-wp-login' started
2017-06-13 13:48:54,212 fail2ban.jail   [15774]: INFO    Jail 'nginx-wp-xmlrpc' started

 

Links:

Fail2Ban

AncoraThemes © Copyright 2024. All Rights Reserved.