Install aggressive Fail2ban jail for SSH

This commit is contained in:
Kris Lamoureux 2022-06-18 19:47:02 -04:00
parent dd9f84d498
commit 82df91305a
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
2 changed files with 14 additions and 0 deletions

View File

@ -23,6 +23,17 @@
name: ssh name: ssh
rule: limit rule: limit
- name: Remove Fail2ban defaults-debian.conf
file:
path: /etc/fail2ban/jail.d/defaults-debian.conf
state: absent
- name: Install OpenSSH's Fail2ban jail
template:
src: fail2ban-ssh.conf.j2
dest: /etc/fail2ban/jail.d/sshd.conf
notify: restart_fail2ban
- name: Enable firewall - name: Enable firewall
ufw: ufw:
state: enabled state: enabled

View File

@ -0,0 +1,3 @@
[sshd]
mode = aggressive
enabled = true