Last active
August 29, 2015 14:14
-
-
Save olimortimer/48d1efbe776e1484e236 to your computer and use it in GitHub Desktop.
Shell: Fail2Ban WordPress Logins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ban IP via Cloudflare API: /etc/fail2ban/action.d/cloudflare-api.local | |
[Definition] | |
actionban = curl https://www.cloudflare.com/api_json.html -d 'a=ban' -d 'tkn=1234567890' -d 'email=cloudflare@email.com' -d 'key=<ip>' | |
actionunban = curl https://www.cloudflare.com/api_json.html -d 'a=nul' -d 'tkn=1234567890' -d 'email=cloudflare@email.com' -d 'key=<ip>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[wp-auth] | |
enabled = true | |
filter = wp-auth | |
action = iptables-multiport[name=wp-auth, port="http,https"] | |
cloudflare-api | |
logpath = /var/log/ispconfig/httpd/*/access.log | |
maxretry = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WordPress brute force auth filter: /etc/fail2ban/filter.d/wp-auth.conf | |
# | |
# Block IPs trying to auth wp wordpress | |
# | |
# Matches e.g. | |
# 94.75.208.136 - - [25/Nov/2014:17:41:07 +0000] "POST /wp-login.php HTTP/1.0" 302 381 "-" "-" | |
# | |
[Definition] | |
failregex = ^<HOST> .* "POST /wp-login.php | |
ignoreregex = |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment