ReviewOS

craft-native/craft

security: make the SBOM vulnerability scan actionable and failure-safe

#279
Closed glennmichael123 opened this 9 days ago ·
9 days ago

Problem

The latest main SBOM workflow run succeeded, but its uploaded Grype report contains 67 matches: 30 High, 29 Medium, and 8 Low. There are no Critical findings, so the current workflow stays green and only writes a warning to the step summary.

Run: https://github.com/craft-native/craft/actions/runs/35871502821

The scan step also appends || true to both Grype invocations. A scanner execution or database failure can therefore be hidden; if the JSON is absent or unreadable, later output defaults can make the run appear clean.

Representative High findings include brace-expansion/minimatch paths, Electron comparison tooling, Go stdlib/tool components, extract-zip, and actions/download-artifact metadata. Many are likely developer, benchmark, fixture, or CI-tool paths rather than shipped Craft runtime dependencies, but that distinction is not encoded or reviewed anywhere.

This complements #276, which tracks the narrower bun audit findings in the lockfile.

Expected

  • Fail reliably when Grype itself cannot complete or produce valid JSON.
  • Define a reviewed policy for High/Critical findings: gate, baseline/allowlist with expiry, or scope the SBOM to shipped artifacts and scan tooling separately.
  • Record why retained findings are unreachable or non-shipping.
  • Surface new findings as a visible regression instead of allowing an indefinitely green scan.
  • Pin or otherwise verify downloaded scanner installers as part of the supply-chain review.

Evidence

The downloaded artifact for run 35871502821 reports severity counts of High=30, Medium=29, Low=8, Critical=0, while the vulnerability-scan job concludes success.

Discovered during the post-merge release audit for #254, #242, and #220.

9 days ago

Triage detail from the run artifact’s location metadata:

High findings come from four distinct scopes:

  • Root lockfile: brace-expansion@2.1.2 in /bun.lock (already overlaps #276).
  • Benchmark-only fixtures: Electron/extract-zip under /benchmarks/apps/electron/bun.lock, and lodash/minimatch/brace-expansion under /benchmarks/apps/electrobun/bun.lock.
  • Build tool binary: Go stdlib and golang.org/x/text detected inside /node_modules/@typescript/typescript-linux-x64/lib/tsc.
  • Workflow metadata: actions/download-artifact@v4 in /.github/workflows/sbom.yml.

Of the 30 High matches, Electron contributes 7, Go stdlib 7, minimatch 6, brace-expansion 7, extract-zip 2, and lodash 1 (with package/advisory duplication accounting for the total). This supports separate policies for shipped runtime dependencies, benchmark comparisons, build tools, and GitHub Actions instead of one blanket allowlist.

Sign in to comment on this issue.