Configuration fail2ban
Configuration de fail2ban pour faire du DROP plutôt que du REJECT Fichier commun à debian et centos, qu'on peut donc déployer avec main.yml
- name: Fail2ban default configuration for sshd
blockinfile:
path: /etc/fail2ban/jail.local
create : yes
state : present
block: |
[DEFAULT]
# Ban hosts for one hour:
bantime = 3600
# Override /etc/fail2ban/jail.d/00-firewalld.conf:
banaction = iptables-multiport[blocktype=DROP]
[sshd]
enabled = true
- name: restart fail2ban service
service:
state: restarted
name: fail2ban
Edited by BLANCHET Christophe