feat(node-image): seal post-start exec at the runc boundary #609
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #609"
general
weight: 0.35
joaosa
Why
The kubelet runs
execliveness/readiness/startup probes andpostStart/preStophooks through CRIExecSync, andkubectl exec/cpreach the same runtime call.enable-debugging-handlers=falsecloses only the kubelet's HTTP API: none of the other paths passes through it, and none fires an NRI hook. On a measured node image, anyone who can put argv in a probe field of an admitted pod gets code execution inside a running container and reads the output back from pod events.Separately, nothing proved that no container was running when the image-policy plugin registered. The plugin is pre-registered in the image's containerd config and
required_pluginsblocks creation while it is absent, but the ordering that makes that true is asserted by systemd, not by the enforcer.Description
c8s-runc, a measured runtime wrapper (internal/cmds/c8srunc,cmd/c8s-runc). containerd's runc shim runs the binary named by the runtime handler'sBinaryNamefor every verb, so a wrapper there sees every request that starts a process in a running container. A locked build denies theexecverb andexecves the real runc for every other verb with the original argv, environment and file descriptors. The posture is a build-time constant — no mode file, no allowlist, nothing on a running node changes it. Global options are parsed only to find the subcommand, modelled on the runc the pinned RKE2 ships; an option the wrapper does not recognise is a denial, because a token modelled wrongly shifts which argument the subcommand is. The denial is also written to runc's--login--log-format, so containerd surfaces it in the pod event instead of an empty runtime error. The node image installs it as an argv alias of thec8sbinary, dispatched by basename before cobra sees runc's argv.Image wiring.
mkosi.syncinstalls the wrapper at/usr/local/bin/c8s-runc; the baked drop-inconfig-v3.toml.d/10-c8s-runc.tomlpoints the runc handler'sBinaryNameat it. A drop-in rather than a template line: RKE2's base template already defines that table and containerd's TOML parser rejects a duplicate; containerd merges each import over the main config key by key.C8S_DEV=1renders a later drop-in restoring the unwrapped runtime, from the same variant switch that re-enables the kubelet debugging handlers — the two images already have different measurements.Build gate.
node-guest-image/c8s/containerdcheckrenders the profile's template the way RKE2 does (its base template vendored and pinned to the RKE2 release), merges the drop-ins containerd imports, and asserts every enabled ordinary-pod handler runs the wrapper — failing on an emptyBinaryName, an alternate runc, a later drop-in that unwraps the handler, an unaudited shim, or adefault_runtime_namethat is not wrapped. The invariants gate adds what a rendered config cannot show: the wrapper path the build installs, the real-runtime path the wrapper is compiled with, the absence of any runtime binary RKE2's auto-detection would add a handler for (crun, the nvidia runtimes, the wasm shims), and the base-template pin againstRKE2_VERSION.go-tomlmoves from an indirect to a direct dependency; it is what containerd parses the same file with.The vendored base template follows the k3s revision behind RKE2 v1.36.4. Since k3s b51167a9 that base emits the
config-v3.toml.d/*.tomlimport itself, so the bakedconfig-v3.toml.tmplno longer prepends its ownimportsline: the gate rendered the old template as a duplicate TOML key.Chart. c8s-owned exec probes and the one lifecycle exec hook are replaced, since neither can pass on such a node:
attest-proxy --health-addrservesGET /healthzby making the same round-trip over its own socket the healthcheck subcommand makes; readiness and liveness use it.ratls-mesh iptables-sync --ready-addrservesGET /readyzon node loopback; the startup probe that gates the mesh proxy reads it.iptables-cleanup --keep-guard --on-shutdown, which idles until SIGTERM and then cleans up, in place of thepreStophook. Native sidecars stop in reverse init order, so the ordering is unchanged;ratlsMesh.iptablesCleanup.preStopSleepSecondsnow renders--settle-delay.acme --ready-portservesGET /readyz, reporting the same condition nginx'sprobe-fileexec probe reported.New values:
attestationApi.proxy.healthPort(8401),ratlsMesh.ports.iptablesReady(15022), and the chart-internalrouter.acmeReadyPorthelper (8403). A chart test walks every rendered manifest for exec probes and lifecycle exec hooks.Image-policy plugin. New
policy.fatal_existing(withpolicy.boot_marker_path, validated to require fail-closed mode,enforce_existing, and an absolute tmpfs path): a container present at the plugin's first registration after boot has already run, so stopping it proves nothing — the plugin logs every container it was handed and powers the node off. A plugin restart is a different event, since containerd stays up and its containers legitimately predate the new process, so a boot-scoped marker separates the two: a restart re-checks what is running through the existing startup check and escalates only there. Not while the first pull after that restart is outstanding — the plugin is Ready on the boot floor alone then, and every workload the allowlist service admitted would look unknown; that case keeps the existing stop. If the power-off syscall is refused the plugin exits, which leavesrequired_pluginsblocking every new container. The setting is off by default, so the chart's containerised plugin is unchanged; the node image's baked config turns it on.Focus areas for review
parseGlobalsininternal/cmds/c8srunc/c8srunc.go: the flag model is taken from the runc version the pinned RKE2 ships, and the deny-on-unknown-option rule is what keeps a future runc flag from turning into a pass-through.binsymlink. RKE2 keeps that directory on containerd'sPATH, soruncstill resolves by name for a process already running as root on the node; no enabled handler uses it.docs/node-exec-mode.md"Known limits" states this.mkosi.extra; extra-tree precedence for a shared directory is worth confirming on the first dev build./healthzand/readyzare reachable from other pods (the mesh one only from node loopback). They report liveness or file existence and carry no evidence.Not covered here
runc checkpointandrestoreare not aliases ofexecand pass through; they deserve their own audit.Related: https://github.com/confidential-dot-ai/c8s/pull/584, https://github.com/confidential-dot-ai/c8s/pull/585