Skip to content

Commit

Permalink
refactor: update fail2ban
Browse files Browse the repository at this point in the history
- change banaction to ufw
- add findtime as variable
  • Loading branch information
MVladislav committed Sep 26, 2024
1 parent e6bad7f commit 1dca840
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ security_auditd_conf_variables:
# ------------------------------------------------------------------------------
# template jail.local.j2
security_jail_bantime: 3600
security_jail_banaction: iptables-allports # iptables-allports | iptables-multiport
security_jail_banaction: ufw # ufw | iptables-allports | iptables-multiport
security_jail_enabled: true
security_jail_maxretry: 3
security_jail_findtime: 300
security_jail_backend: systemd # auto | systemd

security_fail2ban_proxmox: false
Expand Down
4 changes: 2 additions & 2 deletions templates/jail.local.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[DEFAULT]
# Prevents banning Local (LAN subnets)
ignoreip = 127.0.0.1/8
ignoreip = 127.0.0.1/8 ::1
# 10.0.0.0/8
# 192.168.0.0/16
# 172.16.0.0/12
Expand All @@ -14,7 +14,7 @@ bantime = {{ security_jail_bantime }}
maxretry = {{ security_jail_maxretry }}

# A host is banned if it has generated "maxretry" during the last "findtime" seconds.
findtime = 300
findtime = {{ security_jail_findtime }}

allowipv6 = auto

Expand Down

0 comments on commit 1dca840

Please sign in to comment.