1.1 KiB
1.1 KiB
fail2ban_rhel
A small role to deploy fail2ban on RHEL/Rocky 9+ hosts. Currently supports only a templated sshd jail.
Requirements
- Target hosts must be RHEL-family or Rocky Linux 9+
Supported Platforms
- RHEL 9+
- Rocky Linux 9+
Role Variables
sshd jail configuration
fail2ban_rhel_jail_sshd:enabled: enable the sshd jail. Default:trueport: fail2ban port for sshd. Default:sshlogpath: path to the SSH log file. Default:/var/log/securefindtime: time window for fail2ban. Default:600maxretry: maximum retry count. Default:5bantime: ban duration in seconds. Default:600ignoreips: list of IPs and CIDRs that fail2ban should ignore. Default:127.0.0.1/8,::1
Behavior
By default this role:
- installs
epel-releaseon RedHat-family systems when enabled - installs
fail2ban - creates
/etc/fail2ban/jail.d/sshd.conffrom a template - enables and starts the
fail2bansystemd service
Example Playbook
See: molecule/default/converge.yml
License
MIT