fix(fail2ban): pin polling backend so jail actually reads Caddy access log (#503) #504
Reference in New Issue
Block a user
Delete Branch "fix/issue-503-fail2ban-polling-backend"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes #503.
Discovered during the production-deploy bootstrap for #497. fail2ban came up cleanly, the
familienarchiv-authjail loaded, butfail2ban-client get familienarchiv-auth logpathreturnedNo file is currently monitored. The jail had silently inherited Debian's[DEFAULT] backend = systemdfrom/etc/fail2ban/jail.d/defaults-debian.confand was reading from journald, not/var/log/caddy/access.log. A real login brute-force would never have been banned.Fix
infra/fail2ban/jail.d/familienarchiv.conf— addbackend = pollingwith a comment explaining why (override Debian default, no inotify dependency, fine for one rotated log)..gitea/workflows/ci.yml— new step in thefail2ban-regexjob that symlinks the jail+filter into/etc/fail2ban/and assertsfail2ban-client -dresolvesfamilienarchiv-authtopolling, not the inheritedsystemd. Catches a regression of the same shape at PR time.Why the existing CI test did not catch this
fail2ban-regexruns the filter against a sample line in isolation. It validates regex correctness, not backend resolution. The new step instantiates the jail throughfail2ban-client -dsodefaults-debian.confparticipates in the resolution.Test plan
fail2ban-client -don a freshly-bootstrapped server confirms the broken state without this fix (['add', 'familienarchiv-auth', 'systemd']).fail2ban-regexCI job —Jail resolves with polling backendstep passes (asserts the fix).cd /opt/familienarchiv && git pull && systemctl reload fail2ban, thenfail2ban-client get familienarchiv-auth logpathreturns/var/log/caddy/access.log.🤖 Generated with Claude Code