From 9b8d7773b9103143c5acc983b0dd8d4c0f6a975b Mon Sep 17 00:00:00 2001 From: Michael Kroes Date: Thu, 24 Mar 2016 14:16:57 +0100 Subject: [PATCH] Add fail2ban checks for roudcube --- conf/fail2ban/jail.local | 8 ++++++++ conf/fail2ban/roundcube.conf | 14 ++++++++++++++ setup/system.sh | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 conf/fail2ban/roundcube.conf diff --git a/conf/fail2ban/jail.local b/conf/fail2ban/jail.local index 786f2fd9..e7ab33ba 100644 --- a/conf/fail2ban/jail.local +++ b/conf/fail2ban/jail.local @@ -32,6 +32,14 @@ logpath = /var/log/syslog maxretry = 20 findtime = 30 +[roundcube] +enabled = true +port = http,https +filter = roundcube +logpath = /var/log/roundcubemail/errors +maxretry = 20 +findtime = 30 + [recidive] enabled = true maxretry = 10 diff --git a/conf/fail2ban/roundcube.conf b/conf/fail2ban/roundcube.conf new file mode 100644 index 00000000..7aa7c8bd --- /dev/null +++ b/conf/fail2ban/roundcube.conf @@ -0,0 +1,14 @@ +# Fail2Ban configuration file for roundcube web server +# +# +# + +[INCLUDES] + +before = common.conf + +[Definition] + +failregex = IMAP Error: Login failed for .*? from \. AUTHENTICATE.* + +ignoreregex = diff --git a/setup/system.sh b/setup/system.sh index cff423ce..cd633b62 100755 --- a/setup/system.sh +++ b/setup/system.sh @@ -233,5 +233,5 @@ cat conf/fail2ban/jail.local \ > /etc/fail2ban/jail.local cp conf/fail2ban/dovecotimap.conf /etc/fail2ban/filter.d/dovecotimap.conf cp conf/fail2ban/miab-management-daemon.conf /etc/fail2ban/filter.d/miab-management-daemon.conf - +cp conf/fail2ban/roundcube.conf /etc/fail2ban/filter.d/roundcube.conf restart_service fail2ban