Repository navigation
fix: sign the manifest digest, not the first sha256 token; add --tlog-upload - #36
Merged
Merged
Conversation
…-upload
build.sh --sign picked the digest to sign with
`grep -oE 'sha256:[0-9a-f]{64}' | head -n1` over combined `oras push`
output. That is the first sha256 token ANYWHERE in the output, which is
not necessarily the pushed manifest digest — a layer digest printed in
full would be signed instead, producing a signature over the wrong
object. Current oras abbreviates layer digests to 12 chars, so the bug is
latent rather than active, but that is output formatting, not a contract.
- Parse the authoritative "Digest: sha256:<64hex>" summary line instead,
via a parse_manifest_digest() helper.
- Add test-build-sh.sh (no registry, no cosign needed) covering the
regression with a synthetic full-layer-digest fixture — real oras
output cannot reproduce the bug today — plus malformed-input and flag
guards. Verified to FAIL against the old parser (it returns the layer
digest) and pass against the new one. Wired into validate.yml, since
the --sign path otherwise only ever runs in the release workflows.
- Add --tlog-upload: opt in to recording signatures in the public Rekor
transparency log for official bundles. Default stays offline
(--tlog-upload=false) so local/air-gapped authoring and the plain-HTTP
e2e keep working without Sigstore connectivity.
- Pin signing to cosign's classic format (--new-bundle-format=false
--use-signing-config=false): the format the operator's cosign/v2
verifier reads, and the newer Rekor v2 flow needs a TSA that keyed
signing cannot satisfy.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: valgulnecron <39313199+ValgulNecron@users.noreply.github.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.
The bug
build.sh --signchose the digest to sign with:digest="$(printf '%s\n' "$out" | grep -oE 'sha256:[0-9a-f]{64}' | head -n1)"That is the first sha256 token anywhere in combined
oras pushoutput — not necessarily the pushed manifest digest. If a layer digest is printed in full, the bundle signature covers the wrong object.Current oras abbreviates layer digests to 12 chars, so today only one full token appears and the bug is latent — but that's output formatting, not a contract. A verbose flag or a version change flips it to active, silently, in the release pipeline.
The fix
Parse the authoritative
Digest: sha256:<64hex>summary line (via aparse_manifest_digest()helper) and fail loudly if it's absent.Tests —
test-build-sh.sh(new)--signonly ever executes in the release/republish workflows, so this code path had no test coverage at all. Added a suite that needs no registry and no cosign:--tlog-uploadwithout--signexits 2.Verified the suite fails against the old parser (returns the layer digest
sha256:4b2b418b…instead of the manifest digest) and passes against the new one — so it's a real regression test, not a vacuous one. Wired intovalidate.yml.--tlog-upload(new flag)Opt in to recording signatures in the public Rekor transparency log for official bundles. The default stays offline (
--tlog-upload=false), so local/air-gapped authoring and the plain-HTTP e2e keep working without Sigstore connectivity.Signing is also pinned to cosign's classic format (
--new-bundle-format=false --use-signing-config=false) — the format the operator's cosign/v2 verifier reads, and because cosign's newer Rekor v2 flow requires a TSA that keyed signing can't satisfy.Part of the Gameplane signing-transparency rollout (Gameplane#184 merged, #185 open).
🤖 Generated with Claude Code