File tree 3 files changed +43
-0
lines changed
3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ [DEFAULT]
2
+
3
+ # "bantime" is the number of seconds that a host is banned.
4
+ bantime = 1d
5
+
6
+ # A host is banned if it has generated "maxretry" during the last "findtime"
7
+ findtime = 1h
8
+
9
+ # "maxretry" is the number of failures before a host get banned.
10
+ maxretry = 5
Original file line number Diff line number Diff line change 91
91
offline : true
92
92
state : enabled
93
93
94
+ # fail2ban setup
95
+ # ##############
96
+ - name : Setup fail2ban
97
+ tags : fail2ban
98
+ block :
99
+ - name : Configure fail2ban
100
+ ansible.builtin.copy :
101
+ src : fail2ban/jail.local
102
+ dest : /etc/fail2ban/jail.local
103
+ notify :
104
+ - Restart fail2ban
105
+
106
+ - name : Configure SSH fail2ban
107
+ ansible.builtin.template :
108
+ src : fail2ban/sshd.local.j2
109
+ dest : /etc/fail2ban/jail.d/sshd.local
110
+ notify :
111
+ - Restart fail2ban
112
+
113
+ - name : Enable fail2ban service
114
+ ansible.builtin.systemd :
115
+ name : fail2ban.service
116
+ enabled : true
117
+ state : started
118
+
94
119
# Prepare and clone Git repositories
95
120
# ##################################
96
121
- name : Setup Git repositories
277
302
ansible.builtin.systemd :
278
303
daemon_reload : true
279
304
305
+ - name : Restart fail2ban
306
+ ansible.builtin.systemd :
307
+ name : fail2ban
308
+ state : restarted
309
+
280
310
- name : Restart Caddy
281
311
ansible.builtin.systemd :
282
312
name : caddy
Original file line number Diff line number Diff line change
1
+ [sshd]
2
+ enabled = true
3
+ ignoreip = 127.0.0.1/8 10.0.0.1/8 {{ ansible_eth0.ipv4.address }} {{ ansible_eth1.ipv4.address }}
You can’t perform that action at this time.
0 commit comments