release/provenance/npm
Releases attest build provenance
Implements release/provenance for the npm artifact: it runs when the release publishes one (see artifacts).
| Severity | warning |
| Tiers | 1 |
| Artifact | npm |
| Scope | root |
| Kind | outcome |
| Source | library v0.3.1 |
| Selected by | fleetlint-recommended@v0.3.1 |
Requirement
The package is published to npm with provenance (--provenance, NPM_CONFIG_PROVENANCE, or trusted publishing with id-token: write); the registry’s provenance is the attestation.
Why
Provenance ties the artifact to the exact source and workflow that built it, which a signature alone does not.
Capability applies when
release.exists || repo.artifacts.size() > 0Fix
Publish with npm publish --provenance from a job with id-token: write, or use trusted publishing.
Agent instruction: Add a step uses: actions/attest-build-provenance with subject-path covering the release files (or subject-name and subject-digest for an image, with push-to-registry: true); grant id-token: write and attestations: write to that job only. On GitLab set the variable RUNNER_GENERATE_ARTIFACTS_METADATA to “true” on the release job. On Gitea write a SLSA v1 predicate and run cosign attest-blob --type slsaprovenance1.
See: https://fleetlint.org/baseline/#releases, https://slsa.dev/spec/v1.0/provenance, https://docs.npmjs.com/generating-provenance-statements
Generated by fleetlint docs from catalog v0.3.1.