Skip to content

Scanner offline vuln DB, semgrep writable cache, dev-only severity cap - #2094

Closed
remigiusz-antczak wants to merge 1 commit into
mainfrom
land/wave-1028am
Closed

remigiusz-antczak wants to merge 1 commit into
mainfrom
land/wave-1028am

Conversation

@remigiusz-antczak

Copy link
Copy Markdown
Collaborator

Fixes the scanner coverage gaps found in the first pilot audit, where osv-scanner and trivy couldn't download their vulnerability databases behind a sandboxed proxy and the run lost coverage.

  • review_checks.sh runs osv-scanner and trivy from a pre-seeded database (REVIEW_OSV_DB_DIR, REVIEW_TRIVY_CACHE) when the download fails. A missing directory, or one with no database artifact, is reported as NOT CHECKED along with the command that warms the cache. It never reports clean.
  • A trivy vulnerability-database download failure no longer falls back to a secret-only scan that would count as a full run.
  • semgrep gets a temporary XDG_CACHE_HOME, so it runs when HOME isn't writable.
  • supply_chain_check.sh caps findings in dev-only npm packages at moderate, and says so in the output. It does this only when every name@version occurrence in the lockfile is dev and the finding comes from npm, so a production package with the same name keeps its severity.
  • actionlint skips with a notice when there are no workflow files, instead of printing ok.

Verification

  • bash scripts/test-scanner-offline-db.sh: 19/19. Covers the prod+dev same-name case, an empty DB failing closed with a nonzero exit, and the "failed to download vulnerability DB" case.
  • bash scripts/ci-tests.d/scanner-sandbox-fallback.sh: 31/31.
  • Independent review: 1 red (dev downgrade keyed on the bare package name) and 4 yellow fail-open risks. All five are fixed in this commit, each with a test.

🤖 Generated with Claude Code

review_checks.sh runs osv-scanner and trivy from a pre-seeded DB when the
download fails (REVIEW_OSV_DB_DIR, REVIEW_TRIVY_CACHE); a missing or
non-DB-artifact dir is reported as NOT CHECKED with the warm command, and
supply_chain_check.sh fails (rc 1) in that case. A trivy vuln-DB download
failure no longer falls back to secret-only. semgrep gets a temp
XDG_CACHE_HOME. supply_chain_check.sh caps findings in dev-only npm
packages (every name@version occurrence dev, npm only) at moderate and
notes it; actionlint skips when there are no workflow files.

Tests: 19/19 scanner-offline-db, 31/31 scanner-sandbox-fallback

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@remigiusz-antczak

Copy link
Copy Markdown
Collaborator Author

Superseded by #2097 (actionlint not-applicable fix; no force-push).

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.

1 participant