test(fail2ban): test the role on Debian 13 (trixie) and declare it #277
Notifications
Due Date
No due date set.
Depends on
Reference: Mortis/Kamino#277
Reference in new issue
Block a user
This is a request for a decision, not a bug report.
Related: #207 (what a platform declaration means; resolution: "Platforms follow the target hosts … Proxmox targets declare Debian
trixie", "Debian is kept and tested") and #226 (the Debian 13 Molecule image).Question
Is Debian 13 (
trixie), the OS of Proxmox VE 9 hosts, a target of thefail2banrole? If so, #207's rule applies (a role declares, and passes Molecule on, the releases of the hosts it targets), andfail2banis not in #226's scope today:meta/main.ymldeclares only Ubuntunoble, the README says "Ubuntu 24.04 (noble), the image the molecule scenario runs on", and #226 putssshd,system_baseline,systemd_hardening,user_managementandnetwork_interfaceson the Debian image.I run Fail2Ban on Proxmox VE 9 hosts and am evaluating this role for them, so for me it is a target.
What I checked
Read-only, on two hosts, outside your CI and without running the role: I rendered the role's
jail.local.j2with its defaultfail2ban_jailsinto a scratch copy of/etc/fail2banand dumped it withfail2ban-client -c <scratch> -s <scratch socket> -p <scratch pid> -d(a private socket; no running fail2ban was touched).sshdjail (the role sets none)_SYSTEMD_UNIT=sshd.service + _COMM=sshd, fromfilter.d/sshd.conf_SYSTEMD_UNIT=ssh.service + _COMM=sshd, from the package'sjail.d/defaults-debian.conf, which overrides the filter's own… + _COMM=sshd-sessionssh.service(none carry the unitsshd.service)_COMM=sshdsshd-session, 78sudo, 3sshdIn a journalctl match
+is OR. On Ubuntu the unit term can never match (the unit isssh.service), so the default works only through_COMM=sshd, which covers all 39,979 entries. On Debian the unit term covers the whole unit, including thesshd-sessionentries; OpenSSH 9.8 and later run authentication in a separatesshd-sessionprocess (from its release notes; I did not read message contents).python3-systemd, which the role installs, is available on trixie (235-1+b6).So the default configuration looks right on both. The point is that nothing tests it, and the declaration says it is not meant to work there.
Why a test is worth having
The effective match comes from different files on the two distributions (the filter on Ubuntu, a package drop-in on Debian) and depends on which OpenSSH process names write to the journal. A package change on either side could stop detection while the jail still loads.
verify.ymlasserts that the jail is loaded (fail2ban-client status); #245 counts that as a runtime effect, so this would go one step further: whether the jail would see an sshd entry.Proposal, for you to decide
fail2banto the Debian scenarios as a follow-up to #226, once the image exists. The existing scenario already exercises both entry points (verify.ymlchecks the main jails and theservice_jailjailssvc-aandsvc-b), and I found no OS-specific branch in the role's tasks, template or defaults, so converging it on the Debian image should be enough. It adds one converge-and-verify run to a full Molecule run.trixieinmeta/main.ymland the README's "Supported platforms" once that scenario passes. Until then the README can list it under "Untested platforms", as #207 describes.resolute), where the fail2ban and OpenSSH versions decide whether the default match still covers sshd's entries.I can send the scenario and documentation change as a pull request from my account (a branch in this repository, like #156) once the image exists and you mark this
Ready for Agent. I have not opened one.Not verified
mortis.kamino.fail2banon Debian: I rendered its template and loaded the result with the package'sfail2ban-client.fail2ban-regexcheck I tried gave line counts I could not rely on, and no ban was triggered. The counts above come fromjournalctl, not from fail2ban.+is OR is journalctl's documented behaviour, checked against its counts; I did not test how fail2ban itself combines the terms.Assisted-by: Claude Code
Please be sure to check for overlapping issues