File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed
Expand file tree Collapse file tree 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 9191 offline : true
9292 state : enabled
9393
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+
94119 # Prepare and clone Git repositories
95120 # ##################################
96121 - name : Setup Git repositories
277302 ansible.builtin.systemd :
278303 daemon_reload : true
279304
305+ - name : Restart fail2ban
306+ ansible.builtin.systemd :
307+ name : fail2ban
308+ state : restarted
309+
280310 - name : Restart Caddy
281311 ansible.builtin.systemd :
282312 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