Skip to content

Limit fail2ban lockouts: cap at a day, per jail, with an allow-list - #35

Open
byjpr wants to merge 1 commit into
claude/admiring-planck-25cvzffrom
claude/fix-11-fail2ban-lockout
Open

byjpr wants to merge 1 commit into
claude/admiring-planck-25cvzffrom
claude/fix-11-fail2ban-lockout

Conversation

@byjpr

@byjpr byjpr commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Closes #11

Changes

  • Escalating bans are capped at 1 day (was 1 week).
  • Repeat offences are counted per jail (overalljails = false), so IMAP failures don't escalate SSH bans or the other way round.
  • settings.fail2banIgnoreIP: networks that are never banned, e.g. an office or home NAT, where one misconfigured phone would otherwise lock everyone out.
  • just unban <ip> runs fail2ban-client unban.

Brute-force protection stays intact: 3 failures still trigger a ban, with escalation.

Testing

  • The generated jail.local [DEFAULT] contains bantime.maxtime = 1d, bantime.overalljails = false and ignoreip = 127.0.0.1/8 ::1 198.51.100.0/24 (from the CI fixture).
  • All 5 provider example systems build. nixfmt, shellcheck and tofu validate pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01G22o7QQ17GRtkCqpJNFr9B


Generated by Claude Code

Escalating bans now stop at one day (was a week) and are counted per jail
instead of across all jails. settings.fail2banIgnoreIP lists networks that
are never banned (e.g. an office NAT), and just unban <ip> lifts a ban.

Closes #11

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01G22o7QQ17GRtkCqpJNFr9B
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Medium] fail2ban can lock legitimate users out for up to a week

2 participants