Last active
July 26, 2023 17:07
-
-
Save gbot/a6dd846335ccac782897 to your computer and use it in GitHub Desktop.
Fail2Ban WordPress XMLRPC Jail and Filter. Notes: log path is set for Plesk v12.x. Change this to appropriate path for your set up. Only works if WordPress is installed in webroot, edit the Filter failregex if installed in sub-directory.
This file contains hidden or 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-xmlrpc] | |
enabled = true | |
filter = wp-xmlrpc | |
action = iptables-multiport[name=wp-xmlrpc, port="http,https"] | |
logpath = /var/www/vhosts/system/*/logs/*access*log | |
/var/log/httpd/*access_log | |
bantime = 86400 | |
maxretry = 0 |
This file contains hidden or 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
# Fail2Ban filter for WordPress XML-RPC | |
[Definition] | |
failregex = ^<HOST>.*] "POST /xmlrpc\.php.* | |
ignoreregex = ^<HOST>.*] "POST /xmlrpc\.php\?for=jetpack.* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This regex matches the entries for sub-directory installs too:
[Definition]
failregex = ^<HOST>.*] "POST (|.*)/xmlrpc\.php.*
ignoreregex = ^<HOST>.*] "POST (|.*)/xmlrpc\.php\?for=jetpack.*