Skip to content

ci: add OSV-Scanner, CycloneDX SBOM, and build attestations#1529

Merged
jcputney merged 8 commits intomasterfrom
claude/add-sast-sca-sbom-q9YQr
May 6, 2026
Merged

ci: add OSV-Scanner, CycloneDX SBOM, and build attestations#1529
jcputney merged 8 commits intomasterfrom
claude/add-sast-sca-sbom-q9YQr

Conversation

@jcputney
Copy link
Copy Markdown
Owner

@jcputney jcputney commented May 5, 2026

  • Add OSV-Scanner workflow (push/PR/weekly) with results in the
    Security tab for broader advisory coverage than npm audit.
  • Generate a CycloneDX 1.6 SBOM (production deps only) during the
    release workflow and attach it to the GitHub Release.
  • Produce GitHub build-provenance and SBOM attestations for the
    published dist bundles via actions/attest-build-provenance and
    actions/attest-sbom, complementing npm's --provenance.

- Add OSV-Scanner workflow (push/PR/weekly) with results in the
  Security tab for broader advisory coverage than `npm audit`.
- Generate a CycloneDX 1.6 SBOM (production deps only) during the
  release workflow and attach it to the GitHub Release.
- Produce GitHub build-provenance and SBOM attestations for the
  published dist bundles via actions/attest-build-provenance and
  actions/attest-sbom, complementing npm's --provenance.
@github-advanced-security
Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the project’s release and CI security posture by adding automated vulnerability scanning, generating a release SBOM, and producing GitHub-native supply chain attestations to complement npm provenance.

Changes:

  • Add an OSV-Scanner workflow that runs on pushes, PRs, and a weekly schedule and uploads results to the GitHub Security tab.
  • Generate a CycloneDX 1.6 SBOM during the release workflow and upload it as a GitHub Release asset.
  • Add build provenance and SBOM attestations for release artifacts via GitHub’s actions/attest-* actions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/release.yml Adds SBOM generation, artifact attestations, and uploads SBOM to the GitHub Release.
.github/workflows/osv-scanner.yml Introduces OSV scanning on push/PR/schedule with SARIF upload permissions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
claude added 2 commits May 5, 2026 23:26
- Pin @cyclonedx/cyclonedx-npm to 4.2.1 so release SBOMs are
  reproducible; previously @latest could shift contents on each run.
- Expand attest-build-provenance and attest-sbom subject-path to
  cover every file pattern shipped by the npm package
  (dist/**/*.js, dist/**/*.js.map, dist/**/*.d.ts, index.d.ts),
  preventing partial attestations over .js bundles only.
Move @cyclonedx/cyclonedx-npm from a workflow-pinned npx invocation
to a real devDependency at 4.2.1 so Dependabot's npm ecosystem
proposes upgrades automatically. The release workflow now resolves
the binary from the project install instead of fetching @latest.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 94.28% 8652 / 9176
🔵 Statements 94.08% 8824 / 9379
🔵 Functions 95.82% 1723 / 1798
🔵 Branches 86.36% 6079 / 7039
File CoverageNo changed files found.
Generated in workflow #1071 for commit 5af5342 by the Vitest Coverage Report Action

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated
@cyclonedx/cyclonedx-npm declares libxmljs2 (a node-gyp-built native
XML module) as an optionalDependency for XML-output validation. We
only emit JSON, so it is unused at runtime, but it still bloats CI
installs and risks node-gyp/prebuild failures on Node 25 runners.

Add a top-level npm override mapping libxmljs2 to the published
no-op stub noop2@2.0.0. This eliminates the native compile, removes
~100 transitive deps from the install, and leaves JSON SBOM
generation working unchanged (verified locally with the real
project tree).
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Three review fixes:

1. Invoke cyclonedx-npm via ./node_modules/.bin/cyclonedx-npm
   instead of `npx @cyclonedx/cyclonedx-npm`. `npx --no` still
   contacts the registry when a package is missing, so the previous
   form could silently bypass the lockfile pin if the devDep ever
   went missing. The direct binary path fails fast with no network
   call and only ever runs the version installed by `npm install`.

2. Reorder the publish job so `npm publish` is the final
   irreversible step. Previously SBOM generation, attestations, and
   the GitHub-Release SBOM upload all ran *after* publish, meaning
   any failure there would leave the package published but the
   release in a partial state. New order: SBOM -> npm pack ->
   attest provenance -> attest SBOM -> upload SBOM to release ->
   npm publish.

3. Pack the npm tarball with `npm pack` and use that single tarball
   as the subject for both attestations, then publish that exact
   tarball. The previous subject-path glob covered only dist/** and
   index.d.ts even though the published package also includes
   package.json, README, and LICENSE. Attesting the tarball
   guarantees the attestation covers exactly what npm ships.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated
Comment thread package.json Outdated
- Bump engines.node from >=20.0.0 to >=20.18.0. The previous floor
  was already understated: 90 transitive devDeps (ESLint, csstools,
  cyclonedx, etc.) declare a >=20.18 or >=20.19 minimum, so installs
  on Node 20.0-20.17 would emit EBADENGINE warnings (or fail under
  engine-strict). 20.18 is the precise floor cyclonedx-npm needs.

- Move the libxmljs2 -> noop2 stub from a top-level override to two
  parent-scoped entries under @cyclonedx/cyclonedx-npm and
  @cyclonedx/cyclonedx-library. This shrinks the override's blast
  radius so any future dep that legitimately depends on libxmljs2
  will receive the real package rather than the stub. Both scopes
  are required because both packages declare libxmljs2 directly,
  and a single-parent scope leaves the other consumer's copy
  un-overridden after dedupe. Verified the resolved tree contains
  exactly one libxmljs2 entry pointing at noop2@2.0.0 with no
  native build artifacts.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated
Comment thread .github/workflows/osv-scanner.yml
Comment thread .github/workflows/osv-scanner.yml
claude and others added 2 commits May 6, 2026 01:20
- engines.node: >=20.18.0 -> >=20.19.0. Verified with semver
  against every engine range in the lockfile: the strictest
  effective lower bound is 20.19.0, driven by csstools/* (>=20.19.0),
  ESLint v10 family, jsdom, asamuzakjp css packages, rolldown
  bindings, and undici. Anything lower would still surface
  EBADENGINE warnings on transitive devDeps.

- Pin both OSV-Scanner reusable workflow refs from @v2.2.4 to the
  immutable commit SHA (9bb69575e74019c2ad085a1860787043adf47ccb,
  with `# v2.2.4` trailer for legibility). Tags can be retargeted
  upstream; a SHA guarantees the workflow code that was reviewed
  is what runs in CI. Dependabot's github-actions ecosystem
  understands SHA pins and will open update PRs when new versions
  ship.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Jonathan Putney <42720634+jcputney@users.noreply.github.com>
@jcputney jcputney merged commit 3f66002 into master May 6, 2026
22 checks passed
@jcputney jcputney deleted the claude/add-sast-sca-sbom-q9YQr branch May 6, 2026 14:01
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.

5 participants