Skip to content

feat: dependency scan reusable workflow — osv-scanner (#5)#54

Open
ms280690 wants to merge 1 commit into
mainfrom
issue-5-dep-scan-app
Open

feat: dependency scan reusable workflow — osv-scanner (#5)#54
ms280690 wants to merge 1 commit into
mainfrom
issue-5-dep-scan-app

Conversation

@ms280690

Copy link
Copy Markdown
Collaborator

Closes #5. Application-source dependency vulnerability scan — first sub-issue of parent #8. Establishes the dep-scan-*.yml pattern that #6 (checkov) and #7 (trivy) will follow.

What

File Purpose
.github/actions/osv-scanner/action.yml Composite — checksum-verified osv-scanner v2.4.0; scans all lockfiles vs OSV; SARIF + job-level annotations; CVSS-threshold gate.
.github/workflows/dep-scan-app.yml Reusable gate. Inputs: directory, fail-on-severity, sarif-upload, actions-ref.
.github/workflows/ci.yml osv-scanner dogfood (smoke test — no lockfiles here).
README.md, docs/approved-actions.md Usage, CVSS mapping, osv.dev egress note.

Acceptance criteria (#5)

  • dep-scan-app.yml: osv-scanner on pull_request; scans all lockfiles; PR annotations; blocks on Critical; SARIF to Security tab
  • fail-on-severity input (default critical)
  • Tested against a Python + Node.js repo — verified locally on a Python lockfile; recommend a real Node.js run before merge

Design notes

  • fail-on-severity is custom — osv-scanner has no native severity gate (nor does the official reusable workflow, which only has fail-on-vuln). Implemented by parsing groups[].max_severity (numeric CVSS) and mapping: critical ≥ 9.0, high ≥ 7.0, medium ≥ 4.0, low ≥ 0.1.
  • Checksum-verified binary, consistent with gitleaks/trufflehog/tflint/kubeconform. No new org-allowlist publisher.
  • Two osv runs (SARIF for upload + JSON for gate/annotations) — both cheap; commented.
  • Reusable workflow omits harden-runner, inherits caller permissions (security-events: write only when sarif-upload), immutable actions-ref pattern.
  • sarif-upload: false for private repos without a Code Security license (annotations + log still work).

Verified locally

Checksum verify; scan of a known-vulnerable requests==2.19.0 lockfile → max CVSS 8.9; gate correctly passes at critical (9.0), blocks at high/medium; per-package annotations with CVE IDs.

🤖 Generated with Claude Code

Application-source dependency vulnerability scan, first sub-issue of #8.

- .github/actions/osv-scanner: composite that installs a pinned,
  checksum-verified osv-scanner v2.4.0 binary and scans all lockfiles against
  the OSV database (language-agnostic). Produces SARIF (optionally uploaded to
  the Security tab) and emits job-level annotations per affected package. Gates
  on fail-on-severity by mapping it to a CVSS threshold (critical>=9.0,
  high>=7.0, medium>=4.0, low>=0.1) parsed from groups[].max_severity.
- .github/workflows/dep-scan-app.yml: reusable gate; inputs directory,
  fail-on-severity, sarif-upload, actions-ref. Immutable self-reference
  pattern; no harden-runner; inherits caller permissions.
- ci.yml: osv-scanner dogfood (smoke test — no lockfiles in this repo).
- README + approved-actions: usage, CVSS threshold mapping, osv.dev egress note.

osv-scanner has no native fail-on-severity flag (nor does the official reusable
workflow — only fail-on-vuln), so the gate is implemented by parsing the JSON
report's max_severity. Kept the checksum-verified binary pattern (consistent
with gitleaks/trufflehog/tflint/kubeconform; no new org-allowlist publisher).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🤖 Hi @ms280690, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@ms280690
ms280690 requested review from Copilot and michaelconnor00 and removed request for Copilot July 16, 2026 21:23
@github-actions

Copy link
Copy Markdown

🤖 I'm sorry @ms280690, but I was unable to process your request. Please see the logs for more details.

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.

feat: dependency management — application source code

1 participant