Skip to content

ci(publish): cosign-verify every child manifest, not just the index (#925) - #982

Merged
bpalermo merged 3 commits into
mainfrom
fix/publish-verify-per-arch
Sep 27, 2026
Merged

bpalermo merged 3 commits into
mainfrom
fix/publish-verify-per-arch

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Closes #925

The gap

publish.yaml signs with cosign sign --recursive (the index and each per-arch child), but records one index digest per repo in signed-images.txt, and cosign verify has no --recursive (v2.4.1 and v3.0.6 both lack it). So the verify step checked 8 index signatures and never looked at the 16 per-arch manifests, which are what a node actually pulls.

Fix

  • Enumeration: ghcr_index_children in scripts/ghcr-lib.sh does a GET on /v2/<repo>/manifests/<index digest> (OCI index / Docker manifest-list Accept) and parses .manifests[].digest with python3, the same way the rest of the lib parses JSON. The runner does not need crane or oras. Every entry is returned; buildx unknown/unknown attestations would be checked too rather than filtered out. A non-index, an empty list or a malformed digest is a failure, not an empty success.
  • scripts/verify-image-signatures.sh runs cosign verify on each index ref and on every child, using the same identity regexp and issuer as before. It checks everything before it fails, so a single run names every bad manifest. Exit codes: 1 = something did not verify, 2 = could not check (including a walk that found no children).
  • publish.yaml: the verify step now runs that script over signed-images.txt.
  • publish-verify gets two changes:
    • The registry sweep (verify-published-artifacts.sh) now requires a signature tag, in exactly one layout, for every child as well as the index. That is 36 coordinates per commit, up from 20.
    • A new cosign pass (the same SHA-pinned installer, v4.1.2 -> cosign v3.0.6) verifies every resolved index and child. Unverified manifests are added to the rolling issue.
  • scripts/check-index-children.sh plus a CI step: 7 hermetic cases for the walk. I mutation-tested it: letting an empty manifests list through turns the check red (FAIL index with zero children: accepted, printed [], exit 1).
  • Runbook: a new cosign v3 section covering bundle vs legacy layout, the missing --recursive, how to verify children by hand, and which images this pipeline does not sign.

Local verification (read-only, cosign v3.0.6 checksum-verified from the release)

Current main (1ad4b6a), all 8 images: PASS: 24 manifest(s) verified (8 index(es) + their children), exit 0. Every index has 2 children (linux/amd64, linux/arm64/v8), all cosign-3 bundle layout. Sweep: PASS: 36 artifact(s) present.

Seen-red

  1. Index signed, children unsigned (exactly the publish: per-architecture manifests are signed but never verified (cosign verify has no --recursive) #925 world): I ran the script against the real signed agent index sha256:a1e4327e… with a stand-in COSIGN that passes the index through to real cosign and reports "no signatures found" for any other digest. Result: verified index …, FAILED child …5d23c6b2…, FAILED child …f0495af5…, exit 1. The old verify step would have passed this.
  2. Real unsigned children in ghcr: I used the agent image from 6ac9a6c, the last commit before signing existed (ci(publish): sign every published image with cosign, keyless #875): index 7c606eb2…, children 058ebb13… and 5473fad3…. Also the pinned aether-proxy 938c5a57…, children bb53bed6… and 4a90a7fb…. Real cosign reports each child FAILED … no signatures found, exit 1.
  3. Wrong identity: with the identity regexp set to proxy-release.yml, the index and both children fail with no matching attestations, exit 1.
  4. Non-index ref: passing a child digest where an index is expected exits 2 (could not enumerate the child manifests).
  5. Sweep: verify-published-artifacts.sh 6ac9a6c gives MISSING … signature for child … for every child, FAIL: 24 of 36, exit 1.

Found along the way (not fixed here)

ghcr.io/bpalermo/aether/aether-proxy is not signed at all: 0 signature tags in the repo, and neither the pinned index nor its children verify. proxy-release.yml has no signing step, and the repo is not in GHCR_IMAGE_REPOS. This deserves its own issue.

Not run

  • publish.yaml and publish-verify.yaml themselves have not run: no dispatch, no push to main, no signing.
  • actionlint is not installed; I only checked that the YAML parses.
  • No cluster and no kind.

Lint: bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //scripts/... is green, scripts/check-shell-lint.sh covers 28/28 scripts, and scripts/check-signature-layout.sh passes 5/5.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

…925)

publish.yaml signs with `cosign sign --recursive` (index + each per-arch
manifest), but `cosign verify` has no --recursive, so the verify step checked
the eight index digests and left the sixteen per-arch manifests -- what a node
actually pulls -- signed and never checked.

- scripts/ghcr-lib.sh: ghcr_index_children walks an index's .manifests[] from
  the registry (curl + python3, like the rest of the lib). Every entry is
  returned (buildx attestation manifests are held to the same bar); a
  non-index, an empty list or a malformed digest is a failure, never an empty
  success.
- scripts/verify-image-signatures.sh: cosign-verifies each index ref AND every
  child with the publish.yaml identity/issuer; checks everything before
  failing so one run names every unsigned manifest; exit 2 on a walk that
  yields nothing.
- publish.yaml: the verify step now runs that script over signed-images.txt.
- publish-verify: the registry sweep checks a signature tag (exactly one
  layout) for every child too, and a new cosign pass (same pinned installer,
  v4.1.2 -> cosign v3.0.6) verifies every resolved index + child. Unverified
  manifests feed the rolling issue.
- scripts/check-index-children.sh (+ ci step): hermetic cases for the walk,
  including the zero-children case that would make the gate vacuous.
- runbook: a cosign v3 section (bundle vs legacy layout, no --recursive,
  how to verify children by hand, what this pipeline does not sign).

Closes #925

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo merged commit 8422b46 into main Sep 27, 2026
24 checks passed
@bpalermo
bpalermo deleted the fix/publish-verify-per-arch branch September 27, 2026 11:50
bpalermo added a commit that referenced this pull request Sep 27, 2026
bpalermo added a commit that referenced this pull request Sep 27, 2026
…run (#930) (#983)

* fix(publish-verify): demonstrate the gate's red state in CI on every run (#930)

The artifact gate's only demonstrated red was a real defect (1e31e3a, #929)
that aged out of the sweep window with nothing fixed, leaving a gate whose
failure path was asserted rather than shown (#853).

- scripts/publish-verify-control.sh: the expected-red control. Builds a
  commit with `git commit-tree` on origin/main's tree (fixed identity and
  dates, so deterministic per base; never pushed, no ref), runs the verifier
  on it and asserts it goes red for the right reason: exit exactly 1, 20
  MISSING lines all naming that sha, no `ok` line, 12 non-empty tag scans,
  and the `FAIL: 20 of 20` summary. Verifier exit 2 is inconclusive (2).
  A constructed commit never ages out; a pinned one (ef44437, 1e31e3a) does.
- publish-verify.yaml: the control runs before the gate on every trigger, in
  its own step; the gate runs regardless of the control's outcome; a failed
  control files its own rolling issue, separate from "artifacts missing".
- scripts/check-publish-verify-control.sh (ci.yaml `shell` job, no network):
  drives the REAL verifier against a fake registry (#930 option 1) and shows
  the control rejects a verifier that stopped counting MISSING, empty tag
  listings, a MISSING line for another commit, a stray `ok`, and a perfect red
  with exit 0; accepts a correct red; reports exit 2 as inconclusive.
- docs/runbook.md: publish-verify paragraph.

Closes #930

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

* publish-verify: check out main explicitly in the workflow_run job (CodeQL actions/untrusted-checkout); runbook merged with #982's cosign section

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

publish: per-architecture manifests are signed but never verified (cosign verify has no --recursive)

1 participant