Make Fedora/Rocky a tested SELinux tier in the e2e harness #64

Merged
jcoffey-dev merged 1 commits from feat/selinux-tier into main 2026-11-13 16:34:44 +00:00
Owner

Makes Fedora/Rocky + SELinux a tested e2e tier — the last buildable [27.1] installer item. SELinux has stopped the installer before (a container couldn't read a directory mounted into it; see the comment in internal/apply/upgrade.go), and the lab already offers DISTRO=fedora/rocky9 — this makes a denial there an actual test failure.## The harness now catches denials (all files are shell; no Go change)- e2e/vm/run.sh: on a guest where SELinux is enforcing, it notes the time before the case and reads the audit log after it. Any AVC denial in the installer's footprint (its containers or /var/lib/inbuxa) fails the run even if the case's own checks passed — a denial it happened to survive today is a latent break. SELINUX_IGNORE=1 downgrades that to a warning. On a distro without SELinux enforcing, nothing changes.- e2e/vm/lib.sh: three small helpers it uses — vm_selinux_enforcing, vm_audit_checkpoint, vm_selinux_denials (footprint-filtered ausearch). No-ops where SELinux isn't enforcing.So every existing case (install, move, the upgrade-* cases) becomes a SELinux test when run on Fedora/Rocky, with no per-case duplication.## A dedicated case**e2e/cases/selinux.sh** drives the paths that have been caught before — install in containers, then backup (which archives the server's volumes through a container, the exact mechanism that bit), then converge — and after each confirms no denial and that SELinux is still enforcing. On a distro without SELinux enforcing it prints SKIPPED and passes, so it's safe to run anywhere.## ValidationNo KVM in my environment and no Fedora/Rocky image cached, so the enforcing run itself is for the VM harness (same as the deferred restore/rollback work). What I validated here:- bash -n clean on all three scripts.- The skip path runs end-to-end on Debian → SKIPPED, exit 0.- The denial filter against realistic ausearch -i output: a container-mount denial and a /var/lib/inbuxa denial both match (→ FAIL); an unrelated chronyd denial does not (no false positive).- scan() end-to-end against a mock ausearch → reports the denial and fails.README gains a short "SELinux tier" paragraph and the new case in the list.Note for review: this changes behavior for existing Fedora/Rocky runs — they now also gate on SELinux denials. That's the intent of the tier; SELINUX_IGNORE=1 is the escape hatch. A real DISTRO=fedora e2e/vm/run.sh e2e/cases/selinux.sh on your VM harness is the last step to confirm the enforcing path.

Makes **Fedora/Rocky + SELinux a tested e2e tier** — the last buildable [27.1] installer item. SELinux has stopped the installer before (a container couldn't read a directory mounted into it; see the comment in `internal/apply/upgrade.go`), and the lab already offers `DISTRO=fedora`/`rocky9` — this makes a denial there an actual test failure.## The harness now catches denials (all files are shell; no Go change)- **`e2e/vm/run.sh`**: on a guest where SELinux is enforcing, it notes the time before the case and reads the audit log after it. Any AVC denial in the installer's footprint (its containers or `/var/lib/inbuxa`) **fails the run even if the case's own checks passed** — a denial it happened to survive today is a latent break. `SELINUX_IGNORE=1` downgrades that to a warning. On a distro without SELinux enforcing, nothing changes.- **`e2e/vm/lib.sh`**: three small helpers it uses — `vm_selinux_enforcing`, `vm_audit_checkpoint`, `vm_selinux_denials` (footprint-filtered `ausearch`). No-ops where SELinux isn't enforcing.So every existing case (install, `move`, the `upgrade-*` cases) becomes a SELinux test when run on Fedora/Rocky, with no per-case duplication.## A dedicated case**`e2e/cases/selinux.sh`** drives the paths that have been caught before — install in containers, then `backup` (which archives the server's volumes **through a container**, the exact mechanism that bit), then converge — and after each confirms no denial and that SELinux is still enforcing. On a distro without SELinux enforcing it prints `SKIPPED` and passes, so it's safe to run anywhere.## ValidationNo KVM in my environment and no Fedora/Rocky image cached, so the **enforcing run itself is for the VM harness** (same as the deferred restore/rollback work). What I validated here:- `bash -n` clean on all three scripts.- The **skip path** runs end-to-end on Debian → `SKIPPED`, exit 0.- The **denial filter** against realistic `ausearch -i` output: a container-mount denial and a `/var/lib/inbuxa` denial both match (→ FAIL); an unrelated `chronyd` denial does not (no false positive).- `scan()` end-to-end against a mock `ausearch` → reports the denial and fails.README gains a short "SELinux tier" paragraph and the new case in the list.**Note for review:** this changes behavior for existing Fedora/Rocky runs — they now also gate on SELinux denials. That's the intent of the tier; `SELINUX_IGNORE=1` is the escape hatch. A real `DISTRO=fedora e2e/vm/run.sh e2e/cases/selinux.sh` on your VM harness is the last step to confirm the enforcing path.
jcoffey-dev added 1 commit 2026-11-13 16:30:56 +00:00
On the Red Hat family the installer runs under SELinux enforcing, and
SELinux has stopped it before -- a container could not read a directory
mounted into it (internal/apply/upgrade.go). The lab already offers
Fedora and Rocky; this makes a denial there a test failure.

run.sh, on a guest where SELinux is enforcing, notes the time before the
case and reads the audit log after it: any AVC denial in the installer's
footprint (its containers or /var/lib/inbuxa) fails the run even when the
case's own checks passed, because a denial it happened to survive today
is a latent break. SELINUX_IGNORE=1 downgrades that to a warning, and on
a distribution without SELinux enforcing nothing changes. lib.sh gains
the three helpers it uses.

e2e/cases/selinux.sh drives the paths that have been caught before --
install in containers, then a backup, which archives the server's
volumes through a container, then converge -- and after each confirms no
denial and that SELinux is still enforcing. It skips and passes where
SELinux is not the thing under test.
jcoffey-dev merged commit 0a88d67d25 into main 2026-11-13 16:34:44 +00:00
jcoffey-dev deleted branch feat/selinux-tier 2026-11-13 16:34:44 +00:00
Sign in to join this conversation.