My changes can be viewed on Github and will hopefully be included in future versions of Fail2Ban.
https://github.com/fail2ban/fail2ban/co ... arz:master
Basically, add the following to /etc/fail2ban/jail.conf
Code: Select all
[zoneminder]
# Zoneminder HTTP/HTTPS web interface auth
# Logs auth failures to apache2 error log
enabled = true
port = http,https
filter = zoneminder
logpath = /var/log/apache*/*error.log
maxretry = 3
Code: Select all
# Fail2Ban filter for Zoneminder login failures
#
[Definition]
# patern : [client 10.1.1.1:38022] WAR [Login denied for user "test"], referer: https://zoneminderurl/
#
#
# Option: failregex
# Notes.: regex to match the password failure messages in the logfile. The
# host must be matched by a group named "host". The tag "<HOST>" can
# be used for standard IP/hostname matching and is only an alias for
# (?:::f{4,6}:)?(?P<host>[\w\-.^_]+)
failregex = [[]client <HOST>:\d\d\d\d\d] WAR [[]Login denied for user
ignoreregex =
# Notes:
# Tested on Zoneminder 1.29.0
#
# Author: John Marzella