perf(cve-gate): run the gate as a step, not a container #90
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "perf/cve-gate-as-a-step"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Cuts 262 lines to 107, of which the executable part is about 35. Merge after the ci-runner PR — see the order at the bottom.
The diagnosis
Five consecutive releases failed in this action, for five different reasons. Not one was about finding CVEs:
docker cpinto a--read-onlyrootfs — refused by the daemongate-imagepin naming a tag that was never builtclonerule that denied exactly what its comment said it allowedroot:root, unwritable by uid 65532They're the same failure wearing five different outfits: getting data into and out of a maximally hardened container reached through a remote dind daemon, where there's no shared filesystem,
docker cpis refused, bind mounts resolve on the wrong host, and/tmpevaporates on exit.That hardening was never required to run a scan. It was there because
cve-gatedoubles as the ADR-0006 worked example of a hardened image — and that second goal ended up on the critical path of every release.What this deletes
ci-runnernow bakesgrypeandcve-gate(both static Go, copied from that same image, digest-pinned), so the scan is a binary on PATH reading a workspace already on disk. Gone:docker pullper release--read-only/--tmpfs/--cap-drop/--security-optplumbingchownthemALLOW_MISSING_GATEbootstrap hatchawkthat parsed the verdict back out of the logTwo things start working
Both were silently lost inside the container:
GITHUB_STEP_SUMMARYis in the environment, so the binary writes its own budget table. Inside the container that variable didn't exist.OUT_DIRis a writable workspace, socve-budget.jsonis written directly instead of being printed between markers and parsed back out.What is deliberately kept
ops/security/seccomp/cve-gate.jsonandverify-profile.pystay. They're no longer applied by CI — and both the profile's first line and the techdocs page now say so. An unrun security control that looks applied is worse than none.They remain the reference hardened invocation for running the
cve-gateimage standalone, which is what keeps it the ADR-0006 example. The image doesn't go away; it just leaves the hot path.Verified
0met budget,1blew it,2no verdict. 2 is never a pass. All three paths confirmed to propagate.cosign-sign-attest) passes justimage-refandimage-name— both retained, so no breakage.verify-profile.pystill passes 31/31 against the kept profile.⚠️ Merge order
This requires the runner pool to be on a ci-runner that bakes the binaries:
forgejo-runnerScaledJobLanding this first would break every signing job. The PATH check fails with exactly that diagnosis — naming the ScaledJob digest as the fix — rather than
cve-gate: command not found.ryangr0 referenced this pull request2026-08-08 05:05:58 +00:00