Repository navigation
Attach signed CycloneDX SBOMs to published Rust example components - #916
Open
Matthew Charles Vladislav Busel (Mattbusel) wants to merge 1 commit into
Open
Matthew Charles Vladislav Busel (Mattbusel) wants to merge 1 commit into
Matthew Charles Vladislav Busel (Mattbusel) wants to merge 1 commit into
Conversation
The examples workflow signs every component it pushes to ghcr.io but attaches no SBOM, so the published images carry no record of the crates inside them. This is the gap described in microsoft#212: the Syft SBOM only covered the OCI wrapper, and the suggested fix was a cosign attestation with an SBOM. microsoft#154 added the signing; the attestation never landed. The build job now generates a CycloneDX 1.6 SBOM for each published Rust example (arxiv-rs, brave-search-rs, fetch-rs, filesystem-rs) with sbom-attest, resolving dependencies for wasm32-wasip2 from each example's Cargo.toml and lock file. The publish job attests it with the keyless cosign setup it already uses, next to each existing `cosign sign`, for both the SHA tag and the latest tag. JS, Python and Go examples are unchanged. After this, `cosign verify-attestation --type cyclonedx` works on the published Rust components.
This branch has not been deployed
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.
Published Rust example components are signed but carry no SBOM:
ghcr.io/microsoft/fetch-rshas 61.sigtags and no.atttags. That is the gap described in #212, where the suggested fix was a cosign attestation with an SBOM; #154 added the signing but not the attestation. This PR generates a CycloneDX 1.6 SBOM for arxiv-rs, brave-search-rs, fetch-rs and filesystem-rs in the build job and attaches it withcosign attestnext to each existingcosign sign, using the same keyless setup, socosign verify-attestation --type cyclonedxworks on them. JS, Python and Go examples are unchanged.How I tested it: ran the new step on the four examples (69, 70, 117 and 3 crates, matching
cargo tree --target wasm32-wasip2), pushed fetch-rs and filesystem-rs with wkg 0.15.1 to a local registry, then attested and verified them with cosign 2.4.1 (with a local key, since keyless needs the Actions OIDC token). actionlint passes on the workflow.sbom-attest is my crate (MIT OR Apache-2.0). I maintain it and will keep it current.