Repository navigation
fresh-install: a runner checked from inside, through a host shell, before the removal - #127
Merged
Merged
Conversation
…fore the removal The last check of a run opens an incident's root shell on the runner holding a workspace and runs hack/host-check.sh there: each machine's QEMU runs as a machine's uid, with no capability, a root of its own, no environment, a namespace with only lo and no way to the metadata service; the egress namespace cannot reach it either; the host's own root can, so none of that is a service that is down. The script goes over the terminal as base64 lines and says its results at once at the end, after the terminal's echo of what was typed is done. Closes #123 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #123
Host check, the last check of a run (after Posture, or after the upgrade's): it creates a workspace, picks the connected runner holding it, and opens
spin admin shell open <runner> --incident --minutes 10withhack/host-check.shon stdin. Opening without draining keeps the machine running. The shell retires the runner afterwards, and the run removes everything next.On the runner, as root:
qemu-system-*process: uid in the machine range (≥0x70000000),CapEff0, a root other than/, an empty environment, a network namespace with onlylo, and no TCP connection to 169.254.169.254:80 from it.NoNewPrivsandSeccompare printed asINFO, not asserted: nothing in spin promises their values.spin-egress) cannot connect to the metadata service, which is spin#1269's output chain. If the namespace is missing, the check fails rather than passing on a refused connection./run/credstoreis700 root. Thesystemd-analyze securityscore ofspin-runner.serviceandspin-boot.serviceis printed.Different from the issue: it asked for a host-namespace check that a machine-range uid can't get a token. spin#1261 ended up an egress-namespace rule instead, since a machine's QEMU is already in an empty namespace and a non-root runner is never placed on in production (
hostmgr.Unfit). So that check is the egress one here.Transport: a terminal's line discipline caps a line at 4096 bytes and echoes typed input as it arrives. So the script goes over as base64 in 1000-character lines appended to
/run/host-check.b64, then decoded and run. It holds its results until the end and prints them at once after a pause, so the echo can't split a line.HOST-CHECK-ENDlast means the session finished. Simulated locally through a real pty (script -c 'bash -i'): every line arrives whole, with the two failures a laptop should give (no IMDS, no QEMU).Not run against an account: the next scheduled fresh install is its first real run. The egress check holds even on a release without spin#1269, since the hop limit refuses the reply. It's the outcome being checked, not the rule.
task lintgreen: shellcheck on both scripts, actionlint, taskgate.🤖 Generated with Claude Code