Repository navigation
Conversation
Ship a persistent FSDK nspawn Homebrew machine with private nonroot owner provisioning, complete command dispatch and optional rootless host OCI engines. Preserve native installation, signed release updates and optional canonical Homelab/KubeStellar integration. Verify the installed console/SSH/reboot path, real host engine workloads, all nine machine regressions and nine descriptor/job-control/privacy edge cases. Record seeding, loader and orderly lifecycle invariants in the routed skills. Assisted-by: github-copilot/gpt-6.1-sol via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
474afc4
ℹ️ Sentinel notice — informational; author is trusted (owner), merge is not blockedHive flagged this PR (author @castrojo, head
Hive did not add the |
There was a problem hiding this comment.
Routing to a human: this needs a maintainer with sudo/namespace security background, and it is blocked on fsdk-containers#436.
I read the privileged path (files/homebrew/dispatch.c, files/homebrew/bluefin-homebrew.sudoers, files/os/ssh/sshd_config.d/bluefin-server.conf) rather than the whole 95-file / +4000-line diff. I did not find a defect in what I read, but the trust decision here is not one this lane should make.
What the change actually grants (verified, not from the body)
files/homebrew/bluefin-homebrew.sudoers:4—ALL ALL=(root) NOPASSWD: /usr/libexec/bluefin-homebrew-enter. Every local account on the server image gets passwordless root execution of this helper. The helper, not sudoers, is the only thing standing between any user and root.:10—Defaults!… !log_alloweddisables sudo's allowed-command logging for that rule. The comment justifies it (argv may contain tokens), and argv is in fact moved out of the sudo command line into a sealed memfd (dispatch.claunch()), but it still means successful root invocations by any user leave no sudo log. That is a deliberate audit trade-off a maintainer should sign off on explicitly.dispatch.chelper(): requires real uid 0,SUDO_UID/GIDmust match a passwd entry (number()rejects 0 and ≥65534), cwd must be absolute, physical and under a root listed in root-owned/run/bluefin-homebrew/rootsfor that uid (authorize_cwd), the request memfd must be owned by the caller and carryWRITE|GROW|SHRINK|SEALseals (read_environment), andbrewitself is restricted to the uid in/var/lib/bluefin-homebrew/owner.pin_machine()verifies the machine leader's cgroup is…/bluefin-homebrew.service/payload/…on a unified hierarchy before opening its/proc/<pid>/{root,ns/*}, then polls the pidfd to confirm the leader did not exit mid-pin.enter(): root work is limited to cgroup placement,setns()over the pre-pinned fds (user ns last),chroot, optionalmount_setattr(RDONLY)of the prefix for non-owners, thendrop_privileges()(bounding set,setresgid/uid,capsetto zero,NO_NEW_PRIVS, ambient clear) beforeclearenv()/ caller env is installed /execv("/usr/bin/systemd-run --user --scope … bash -p …").LD_PRELOAD/LD_LIBRARY_PATH/LD_AUDITare stripped. The ordering is right: nothing caller-controlled is interpreted while privileged.sshd_config.d/bluefin-server.conf—SetEnv PATH=/usr/bin:/bin:/usr/sbin:/sbin:/var/lib/bluefin-homebrew/commandsputs the root-owned shim dir last in PATH for non-login SSH commands;Subsystem sftp internal-sftp.
Open questions for the human reviewer (not findings — I could not verify these without the image)
authorize_cwd()runsrealpath()against the host view ofcwd, thenenter()doeschdir(cwd)afterchrootinto the guest root. The design assumes the authorized roots are bind-mounted at identical paths inside the machine ("same-path project mounts" per the body). If any authorized root is reachable on the host but mounted differently in the guest, the check and the use diverge. Worth a maintainer confirming the roots file is only ever populated with same-path mounts.drop_privileges()callssetgroups()with the host supplementary group list aftersetns()into the machine's user namespace. If the nspawn machine uses--private-users, those gids may not map. The tests intests/unit/test_homebrew_dispatch*.pymay already cover this; I did not read them.
Scope
The PR also bundles podman/docker sysexts, sysupdate transfers, installer services, release-publishing changes and a 2-arch check-image.py rewrite. The body (correctly) says it depends on fsdk-containers#436, which is itself currently awaiting a human in the hive queue. The eight full-image/boot checks on this PR are all SKIPPED, so nothing here has been built in CI on this head.
Recommendation: do not merge until fsdk-containers#436 lands and a maintainer has explicitly accepted (a) all-users NOPASSWD root into the helper and (b) !log_allowed. I have not approved or changed anything.
Confidence: 1/5 (needs attention) — 1 high finding; 2 medium findings
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
jeefy
left a comment
There was a problem hiding this comment.
Thanks — the C is more careful than most setuid-style helpers (O_NOFOLLOW on trusted files, capset→0 + NO_NEW_PRIVS, clearenv + LD_* scrub, --expand-environment=no, read-only prefix for non-owners, strict argv shape). The requested changes are about packaging and trust boundaries, not code quality.
Requested changes
-
Pin
fsdk-containersto a commit on itsmain.elements/fsdk-containers.bstpinsd75f216e…from the still-open fsdk-containers#436 withtrack: main. If #436 is squashed that SHA becomes unreachable and the build breaks; the junction tracker would also "bump" it to main and silently drop the brew image. Land #436 first, then re-pin here. -
Move the sudo bridge out of base
/usr.elements/bluefin-server/os-stack.bstaddshomebrew/dispatch.bst, soALL ALL=(root) NOPASSWD: /usr/libexec/bluefin-homebrew-enterships in every install, including "Advanced minimal". Shipdispatch.bst(helper, sudoers drop-in, units) in the homebrew sysext / image-integration so the rule exists only where the machine does. -
Keep sudo logging on.
Defaults!… !log_allowedremoves the audit trail for successful root invocations by any local user. Brew argv carrying tokens is a real concern, but drop the arguments, not the event — e.g.Defaults!/usr/libexec/bluefin-homebrew-enter !log_args(or redact in the helper and log the sanitized command). -
Make the host→guest cwd mapping explicit.
authorize_cwd()(dispatch.c:105-128) resolves and authorizescwdagainst/run/bluefin-homebrew/rootsin the host namespace, thenenter()doeschdir(cwd)at:479inside the guest root afterchroot. That is only sound if every authorized root is bind-mounted at the identical path in the machine. That guarantee lives in the fsdk-containers image, not here. Either verify it in the helper (e.g. comparest_dev/st_inoof the host-resolved cwd with the guest path after entering, before dropping privileges) or document the invariant indispatch.cand in the fsdk-containers image recipe, with a test. -
Split the PR. Suggested order, each independently mergeable:
- runtimes: Podman/Docker sysexts + sysupdate transfers +
disablepresets (fits existing sysext policy as-is); - homebrew: machine image transfer + bridge (after 1–4), with the
full-buildlabel so CI actually boots it — all image/boot jobs were skipped on this PR and the body notes the coexistence replay never completed; - installer default: the one-line menu change, last.
- runtimes: Podman/Docker sysexts + sysupdate transfers +
-
Rebase — currently
DIRTYagainst main (sed/gzip build-depends landed inbluefin-server-image.bst).
Maintainer decisions (not blockers for the above)
- Should Home Server be the default installer entry? It makes rootless Podman default-on for the default install, which bends "container runtimes are opt-in, no preset enables them".
- Are Docker's upstream static binaries acceptable in a sysext under the k0s/kubeadm precedent?
Happy to re-review the split PRs quickly.
|
@jeefy the requested split is published: #484 (independent runtimes), #485 (opt-in Brew integration), #486 (opt-in native installer). This umbrella is closed as superseded, not merged. The active-primary-GID/NSS-group defect, host/guest cwd identity/access defect and suppressed-sudo-audit defect are fixed. All three original failures reproduced against the old installed helper/policy; 29 actual installed-machine behavior cases passed without skips against the corrected helper. Complete QEMU/Fedora-OVMF Secure Boot console installation and both installed boots passed, including real SSH Brew updates, persistent packages, detached tmux and host Podman/Compose workloads. The clean final stack rebuilt; all 30 non-SBOM payloads match the boot-tested artifacts and final verification accepted all 31 signed assets using development keys. Minimal is still default. The privileged bridge/Python closure is absent from the base OS and lives in the selected integration sysext. Standard current-head checks passed; #485/#486 have Independent producer approval/merge for fsdk-containers#436 remains required before replacing #485's explicitly identified review pin with the actual main SHA/track. #485/#486 remain draft; no approval or merge bypassed. Docker's upstream-static policy decision is isolated in #484, and sudo/namespace review remains explicit in #485. |
Superseded by focused replacements
Closed in favor of @jeefy's requested split; this original umbrella must not be merged. Replacement order:
Review fixes
full-build; their real build lanes are running, not silently skipped. Remote full-build/boot success is not yet claimed.Completed local evidence
Actual x86_64 signed image build/export, standalone/overlaid ELF-program closure and final publication verification passed: 31 signed assets using local development keys. Clean final stacked head
6dbf211has all 30 non-SBOM payloads byte-identical to the boot-tested release; only the SBOM digest changed.Complete QEMU/Fedora-OVMF Secure Boot console install and both installed boots passed: dm-verity disk root, decoy disk untouched, locked root, nonroot owner login, SSH Brew install/update and persistence, detached tmux, rootless host Podman workloads via Brew clients, Compose and same-path mounts. Original helper/policy reproduced three expected failures; the corrected installed helper passed 29 real-machine behavior cases without skips. Optional Docker-daemon boot is not claimed by this run.
External prerequisite — still blocked
fsdk-containers#436 must receive independent approval and merge first. #485 explicitly uses tested review SHA
ae5bf888b72693bb6774cd56d21da4677efc2e36and its matching branch track. Re-pin to the actual merged main SHA/track and rerun native gates before shipping. No main merge commit was invented and no approval or merge bypassed. Docker's upstream-static policy remains a maintainer decision in #484; independent sudo/namespace review remains required for #485.Replacement PRs contain current verification/CI status. Earlier claims in this umbrella's edit history are historical, not evidence for the new heads.