Add fail2ban role

This commit is contained in:
flyingscorpio@clevo 2022-03-13 22:31:02 +01:00
parent ddd4df9778
commit f92b5cde57
3 changed files with 26 additions and 0 deletions

View file

@ -48,3 +48,9 @@
systemd:
name: rsyslog
state: restarted
- name: Restart fail2ban service
become: true
systemd:
name: fail2ban
state: restarted

View file

@ -0,0 +1,3 @@
[DEFAULT]
banaction = nftables-multiport
banaction_allports = nftables-allports

View file

@ -0,0 +1,17 @@
---
- name: Install fail2ban
become: true
apt:
name: fail2ban
state: present
update_cache: yes
- name: Configure fail2ban for nftables
become: true
copy:
src: 00-banactions-nft.conf
dest: /etc/fail2ban/jail.d/00-banactions-nft.conf
owner: root
group: root
mode: 0644
notify: Restart fail2ban service