Make use of fail2ban jail.d

This commit is contained in:
Michael Kroes 2016-03-29 18:43:05 +02:00
parent 710ad87602
commit 1e02bb0bf1
18 changed files with 55 additions and 68 deletions

View File

@ -0,0 +1,5 @@
[dovecot]
enabled = true
filter = dovecotimap
findtime = 30
maxretry = 20

View File

@ -0,0 +1,7 @@
[miab-management-daemon]
enabled = true
filter = miab-management-daemon
port = http,https
logpath = /var/log/syslog
maxretry = 20
findtime = 30

View File

@ -0,0 +1,7 @@
[miab-munin]
enabled = true
port = http,https
filter = miab-munin
logpath = /var/log/nginx/access.log
maxretry = 20
findtime = 30

View File

@ -0,0 +1,7 @@
[miab-owncloud]
enabled = true
port = http,https
filter = miab-owncloud
logpath = /home/user-data/owncloud/owncloud.log
maxretry = 20
findtime = 30

View File

@ -0,0 +1,7 @@
[miab-postfix-submission]
enabled = true
port = 587
filter = miab-postfix-submission
logpath = /var/log/mail.log
maxretry = 20
findtime = 30

View File

@ -0,0 +1,7 @@
[miab-roundcube]
enabled = true
port = http,https
filter = miab-roundcube
logpath = /var/log/roundcubemail/errors
maxretry = 20
findtime = 30

View File

@ -0,0 +1,4 @@
[recidive]
enabled = true
maxretry = 10

View File

@ -0,0 +1,2 @@
[sasl]
enabled = true

View File

@ -0,0 +1,2 @@
[ssh-ddos]
enabled = true

View File

@ -0,0 +1,3 @@
[ssh]
maxretry = 7
bantime = 3600

View File

@ -6,65 +6,3 @@
# ours too. The string is substituted during installation. # ours too. The string is substituted during installation.
ignoreip = 127.0.0.1/8 PUBLIC_IP ignoreip = 127.0.0.1/8 PUBLIC_IP
# JAILS
[ssh]
maxretry = 7
bantime = 3600
[ssh-ddos]
enabled = true
[sasl]
enabled = true
[dovecot]
enabled = true
filter = dovecotimap
findtime = 30
maxretry = 20
[management-daemon]
enabled = true
filter = miab-management-daemon
port = http,https
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
[owncloud]
enabled = true
port = http,https
filter = owncloud
logpath = /home/user-data/owncloud/owncloud.log
maxretry = 20
findtime = 30
[munin]
enabled = true
port = http,https
filter = munin
logpath = /var/log/nginx/access.log
maxretry = 20
findtime = 30
[postfix-submission]
enabled = true
port = 587
filter = postfix-submission
logpath = /var/log/mail.log
maxretry = 20
findtime = 30
[recidive]
enabled = true
maxretry = 10

View File

@ -285,10 +285,8 @@ restart_service resolvconf
cat conf/fail2ban/jail.local \ cat conf/fail2ban/jail.local \
| sed "s/PUBLIC_IP/$PUBLIC_IP/g" \ | sed "s/PUBLIC_IP/$PUBLIC_IP/g" \
> /etc/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 -f conf/fail2ban/filter.d/* /etc/fail2ban/filter.d/
cp conf/fail2ban/roundcube.conf /etc/fail2ban/filter.d/roundcube.conf cp -f conf/fail2ban/jail.d/* /etc/fail2ban/jail.d/
cp conf/fail2ban/owncloud.conf /etc/fail2ban/filter.d/owncloud.conf
cp conf/fail2ban/munin.conf /etc/fail2ban/filter.d/munin.conf
cp conf/fail2ban/postfix-submission.conf /etc/fail2ban/filter.d/postfix-submission.conf
restart_service fail2ban restart_service fail2ban