Repository navigation
Conversation
…n a second unit Every boot, ublue-booted-image-sync ran `bootc status --json` inside the unconfined service domain, and bootc's relabelling chcon probe was denied mac_admin: two AVC denials per boot (#1198). - ublue-booted-image.service now runs only /usr/bin/bootc status --json, so bootc enters its own SELinux domain, with StandardOutput=truncate: into /run/ublue-os/booted-image.json. - ublue-booted-image-sync.service (new; Requires/After the snapshot) parses that JSON into /run/ublue-os/booted-image. It is a separate unit because systemd reopens a unit's StandardOutput= file for every command: an ExecStartPost= in the same unit reads a truncated file, and an ExecStartPre= cannot create the directory its own output needs. - tmpfiles.d creates /run/ublue-os before the snapshot runs. - The sync unit is enabled in configure-services.sh, the preset and the desktop contract. - tests/test_booted_image_unit.py checks both units, and also fails any shipped unit that sends output to a file and also has ExecStartPre= or ExecStartPost=. - luks-e2e.sh checks the installed image has /run/ublue-os/booted-image and no chcon/bootc AVC denials. Supersedes #1203, whose approach (bootc as ExecStart) this keeps, with the output handling reworked as requested in its review. Fixes #1198 Assisted-by: Claude Opus 5.5 via Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7qQa538Zjcuvv8jBtn Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danathar The full list of commands accepted by this bot can be found here. Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Stand-in review at 0db1983. The approach is right, and better than one unit with One behavior change worth deciding on purpose:
Small notes:
Not approving: this is Doug's PR. CI is still running. |
The old ublue-booted-image-sync ran `bootc status --json || true` and always exited 0. As the bare ExecStart, a bootc failure would fail the unit and, through Requires=, keep ublue-booted-image-sync.service from starting. The "-" prefix keeps the old tolerance; systemd strips it, so bootc is still the executable and keeps its SELinux entrypoint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7tJ5iop2b4GMkKSPAv Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
review_vm run 43600763520 on 0db1983 wrote /run/ublue-os/booted-image, but the boot still logged both chcon mac_admin denials, from unconfined_service_t. Running bootc as the unit's ExecStart does not move it into another SELinux domain; any boot service runs it as unconfined_service_t, where its relabelling probe is denied. So no boot unit runs bootc now: - ublue-booted-image-sync follows /proc/cmdline to the booted deployment (ostree= for ostree, composefs[.digest]= for composefs) and reads container-image-reference from its origin file, dropping the transport prefix. That is the ref bootc reports as .status.booted.image.image.image. - ublue-booted-image.service is a single unit again; the separate sync unit, the tmpfiles entry and the "-" ExecStart prefix are gone. - Tests run the script against ostree and composefs fixture trees, including three transports, a non-booted deployment, and no origin. The guard against file-output units with ExecStartPre=/ExecStartPost= stays. Assisted-by: Claude Opus 5.5 via Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7qQa538Zjcuvv8jBtn Signed-off-by: Danathar <Danathar@users.noreply.github.com>
review_vm run 43605406732 on a3fe39d: ublue-booted-image no longer runs bootc and wrote /run/ublue-os/booted-image, yet the boot still logged both chcon mac_admin denials from unconfined_service_t. So #1198's attribution, which was by timing (the denials came about 12.7 s into boot, when that unit started), was wrong, and so was ublue-firstboot-date, which started at the same moment but runs no chcon. When the check fails, luks-e2e.sh now runs iso/scripts/avc-origin.sh on the installed system. For each denial it prints the audit records sharing its serial (SYSCALL with ppid and exe, PROCTITLE decoded to the chcon command line), the parent's systemd unit from the journal, and the journal two seconds either side. Refs #1198 Assisted-by: Claude Opus 5.5 via Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7qQa538Zjcuvv8jBtn Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
Re-review at 4496a61 (origin-file rework, supersedes my 98c1a47 Checked:
Unverified from here: the composefs path ( |
Run 43609614948: the image loads no audit rules, so the denials had no SYSCALL record and no ppid. The journal window's 60-line cap also ended about 2 s before the denials (16:19:58.104 and .631). The visible part showed bootupd's bootloader-update.service and bootc's bootc-status-updated-onboot.target starting just before. avc-origin.sh now lists every service whose ExecMainPID falls in the 300 PIDs before each denial (a parent's PID is almost always just below its child's), and widens the journal window to ±1 s with a 400-line cap. Refs #1198 Assisted-by: Claude Opus 5.5 via Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7qQa538Zjcuvv8jBtn Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
Closing in favour of #1279. Owner decision (2026-11-16, delegated). Thanks, @Danathar. Your diagnostics here are what pinned #1198 down: the ExecStart experiment (run 43600763520), the removal of bootc from the boot units (run 43605406732), and CountMe confirmed as the source with #1247 (run 43762243257). #1279 builds on them:
The |
`bootc status` probes for mac_admin by running chcon with a label the policy does not define. From a plain service (common's projectbluefin-countme runs `bootc status --json` as root) the probe is denied in unconfined_service_t, and every boot logs two AVC denials that fail the testsuite's SELinux gate. bootc expects the denial and carries on, so the fix is a policy module with one dontaudit rule, not an allow: an allow would let every unconfined service write labels the policy does not know and would change what the probe decides. The module store is on read-only /usr once booted (#551), so the desktop RUN step loads utah_bootc_probe.cil with `semodule -n -i`. A new [selinux] section in the desktop contract makes the in-image verifier check `semodule -l` and fail the build if the module is missing. The installed-system e2e (review VM) now fails on any chcon/bootc AVC denial, the check #1220 introduced. Closes #1198 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
`bootc status` probes for mac_admin by running chcon with a label the policy does not define. From a plain service (common's projectbluefin-countme runs `bootc status --json` as root) the probe is denied in unconfined_service_t, and every boot logs two AVC denials that fail the testsuite's SELinux gate. bootc expects the denial and carries on, so the fix is a policy module with one dontaudit rule, not an allow: an allow would let every unconfined service write labels the policy does not know and would change what the probe decides. The module store is on read-only /usr once booted (#551), so the desktop RUN step loads utah_bootc_probe.cil with `semodule -n -i`. A new [selinux] section in the desktop contract makes the in-image verifier check `semodule -l` and fail the build if the module is missing. The installed-system e2e (review VM) now fails on any chcon/bootc AVC denial, the check #1220 introduced. Closes #1198 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…1279) * fix(selinux): dontaudit bootc's mac_admin probe from plain services `bootc status` probes for mac_admin by running chcon with a label the policy does not define. From a plain service (common's projectbluefin-countme runs `bootc status --json` as root) the probe is denied in unconfined_service_t, and every boot logs two AVC denials that fail the testsuite's SELinux gate. bootc expects the denial and carries on, so the fix is a policy module with one dontaudit rule, not an allow: an allow would let every unconfined service write labels the policy does not know and would change what the probe decides. The module store is on read-only /usr once booted (#551), so the desktop RUN step loads utah_bootc_probe.cil with `semodule -n -i`. A new [selinux] section in the desktop contract makes the in-image verifier check `semodule -l` and fail the build if the module is missing. The installed-system e2e (review VM) now fails on any chcon/bootc AVC denial, the check #1220 introduced. Closes #1198 Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(contract): keep the desktop-contract skill within 500 lines Assisted-by: Claude Opus via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: mergeraptor[bot] <267480593+mergeraptor[bot]@users.noreply.github.com>
Summary: Every Utah boot logged two SELinux denials because
bootc statusran inside a script, in the wrong security context. This runs bootc as the boot unit's own command, so it gets its proper context, and moves the parsing into a second unit. #1203 found the cause and had the right idea; its review found two output-handling bugs, and this fixes them.What changes
ublue-booted-image.servicenow runs only/usr/bin/bootc status --json, with its output going to/run/ublue-os/booted-image.json. As the unit'sExecStart, bootc enters its own SELinux domain, so itschconprobe is no longer deniedmac_admin.ublue-booted-image-sync.serviceis new. It runs after the first unit (Requires=/After=) and turns that JSON into/run/ublue-os/booted-image, which fastfetch reads./run/ublue-osbefore the first unit starts.configure-services.sh, the preset and the desktop contract, and the docs are updated.Why two units (the #1203 review)
systemd opens a unit's
StandardOutput=file again for every command the unit runs:ExecStartPost=that reads the file finds it truncated.ExecStartPre=that creates the file's directory fails before it runs.I reproduced both with transient user units, using
/bin/echoas a stand-in for bootc:StandardOutput=truncate:plusExecStartPost=(#1203)ghcr.io/projectbluefin/utah:testingTests
tests/test_booted_image_unit.pycovers both units, the tmpfiles rule, and that the sync script never runs bootc. It also fails any shipped unit that sendsStandardOutput=/StandardError=to a file and hasExecStartPre=/ExecStartPost=.iso/scripts/luks-e2e.shnow checks the installed image: both units are active,/run/ublue-os/booted-imageis non-empty, and there are nochcon/bootcAVC denials.test_booted_image_unit,test_desktop_contractandtest_check_skill_frontmatterpass. The full local suite fails exactly the same tests asmain, all of which need tools this machine doesn't have.build.ymlwithreview_vmon this branch, and will post the result here.Supersedes #1203 (@kylerankin), keeping its approach.
Refs #1198 (the denials come from common's CountMe; fix: projectbluefin/common#1689)
🤖 Generated with Claude Code
https://claude.ai/code/session_01WcWm7qQa538Zjcuvv8jBtn