Skip to content

feat(release): add CycloneDX SBOMs and npm provenance attestations#66

Open
kingchenc wants to merge 1 commit into
mainfrom
feat/release-trust
Open

feat(release): add CycloneDX SBOMs and npm provenance attestations#66
kingchenc wants to merge 1 commit into
mainfrom
feat/release-trust

Conversation

@kingchenc
Copy link
Copy Markdown
Owner

Summary

Two modern supply-chain-trust additions to the release pipeline. Neither changes what gets published — they only add verifiable signals attached to existing releases.

1. CycloneDX SBOMs per crate

`cargo-cyclonedx` runs in the `cargo-publish` job after the `.crate` files are built, generating one `*.cdx.json` per published crate (wickra-core, wickra-data, wickra). The files are uploaded as the `sboms` artifact and attached to the GitHub Release alongside the existing wheels / tarballs / `.node` binaries / `.crate` files.

Why: future security advisories can answer is crate X transitively in wickra Y.Z? by reading the SBOM directly, without re-resolving Cargo.lock or rebuilding the workspace. Future-proof for EU Cyber Resilience Act 2027 SBOM requirements.

2. npm `--provenance` on every npm publish call

Added to:

  • main `wickra` package (node-publish: first attempt + retry)
  • per-platform `wickra-` subpackages (node-publish loop)
  • `wickra-wasm` (wasm-publish)

Publishing jobs gain `permissions: id-token: write` so the runner can exchange the GitHub Actions OIDC token for the npm registry. The npm page for each published version will carry the Verified provenance badge, proving the tarball was built by this workflow run and not by an arbitrary local laptop with the NPM_TOKEN.

Skipped deliberately (potential follow-ups)

  • Sigstore cosign signing of artefacts — different audit story; layer on top of npm-provenance later.
  • SLSA build-provenance via `actions/attest-build-provenance` — would attach attestations to every artefact uniformly; npm-provenance is the more pragmatic first cut.

Merge order

This PR touches the same file (`release.yml`) as PR #59 (org-email migration). #59 modifies specific URL strings in lines ~390 of the workflow; this PR adds new steps in completely different sections. Rebase order: merge #59 first, then rebase + merge this PR. The 3-way merge should be clean — no textual overlap.

Verification

  • `python -c "import yaml; yaml.safe_load(open('release.yml'))"` — YAML structure valid, 8 jobs intact.
  • Dry-run requires a tag push on a throwaway tag; not exercised here.
  • After merge + transfer + v0.2.8 tag, verify:
    • SBOM artefacts visible on the GitHub Release page
    • npm packages show Verified provenance badge on the npmjs.com page

CI expectation

29 standard checks. `release.yml` itself runs only on `v*` tags so it does not execute on this PR.

Two modern supply-chain-trust additions to the release pipeline,
neither of which changes what gets published — only adds verifiable
signals attached to existing releases.

1. **CycloneDX SBOMs.** `cargo-cyclonedx` is installed in the
   cargo-publish job after the .crate files are built, and runs once
   per published crate (`wickra-core`, `wickra-data`, `wickra`). The
   resulting `*.cdx.json` files are uploaded as the `sboms` artifact,
   then attached to the GitHub Release alongside the existing wheels,
   tarballs, .node binaries and .crate files. Future security advisories
   can answer "is my version of crate X transitive in wickra Y.Z?" by
   reading the SBOM directly instead of resolving the lockfile.

2. **npm `--provenance` flag** on every npm publish call:
   - main `wickra` package (node-publish, first + retry)
   - per-platform `wickra-<triple>` subpackages (node-publish loop)
   - `wickra-wasm` (wasm-publish)

   Provenance attestations are generated server-side by npm from the
   GitHub Actions OIDC token. The publishing jobs gain
   `permissions: id-token: write` so the runner can exchange that
   token. The npm page for each published version will then carry the
   "Verified provenance" badge, which proves the tarball was built by
   *this* workflow run and not by an arbitrary local laptop with the
   NPM_TOKEN.

Skipped deliberately (to keep this PR focused, possibly follow-ups):
- Sigstore cosign signing of artefacts (different audit story; can be
  layered on after npm-provenance lands).
- SLSA build-provenance attestations via `actions/attest-build-provenance`
  (would target every artefact uniformly; the npm-provenance flag is
  the more pragmatic first cut).

YAML structure validated (8 jobs intact). No production code touched.
This PR conflicts with PR #59 only in line-by-line URL substitutions
on release.yml — rebase after #59 should be clean.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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