Skip to content

Instantly share code, notes, and snippets.

@yoren
Last active August 29, 2015 14:13
Show Gist options
  • Save yoren/ce99160ceac2a5493eac to your computer and use it in GitHub Desktop.
Save yoren/ce99160ceac2a5493eac to your computer and use it in GitHub Desktop.
Keep WordPress Safe From Brute Force Attack with Fail2ban
fail2ban-regex /var/www/vhosts/your.domain.here/logs/site-folder/access_ssl_log /etc/fail2ban/filter.d/wp-login.conf
[wp-login]
enabled = true
port = http,https
action = iptables-multiport[name=WP, port="http,https", protocol=tcp]
sendmail-whois[name=fail2ban-wp-bruteforce, dest=your@email.com]
filter = wp-login
logpath = /var/www/vhosts/your.domain.here/logs/*/access*log
maxretry = 5
# WP brute force attacks filter
[Definition]
failregex = ^<HOST> .* "POST .*wp-login.php
ignoreregex =
@yoren
Copy link
Author

yoren commented Jan 10, 2015

For more information, please refer to my post: Keep WordPress Safe From Brute Force Attacks with Fail2ban.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment