Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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-off boot.
if [[ "${SELINUX_ENFORCING}" != "true" ]]; then
KERNEL_ARGS="${KERNEL_ARGS} selinux=0"
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/skills/ci-ops/e2e-workflow/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<kver>/` (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 '<target-image>'` 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
Expand Down Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/test_selinux_qualify.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,18 +337,18 @@ 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(
'echo "KERNEL_ARGS=${KERNEL_ARGS}" >> "$GITHUB_ENV"'
)


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"]
Expand All @@ -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' }}"

Expand Down
Loading