npm Provenance Attestations with Sigstore & SLSA v1 Verification
Publish verifiable npm packages with --provenance on GitHub Actions or GitLab CI, inspect DSSE in-toto SLSA statements, and enforce npm audit signatures in CI.
100% Browser-Side · Zero Telemetry (connect-src 'none')
Enforce npm Signature & Provenance Checks in CI + Registry API
verify-npm-provenance.sh
# Fail CI build if any installed dependency has invalid registry/Sigstore signatures
npm audit signatures
# Inspect raw Sigstore provenance bundle from npm registry attestations endpoint
curl -fsSL "https://registry.npmjs.org/-/npm/v1/attestations/@sigstore/[email protected]" | \
jq '.attestations[] | {predicateType, logIndex: .bundle.verificationMaterial.tlogEntries[0].logIndex}'
Key Security & Architecture Takeaways
npm provenance wraps an in-toto SLSA v1 DSSE statement linking the exact tarball SHA-512 digest to the source commit, repo, and GitHub Actions workflow path.
Every published attestation receives an immutable Rekor transparency log index and Fulcio certificate so maintainer account takeovers cannot silently upload hand-built tarballs.
Running npm audit signatures in downstream CI pipelines validates both npm registry ECDSA signatures and Sigstore Rekor proofs.
Common Production Pitfalls to Avoid
Setting provenance: true in package.json publishConfig without id-token: write in GitHub Actions causes npm publish to abort with E422.
Using --provenance on private scoped packages requires an npm paid plan/public visibility; public packages receive free Sigstore provenance.
Trusting package.json repository URLs without checking the attested provenance predicate (attackers can spoof unverified repository fields in package.json).
Sign release artifacts and attach CycloneDX/SPDX SBOMs in GitHub Actions without long-lived private keys using OIDC id-token: write, Fulcio ephemeral certificates, and Rekor transparency logs.
Attach CycloneDX/SPDX SBOMs and SLSA provenance to container images using docker buildx --sbom=true --provenance=true and enforce digest-pinned verification in Kubernetes/CI.
Does npm publish --provenance work with npm Trusted Publishing (OIDC)?
Yes — both token-based publish with id-token: write and OIDC Trusted Publishing automatically mint Sigstore SLSA v1 provenance bundles logged to Rekor.
What happens if an attacker compromises an NPM_TOKEN and publishes from their laptop?
They cannot forge a GitHub Actions Fulcio OIDC certificate for your workflow. Downstream consumers verifying provenance (or checking package badges) see the missing or mismatched provenance attestation.
Can I audit an entire package.json / lockfile supply chain via API?
Yes — call RungLab RapidAPI /v1/supply-chain/audit or run our Apify OpenSSF Supply-Chain Auditor actor alongside local SBOM checks.