Skip to content

Instantly share code, notes, and snippets.

@sergejmueller
Last active February 3, 2016 08:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergejmueller/8562240 to your computer and use it in GitHub Desktop.
Save sergejmueller/8562240 to your computer and use it in GitHub Desktop.
Fail2Ban-Regel für die Erkennung und Sperre von Bots, die dabei erwischt werden, Login-Versuche auf die WordPress-Anmeldeseite abzusetzen. Die Anmeldeseite ist dabei mit einem Zugriffsschutz versehen. Weitere Infos unter https://github.com/sergejmueller/sergejmueller.github.io/wiki/Fail2Ban:-IP-Firewall
[wp-auth]
enabled = true
filter = wp-auth
port = http,https
logpath = /var/log/nginx*/access*.log
maxretry = 1
findtime = 86400
bantime = -1
# Fail2Ban configuration file
#
# Authentication failure
#
# Server: Nginx
# Author: Sergej Müller
#
[Definition]
# Option: failregex
# Notes : Too many authentication failures for IP
# Values: TEXT
#
failregex = ^<HOST>.+POST.+wp-login\.php.+ 401 [0-9]{1,}
# Option: ignoreregex
# Notes : Regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment