Repository navigation
feat(node-installer): qualify daemon units on a disposable Linux systemd fixture (OSS-379) - #539
Merged
Merged
Conversation
…ture (OSS-379) - Add fail-closed ValidateDaemonPaths to render-daemon: shared daemon paths, traversal, overlapping/escaping roots, symlink escapes, world-writable ancestors and daemon collisions are refused before any rendering. - Spec now requires distinct RuntimeRoot/StateRoot containment boundaries and supports fixture-only binary overrides so no real dockerd is started. - Add disposable Linux systemd qualification fixture: real START/RESTART of the rendered rootless and rootful units, XDG_RUNTIME_DIR reset, canonical root checks and six temporary-path refusal cases, all in owned /tmp and /run dirs with a no-op daemon and no /etc, network or host config change. - Extend Go and Python offline fixtures for the defensive refusal cases. Evidence: owned WSL Ubuntu with PID1=systemd, rootless/rootful active with ExecMainStatus=0 and fresh reboot records, XDG state survival, canonical roots, 6/6 refusals; pinned Go 1.26.11 build/vet/test, golangci-lint new-issues 0, 6/6 Python fixtures, knowledge-lint clean. No live host, release or merge.
The defensive path fixture hardcoded UID 1000, so its clean rootless spec was refused on runners whose actual user/runtime dir differs. Fixture-only fix: derive the rootless runtime root from the caller's real UID and a temporary subdirectory under /run/user/<uid>, with a rootful temp-path fallback when no non-root user runtime dir exists (e.g. root runners). Also create the data root before the world-writable-parent case so the existing guard is actually tested. Production ValidateDaemonPaths containment, canonical-root and refusal rules are unchanged. Verified on real Linux at UID 0 (fallback) and UID 12345 with /run/user/12345 (rootless derivation): all defensive subtests PASS. Pinned Go 1.26.11 go test ./... -count=1 and go vet exit 0, golangci-lint new-issues 0, Python 6/6, knowledge-lint clean, gofmt clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to merged PR #529. Real systemd fixture evidence (owned WSL Ubuntu 24.04, PID 1 systemd): rootless per-user unit and rootful unit both START/RESTART active with Result=success and fresh boot records; config survives XDG_RUNTIME_DIR reset; private socket/state roots distinct, owned, canonical and contained; 6/6 defensive refusals (shared socket/data/containerd root, traversal, world-writable parent, symlink escape) using temporary paths only. One-source DaemonOptions renderer + SetDaemonRenderer seam intact; ValidateDaemonPaths rejects unsafe paths before rendering.
Honest limits: no-op fixture daemon replaces dockerd (Type=notify→simple, ReadWritePaths added); rootless ran in existing user manager with a non-root path UID; service RESTART only, not OS reboot; no shipped-unit boot or live-host claim. Pinned Go 1.26.11 build/vet/test, golangci-lint new-issues 0, Python 6/6, knowledge-lint 38/38. No merge, release, deployment or registry write.