Skip to content

Attach signed CycloneDX SBOMs to published Rust example components - #916

Open
Matthew Charles Vladislav Busel (Mattbusel) wants to merge 1 commit into
microsoft:mainfrom
tensorust-ai:use-sbom-attest
Open

Matthew Charles Vladislav Busel (Mattbusel) wants to merge 1 commit into
microsoft:mainfrom
tensorust-ai:use-sbom-attest

Conversation

@Mattbusel

Copy link
Copy Markdown

Published Rust example components are signed but carry no SBOM: ghcr.io/microsoft/fetch-rs has 61 .sig tags and no .att tags. 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 with cosign attest next to each existing cosign sign, using the same keyless setup, so cosign verify-attestation --type cyclonedx works 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.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant