fix(triage): fetch tag-based attestation via oras; support cosign 3.x output#113
Merged
Merged
Conversation
tobias-pfaffelmoser-aa
force-pushed
the
fix/triage-att-tag-without-cosign
branch
from
June 15, 2026 08:03
d38ba80 to
8554a13
Compare
… output
retrieve-triage reported every JFrog image as having no triage when run with
cosign 3.x. Two issues, both in the tag-based path:
1. cosign 3.x changed `download attestation` output from a bare DSSE envelope
({"payload": <b64>}) to a sigstore bundle ({"dsseEnvelope": {"payload": <b64>}}).
The parser only read the top-level `payload`, so it found no triage predicate
even though cosign returned the attestation. cosign 2.x still emits the old
shape — the result silently depended on the installed cosign version.
2. Relying on `cosign download attestation` at all couples the result to the
local cosign version.
Fix: fetch the `sha256-<digest>.att` manifest directly with oras and decode its
DSSE layers newest-first, stopping at the first triage match (one blob fetch for
the common re-attested case). This is cosign-version-independent; oras/crane are
already prerequisites and use plain registry reads JFrog supports (the .att tag,
not the Referrers API). Keep `cosign download attestation` as a fallback, now
parsing both the bare-envelope and bundle shapes.
Verified with cosign v3.0.5 (the reported version), v2.4.2, and a stubbed cosign
returning nothing: 41/41 fetched via the oras .att path in all cases. The
newest-first scan cuts oras blob fetches 390 -> 41 over the 41-image list (~10m
-> ~3m) and produces byte-identical triage files and report vs scanning all
layers.
tobias-pfaffelmoser-aa
force-pushed
the
fix/triage-att-tag-without-cosign
branch
from
June 15, 2026 08:26
8554a13 to
543dad1
Compare
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.
Problem
Run with cosign 3.x,
retrieve-triagereports every JFrog image as having no triage — even ones that clearly have it:Confirmed root cause (reproduced with cosign v3.0.5 vs v2.4.2): cosign 3.x changed the
download attestationoutput format. It still returns all attestations (verified: 9 incl. the triage predicate), but as a sigstore bundle — the DSSE payload moved from top-levelpayloadtodsseEnvelope.payload:download attestationline shape{"payload": <b64>, "signatures": […]}.payload){"mediaType": ".../bundle.v0.3+json", "dsseEnvelope": {"payload": <b64>}}.payload)So the result silently depended on the installed cosign version. (It is not the Referrers API — JFrog lacks Referrers discovery, but the
.attis a plain tag that pulls fine.)Change
sha256-<digest>.attmanifest directly with oras and decode its DSSE layers newest-first, stopping at the first triage match (one blob fetch for the common re-attested case). cosign-version-independent; plain registry reads JFrog supports.cosign download attestation, now parsing both the bare-DSSE-envelope (.payload) and sigstore-bundle (.dsseEnvelope.payload) shapes.Verification
.att, 0 via cosign, 0 skips; report = 25 sections / 158 CVE rows, headers remapped to JFrog refs..att.diff -rqconfirms the triage files and report are byte-identical to scanning all layers.Works regardless of the installed cosign version.