Browse Source

fail2ban support for Trusty

Marius Voila 9 years ago
parent
commit
e62bd7c71a

+ 5
- 0
roles/common/tasks/security.yml View File

@@ -9,6 +9,11 @@
9 9
   template: src=etc_fail2ban_jail.local.j2 dest=/etc/fail2ban/jail.local
10 10
   notify: restart fail2ban
11 11
 
12
+- name: Copy fail2ban configuration into place for Ubuntu Trusty
13
+  template: src=etc_trusty_fail2ban_jail.local.j2 dest=/etc/fail2ban/jail.local
14
+  when: ansible_sistributon_release == 'trusty'
15
+  notify: restart fail2ban
16
+
12 17
 - name: Copy fail2ban dovecot configuration into place
13 18
   copy: src=etc_fail2ban_filter.d_dovecot-pop3imap.conf dest=/etc/fail2ban/filter.d/dovecot-pop3imap.conf
14 19
   notify: restart fail2ban

+ 34
- 0
roles/common/templates/etc_trusty_fail2ban_jail.local.j2 View File

@@ -0,0 +1,34 @@
1
+[DEFAULT]
2
+ignoreip  = 127.0.0.1 {{ ansible_default_ipv4.address }} {{ ' '.join(friendly_networks) }}
3
+bantime   = 86400
4
+destemail = {{ admin_email }}
5
+banaction = iptables-multiport
6
+action    = %(action_)s
7
+
8
+# JAILS
9
+[ssh]
10
+enabled   = true
11
+maxretry  = 3
12
+
13
+[pam-generic]
14
+enabled   = true
15
+banaction = iptables-allports
16
+
17
+[ssh-ddos]
18
+enabled   = true
19
+
20
+[apache]
21
+enabled = true
22
+
23
+[postfix]
24
+enabled  = true
25
+maxretry = 1
26
+
27
+[dovecot-pop3imap]
28
+enabled = true
29
+filter = dovecot-pop3imap
30
+action = iptables-multiport[name=dovecot-pop3imap, port="pop3,imap,993,995", protocol=tcp]
31
+logpath = /var/log/maillog
32
+maxretry = 20
33
+findtime = 1200
34
+bantime = 1200

Loading…
Cancel
Save