I need to block certain requests with fail2ban based on a custom logfile-format for an nginx webserver access.log.
The offending lines which should match are in access.log and look like this:
06/Oct/2016:18:44:29 +0200 191.96.249.53 - - mydomain.com "POST /xmlrpc.php HTTP/1.0" 499 0 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)" "-"
06/Oct/2016:18:44:29 +0200 191.96.249.53 - - mydomain.com "POST /xmlrpc.php HTTP/1.0" 499 0 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)" "-"
06/Oct/2016:18:44:29 +0200 191.96.249.53 - - mydomain.com "POST /xmlrpc.php HTTP/1.0" 499 0 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)" "-"
My fail2ban configuration wordpress-xmlrpc.conf with RegEx:
[Definition]
failregex = ^<HOST>.*POST .*.(*wp-login\.php|*xmlrpc\.php).*.(403|499)*
ignoreregex =
The jail is running, but never finds the offending lines:
Status for the jail: wordpress-xmlrpc (simplified):
- File list: /var/log/nginx/access.log
- Currently failed: 0
- Total failed: 0
- Currently banned: 0
- Total banned: 0
Any help is appreciated!