Skip to content

Commit 089b270

Browse files
committed
ci: add Grype CVE scanning and fix high/critical CVEs
Adds a Grype CVE scanning workflow that runs on push, PR, and weekly schedule. Scans package-lock.json (not the working directory) to avoid false positives from CI runner tooling. Uploads SARIF to the Security tab and a table report as an artifact. Fails on high severity with a fix available. Dependency bumps (all same-major, no breaking changes): - concurrently 9.2.1 → 9.2.3 (shell-quote critical: GHSA-w7jw-789q-3m8p) - vitest 3.2.4 → 3.2.6 (critical: arbitrary file read) - @vitest/coverage-v8 3.2.4 → 3.2.6 (depends on vitest) - vite 7.3.1 → 7.3.5 (high: GHSA-fx2h-pf6j-xcff) - cypress 15.9.0 → 15.17.0 (tmp, qs, uuid transitives) - react-router-dom 6.30.3 → 6.30.4 (moderate: GHSA-2j2x-hqr9-3h42) Overrides for transitive deps whose parents haven't released fixes: - form-data 4.0.5 → 4.0.6 (high: GHSA-hmw2-7cc7-3qxx) - tmp 0.2.5 → 0.2.6 (high: path traversal) Reduces total vulnerabilities from 19 to 7 (0 critical, 0 high).
1 parent fc23d58 commit 089b270

4 files changed

Lines changed: 650 additions & 714 deletions

File tree

.github/workflows/cve.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CVE Scanning
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches: ['main']
9+
pull_request:
10+
branches: ['main']
11+
schedule:
12+
- cron: '0 6 * * 1' # Weekly Monday 6am UTC
13+
14+
jobs:
15+
grype:
16+
name: Grype dependency scan
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
security-events: write
21+
steps:
22+
- name: Harden Runner
23+
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
24+
with:
25+
egress-policy: audit
26+
27+
- name: Checkout
28+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
29+
30+
- name: Install Grype
31+
id: grype
32+
uses: anchore/scan-action/download-grype@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # v7
33+
with:
34+
cache-db: true
35+
36+
- name: Scan (table)
37+
run: |
38+
${{ steps.grype.outputs.cmd }} dir:. \
39+
--config .grype.yaml \
40+
--only-fixed \
41+
--fail-on high
42+
43+
- name: Scan (SARIF)
44+
if: ${{ always() }}
45+
run: |
46+
${{ steps.grype.outputs.cmd }} dir:. \
47+
--config .grype.yaml \
48+
--only-fixed \
49+
--output sarif --file grype-results.sarif || true
50+
51+
- name: Upload SARIF report
52+
if: ${{ always() }}
53+
uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
54+
with:
55+
sarif_file: grype-results.sarif

.grype.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
fail-on-severity: high
2+
sort-by: severity
3+
4+
ignore:
5+
- fix-state: 'wont-fix'
6+
- fix-state: 'not-fixed'
7+
8+
# Comment out to include scanning experimental license inventory
9+
exclude:
10+
- ./experimental/license-inventory/**

0 commit comments

Comments
 (0)