test(fail2ban): test the role on Debian 13 (trixie) and declare it #277

Open
opened 2026-11-21 15:59:24 +00:00 by Dragonish · 1 comment
Collaborator

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 the fail2ban role? If so, #207's rule applies (a role declares, and passes Molecule on, the releases of the hosts it targets), and fail2ban is not in #226's scope today: meta/main.yml declares only Ubuntu noble, the README says "Ubuntu 24.04 (noble), the image the molecule scenario runs on", and #226 puts sshd, system_baseline, systemd_hardening, user_management and network_interfaces on 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.j2 with its default fail2ban_jails into a scratch copy of /etc/fail2ban and dumped it with fail2ban-client -c <scratch> -s <scratch socket> -p <scratch pid> -d (a private socket; no running fail2ban was touched).

Ubuntu 24.04.5 Debian 13
fail2ban 1.0.2-3ubuntu0.1 1.1.0-8
OpenSSH 9.6p1 10.0p1
config dump loads, no error loads, no error
effective journal match of the default sshd jail (the role sets none) _SYSTEMD_UNIT=sshd.service + _COMM=sshd, from filter.d/sshd.conf _SYSTEMD_UNIT=ssh.service + _COMM=sshd, from the package's jail.d/defaults-debian.conf, which overrides the filter's own … + _COMM=sshd-session
journal entries, last 7 days, unit ssh.service (none carry the unit sshd.service) 39,979, all _COMM=sshd 26,723: 26,642 sshd-session, 78 sudo, 3 sshd

In a journalctl match + is OR. On Ubuntu the unit term can never match (the unit is ssh.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 the sshd-session entries; OpenSSH 9.8 and later run authentication in a separate sshd-session process (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.yml asserts 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

  • If Debian 13 is a target: add fail2ban to the Debian scenarios as a follow-up to #226, once the image exists. The existing scenario already exercises both entry points (verify.yml checks the main jails and the service_jail jails svc-a and svc-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.
  • Declare trixie in meta/main.yml and the README's "Supported platforms" once that scenario passes. Until then the README can list it under "Untested platforms", as #207 describes.
  • Open question for that scenario: the cheapest assertion of effect that works in a container (for example that the jail's effective journal match covers the unit the image's sshd logs under), if the molecule image has a journal at all.
  • Not looked at, and a reason to want the test: Ubuntu 26.04 (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

  • Nothing ran in your CI, and I did not run mortis.kamino.fail2ban on Debian: I rendered its template and loaded the result with the package's fail2ban-client.
  • The dump shows that the configuration loads and which journal match the jail receives. It does not show that the daemon starts with the systemd backend, or that fail2ban parses a failed login on Debian: the fail2ban-regex check I tried gave line counts I could not rely on, and no ban was triggered. The counts above come from journalctl, not from fail2ban.
  • That + is OR is journalctl's documented behaviour, checked against its counts; I did not test how fail2ban itself combines the terms.
  • Debian 12 and Ubuntu 26.04 were not looked at.

Assisted-by: Claude Code

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 the `fail2ban` role? If so, #207's rule applies (a role declares, and passes Molecule on, the releases of the hosts it targets), and `fail2ban` is not in #226's scope today: `meta/main.yml` declares only Ubuntu `noble`, the README says "Ubuntu 24.04 (noble), the image the molecule scenario runs on", and #226 puts `sshd`, `system_baseline`, `systemd_hardening`, `user_management` and `network_interfaces` on 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.j2` with its default `fail2ban_jails` into a scratch copy of `/etc/fail2ban` and dumped it with `fail2ban-client -c <scratch> -s <scratch socket> -p <scratch pid> -d` (a private socket; no running fail2ban was touched). | | Ubuntu 24.04.5 | Debian 13 | |---|---|---| | fail2ban | 1.0.2-3ubuntu0.1 | 1.1.0-8 | | OpenSSH | 9.6p1 | 10.0p1 | | config dump | loads, no error | loads, no error | | effective journal match of the default `sshd` jail (the role sets none) | `_SYSTEMD_UNIT=sshd.service + _COMM=sshd`, from `filter.d/sshd.conf` | `_SYSTEMD_UNIT=ssh.service + _COMM=sshd`, from the package's `jail.d/defaults-debian.conf`, which overrides the filter's own `… + _COMM=sshd-session` | | journal entries, last 7 days, unit `ssh.service` (none carry the unit `sshd.service`) | 39,979, all `_COMM=sshd` | 26,723: 26,642 `sshd-session`, 78 `sudo`, 3 `sshd` | In a journalctl match `+` is OR. On Ubuntu the unit term can never match (the unit is `ssh.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 the `sshd-session` entries; OpenSSH 9.8 and later run authentication in a separate `sshd-session` process (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.yml` asserts 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 - If Debian 13 is a target: add `fail2ban` to the Debian scenarios as a follow-up to #226, once the image exists. The existing scenario already exercises both entry points (`verify.yml` checks the main jails and the `service_jail` jails `svc-a` and `svc-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. - Declare `trixie` in `meta/main.yml` and the README's "Supported platforms" once that scenario passes. Until then the README can list it under "Untested platforms", as #207 describes. - Open question for that scenario: the cheapest assertion of effect that works in a container (for example that the jail's effective journal match covers the unit the image's sshd logs under), if the molecule image has a journal at all. - Not looked at, and a reason to want the test: Ubuntu 26.04 (`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 - Nothing ran in your CI, and I did not run `mortis.kamino.fail2ban` on Debian: I rendered its template and loaded the result with the package's `fail2ban-client`. - The dump shows that the configuration loads and which journal match the jail receives. It does not show that the daemon starts with the systemd backend, or that fail2ban parses a failed login on Debian: the `fail2ban-regex` check I tried gave line counts I could not rely on, and no ban was triggered. The counts above come from `journalctl`, not from fail2ban. - That `+` is OR is journalctl's documented behaviour, checked against its counts; I did not test how fail2ban itself combines the terms. - Debian 12 and Ubuntu 26.04 were not looked at. Assisted-by: Claude Code
Dragonish added the
Status
Ready for Human
label 2026-11-21 15:59:24 +00:00
Defame1297 added this to the Continuous delivery milestone 2026-11-22 19:32:14 +00:00
Owner

Please be sure to check for overlapping issues

Please be sure to check for overlapping issues
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#277