fix: extract the DSSE envelope for in-toto provenance - #55
Merged
Conversation
Signed-off-by: JacobOptimiza <jacoboptimiza@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.
Problem
The previous implementation compacted the entire Sigstore bundle produced by
actions/attestand saved it with a.intoto.jsonlextension. The in-toto JSON Lines standard requires each line to be the DSSE envelope itself (payloadType/payload/signatures); a Sigstore bundle (mediaType/dsseEnvelope/verificationMaterial) at the root is a renamed bundle, not the standard form. SIGNING.md also overstated whatgh attestation verifychecks against that file.Fix
scripts/convert-attestation-to-intoto.ps1: extractsbundle.dsseEnvelope, writes it as one compact JSON line, and validates end-to-end before publishing - exactly one JSON object per line; DSSE envelope shape at root; explicitly rejects renamed Sigstore bundles (nodsseEnvelope/verificationMaterial/mediaTypeat root); decodespayloadinto an in-toto Statement (_typein-toto v1); requires a SLSA provenancepredicateType(v1 or v0.2); verifies every expected architecture artifact appears as a subject with a valid sha256 digest; requires non-empty signatures.release.ymlnow calls the script instead of the inline transformation, passing the three per-architecture artifact names. The originalDevNav-build-provenance-<arch>.sigstore.jsonbundle with all verification material is kept unchanged..intoto.jsonl= standard envelope representation) and what each verification mechanism actually verifies (gh attestation verifyresolves attestations from the GitHub API by digest, not from the downloaded file).Validation
Built a fixture faithful to the pinned actions/attest v4.2.2 output (bundle shape confirmed from the action's own source at the pinned commit): positive case produces a 1-line JSONL whose root is the envelope, payload decodes to a SLSA v1 Statement with the three expected subjects; negative cases (renamed bundle, non-SLSA predicate, missing subject, no dsseEnvelope) all fail. Permanent Pester suite
IntotoProvenance.Tests.ps1(4 tests) added; full Pester 125/0 with coverage gates PASS; PSScriptAnalyzer and workflow YAML validated;git diff --checkclean.