feat(audit): add --include-attestations flag to output sigstore bundles#9049
Draft
mitchdenny wants to merge 1 commit intonpm:latestfrom
Draft
feat(audit): add --include-attestations flag to output sigstore bundles#9049mitchdenny wants to merge 1 commit intonpm:latestfrom
mitchdenny wants to merge 1 commit intonpm:latestfrom
Conversation
Add a new --include-attestations flag for `npm audit signatures` that includes the full sigstore attestation bundles in JSON output. This enables downstream tooling to consume and further process attestation data (e.g. for policy engines, SBOMs, or custom verification). When used with `npm audit signatures --json --include-attestations`, the JSON output includes a `verified` array containing each package's name, version, and attestation bundles. Depends on npm/pacote#457 to expose the fetched attestation bundles on the manifest's _attestations property. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Adds a new
--include-attestationsflag fornpm audit signaturesthat includes the full sigstore attestation bundles in JSON output. Closes #9048.Changes
workspaces/config/lib/definitions/definitions.js: Newinclude-attestationsboolean config definitionlib/commands/audit.js: Addedinclude-attestationsto audit command paramslib/utils/verify-signatures.js: Collects verified attestation data and includes it in JSON output when flag is set; adds human-readable hint when attestations are verified without the flagdocs/lib/content/commands/npm-audit.md: Documents the new flagtest/lib/commands/audit.js: Two new tests covering the flag behaviorExample output
{ "invalid": [], "missing": [], "verified": [ { "name": "sigstore", "version": "0.4.0", "attestations": { "url": "https://registry.npmjs.org/-/npm/v1/attestations/sigstore@0.4.0", "provenance": { "predicateType": "https://slsa.dev/provenance/v0.2" }, "bundles": [...] } } ] }Dependencies
cc @feelepxyz