From 872ab8be871f52010d1165da1d338cec85a8a7cb Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Sat, 7 Nov 2026 12:38:50 -0500 Subject: [PATCH 1/2] feat(e2e): boot guest with SELinux enforcing by default Flip selinux_enforcing default to true in e2e.yml and manual.yml so the GHA VM is qualified with the candidate's own SELinux mode instead of selinux=0. Callers can still pass false for the legacy boot. Closes #1024 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- .github/workflows/e2e.yml | 10 +++++----- .github/workflows/manual.yml | 4 ++-- docs/skills/ci-ops/e2e-workflow/SKILL.md | 6 +++--- .../e2e-workflow/references/selinux-enforcing.md | 9 +++++---- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index dc968bb97..f66f5f828 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -70,10 +70,10 @@ on: description: > Boot the guest with the candidate's own SELinux mode instead of selinux=0, label the harness files, verify enforcing after boot and - run the AVC denial gate (#1024). Defaults to false until a hosted - run qualifies the path and the rollout plan in #1021 turns it on. + run the AVC denial gate (#1024). Defaults to true; set false only + to fall back to the legacy selinux=0 boot while triaging. type: boolean - default: false + default: true migration-target: description: > Migration target image ref for cross-registry migration scenarios. @@ -563,8 +563,8 @@ jobs: # systemd.journald.forward_to_console=1 — forward full journal to serial for # diagnostics when SSH fails (output captured in vm-serial.log artifact). KERNEL_ARGS="root=UUID=${ROOT_UUID} rw ostree=${OSTREE_PATH} systemd.firstboot=no console=ttyS0,115200 systemd.journald.forward_to_console=1 systemd.mask=brew-setup.service systemd.mask=NetworkManager-wait-online.service systemd.mask=firewalld.service systemd.mask=wpa_supplicant.service systemd.mask=flatpak-preinstall.service systemd.mask=podman-auto-update.service systemd.mask=podman-auto-update.timer systemd.mask=malcontent-webd.service systemd.mask=malcontent-webd-update.service systemd.mask=malcontent-control.service systemd.mask=speech-dispatcherd.service systemd.mask=avahi-daemon.service systemd.mask=avahi-daemon.socket systemd.mask=cups.service systemd.mask=cups.path systemd.mask=cups.socket systemd.mask=cups.browsed.service systemd.mask=blueman-mechanism.service systemd.mask=gnome-remote-desktop.service systemd.mask=bazzite-hardware-setup.service systemd.mask=greenboot-healthcheck.service systemd.mask=greenboot-set-rollback-trigger.service systemd.mask=systemd-udev-settle.service systemd.wants=sshd.service" - # Enforcing mode is opt-in (inputs.selinux_enforcing) until a hosted - # run qualifies it; otherwise the guest keeps SELinux off as before. + # Enforcing mode is the default (inputs.selinux_enforcing); passing + # false falls back to the legacy selinux=0 boot. if [[ "${SELINUX_ENFORCING}" != "true" ]]; then KERNEL_ARGS="${KERNEL_ARGS} selinux=0" fi diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 895859d94..1082e3aae 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -21,9 +21,9 @@ on: required: false default: "false" selinux_enforcing: - description: "Boot the guest SELinux enforcing and run the AVC denial gate (#1024)" + description: "Boot the guest SELinux enforcing and run the AVC denial gate (#1024); set false for legacy selinux=0" required: false - default: "false" + default: "true" test_ref: description: "Git ref for tests/ checkout (default: dispatched branch; set to override)" required: false diff --git a/docs/skills/ci-ops/e2e-workflow/SKILL.md b/docs/skills/ci-ops/e2e-workflow/SKILL.md index ce4b7f3a3..88ed40329 100644 --- a/docs/skills/ci-ops/e2e-workflow/SKILL.md +++ b/docs/skills/ci-ops/e2e-workflow/SKILL.md @@ -200,12 +200,12 @@ another script runs. Why this fails silently: [troubleshooting.md](references/tr - Mounts the raw disk, finds `ROOT_UUID` (partition 3), ostree deployment hash, and `KVER` - Copies `vmlinuz` + `initramfs.img` from deployment `usr/lib/modules//` (or boot partition fallback) - Creates `boot.N` symlinks needed by `ostree-system-generator` (including canonical `boot.N` alias for versioned `boot.N.M` dirs produced by newer bootc) - - Sets `KERNEL_ARGS` env (includes `root=UUID=...`, masked services, serial console; `selinux=0` unless `selinux_enforcing: true`, which boots the candidate's own SELinux mode, see `references/selinux-enforcing.md`) + - Sets `KERNEL_ARGS` env (includes `root=UUID=...`, masked services, serial console; boots the candidate's own SELinux mode by default; `selinux=0` only when a caller passes `selinux_enforcing: false`, see `references/selinux-enforcing.md`) - Iterates all deployment directories and writes: `bluefin-test` user (UID 1001, added to `wheel` like a real first-run admin account — common's `org.ublue.privileged.user.setup` polkit rule grants wheel only), GDM autologin, sshd drop-in `00-ci-auth.conf`, dconf `local.d/00-ci-testing` override, `tmpfiles.d/ci-user.conf`, masked service symlinks - Pre-installs `unsafe-mode@bluefin-test` gnome-shell extension files into var home (pre-boot, so gnome-shell finds it during `_loadExtensions()`) - Injects SSH authorized key into `/var/home/bluefin-test/.ssh/` and each deployment's `/etc/ssh/ci-authorized-keys` 10. **Boot VM** — `qemu-system-x86_64` with KVM, 4 GB RAM, 4 vCPUs, `-vga none` + `virtio-gpu-pci` (one display adapter; q35's default std VGA made mutter light a second monitor, so desktop screenshots came out 2560x800), forwarded SSH on port 2222; daemonized; QEMU monitor socket at `/tmp/qemu-monitor.sock` (chmod 666) -11. **Wait for SSH** — polls port 2222 up to **15 minutes** (900 s); then, with `selinux_enforcing: true`, **Verify SELinux enforcing** — fails unless `getenforce` is `Enforcing` when the image ships a policy store; records `sestatus`/`id -Z`/`ls -Z` to `results/selinux/` +11. **Wait for SSH** — polls port 2222 up to **15 minutes** (900 s); then, unless `selinux_enforcing: false`, **Verify SELinux enforcing** — fails unless `getenforce` is `Enforcing` when the image ships a policy store; records `sestatus`/`id -Z`/`ls -Z` to `results/selinux/` 12. **Pre-stage target image via bootc switch** — lifecycle suite only, when `inputs.target-image` is set; SSHes into VM and runs `sudo bootc switch ''` to stage the upgrade target before the test run 13. **Dump VM serial log** — always runs (`if: always()`); primary debug tool when SSH never comes up 14. **Wait for GNOME session** — polls `/run/user/1001/wayland-0` up to 3 minutes @@ -495,6 +495,6 @@ Load these when you hit the specific topic: - [Installer suite assertions, and why an env-var gate made one unreachable.](references/installer-suite.md) - [Migration inputs `migration-target` / `extra-tags` and the startup_failure they cause when missing.](references/migration-inputs.md) - [GNOME OS guest lane for the developer extension-validation service and its mandatory gate.](references/gnome-extensions-validation.md) -- [SELinux enforcing in the e2e guest (opt-in): labeling, mode checks, AVC gate, canary.](references/selinux-enforcing.md) +- [SELinux enforcing in the e2e guest (default on): labeling, mode checks, AVC gate, canary.](references/selinux-enforcing.md) - [GNOME OS image provenance (2-week tag expiry), verified guest inventory, and the extensions pre-boot preflight](references/gnomeos-guest-provenance.md) - [Which units the fast e2e lane masks, why, and which still need a startup-qualification lane.](references/startup-service-inventory.md) diff --git a/docs/skills/ci-ops/e2e-workflow/references/selinux-enforcing.md b/docs/skills/ci-ops/e2e-workflow/references/selinux-enforcing.md index 5e3892536..d4b53d7c1 100644 --- a/docs/skills/ci-ops/e2e-workflow/references/selinux-enforcing.md +++ b/docs/skills/ci-ops/e2e-workflow/references/selinux-enforcing.md @@ -8,10 +8,11 @@ metadata: --- # SELinux enforcing in the e2e guest -The lane is opt-in: callers pass `selinux_enforcing: true` (`manual.yml` -exposes the same input). With the default `false` the guest keeps -`selinux=0` and every step below is skipped, until a hosted run qualifies the -lane and the rollout plan in #1021 flips the default. +The lane is on by default: `selinux_enforcing` defaults to `true` in both +`e2e.yml` and `manual.yml` (#1024, rollout in #1021). Callers may pass +`selinux_enforcing: false` to fall back to the legacy `selinux=0` boot, in +which case every step below is skipped; use that only to triage, not to make +a candidate pass. When enabled, `e2e.yml` boots the candidate with its own SELinux mode. There is no `selinux=0`, `enforcing=0` or `enforcing=1` on the kernel command line: From bf473eb33a5007127cc5d460d51ffd44663d17ac Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Sat, 7 Nov 2026 14:33:21 -0500 Subject: [PATCH 2/2] test(selinux): expect enforcing-by-default e2e boot Update selinux_qualify unit tests for the flipped selinux_enforcing default and reword the KERNEL_ARGS comment so the install step keeps a single selinux=0 occurrence. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- .github/workflows/e2e.yml | 2 +- tests/unit/test_selinux_qualify.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index f66f5f828..b99cf7a34 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -564,7 +564,7 @@ jobs: # diagnostics when SSH fails (output captured in vm-serial.log artifact). KERNEL_ARGS="root=UUID=${ROOT_UUID} rw ostree=${OSTREE_PATH} systemd.firstboot=no console=ttyS0,115200 systemd.journald.forward_to_console=1 systemd.mask=brew-setup.service systemd.mask=NetworkManager-wait-online.service systemd.mask=firewalld.service systemd.mask=wpa_supplicant.service systemd.mask=flatpak-preinstall.service systemd.mask=podman-auto-update.service systemd.mask=podman-auto-update.timer systemd.mask=malcontent-webd.service systemd.mask=malcontent-webd-update.service systemd.mask=malcontent-control.service systemd.mask=speech-dispatcherd.service systemd.mask=avahi-daemon.service systemd.mask=avahi-daemon.socket systemd.mask=cups.service systemd.mask=cups.path systemd.mask=cups.socket systemd.mask=cups.browsed.service systemd.mask=blueman-mechanism.service systemd.mask=gnome-remote-desktop.service systemd.mask=bazzite-hardware-setup.service systemd.mask=greenboot-healthcheck.service systemd.mask=greenboot-set-rollback-trigger.service systemd.mask=systemd-udev-settle.service systemd.wants=sshd.service" # Enforcing mode is the default (inputs.selinux_enforcing); passing - # false falls back to the legacy selinux=0 boot. + # false falls back to the legacy SELinux-off boot. if [[ "${SELINUX_ENFORCING}" != "true" ]]; then KERNEL_ARGS="${KERNEL_ARGS} selinux=0" fi diff --git a/tests/unit/test_selinux_qualify.py b/tests/unit/test_selinux_qualify.py index fed8200df..3906c02f5 100644 --- a/tests/unit/test_selinux_qualify.py +++ b/tests/unit/test_selinux_qualify.py @@ -337,7 +337,7 @@ def test_guest_kernel_args_do_not_disable_selinux(): kernel_args = next(line for line in install.splitlines() if 'KERNEL_ARGS="root=' in line) for arg in ("selinux=0", "enforcing=0", "security=none"): assert arg not in kernel_args - # selinux=0 is only appended when enforcing mode was not opted into. + # selinux=0 is only appended when a caller opts out of enforcing mode. assert install.count("selinux=0") == 1 guard = install.index('if [[ "${SELINUX_ENFORCING}" != "true" ]]; then') assert guard < install.index('KERNEL_ARGS="${KERNEL_ARGS} selinux=0"') < install.index( @@ -345,10 +345,10 @@ def test_guest_kernel_args_do_not_disable_selinux(): ) -def test_enforcing_mode_is_opt_in_and_defaults_off(): +def test_enforcing_mode_defaults_on_and_can_be_opted_out(): selinux_input = _e2e()[True]["workflow_call"]["inputs"]["selinux_enforcing"] assert selinux_input["type"] == "boolean" - assert selinux_input["default"] is False + assert selinux_input["default"] is True install_step = _steps()["Install OCI image and configure disk"] assert "inputs.selinux_enforcing" in install_step["env"]["SELINUX_ENFORCING"] install = install_step["run"] @@ -358,9 +358,9 @@ def test_enforcing_mode_is_opt_in_and_defaults_off(): assert "env.SELINUX_EXPECTED == 'enforcing'" in _steps()["SELinux denial gate"]["if"] -def test_manual_dispatch_can_opt_into_enforcing(): +def test_manual_dispatch_defaults_to_enforcing(): manual = yaml.safe_load((ROOT / ".github" / "workflows" / "manual.yml").read_text()) - assert manual[True]["workflow_dispatch"]["inputs"]["selinux_enforcing"]["default"] == "false" + assert manual[True]["workflow_dispatch"]["inputs"]["selinux_enforcing"]["default"] == "true" passed = manual["jobs"]["test"]["with"]["selinux_enforcing"] assert passed == "${{ github.event.inputs.selinux_enforcing == 'true' }}"