ci: harden chronicle-image-pin-gate (64-hex digest + self-test)#318
Merged
Conversation
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.
What
Hardens
chronicle-image-pin-gateto flag every unpinned/malformed chronicle image form, and adds an embedded self-test so the detector cannot silently regress.Why
The first version had narrow false-passes: a chronicle ref ending in
@sha256:<short-or-invalid-hex>(e.g.@sha256:abc) passed, and the malformed@sha256-hyphen form (the cosign sig-tag shape behind the 06-22 archiver incident) was only caught by accidental truncation. "Pinned" must mean a real multi-arch index digest, not any@sha256:substring.How
@sha256:+ EXACTLY 64 lowercase-hex chars. It now flags bare semver, git-sha tags (sha-xxxxxx),:latest, no-tag, the@sha256-hyphen form, and short/over-long/invalid digests; it passes only genuine 64-hex digests.Validated locally: 10/10 self-test cases pass; the gate flags an unpinned render and passes pinned ones.