Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/cve.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this scanning our root package-lock.json only, or is our website/package.json and our Docker image included as well? The OSSF Scorecard vulnerabilities are largely coming from the website rather than the main package, meanwhile Docker-specific dependencies are excluded entirely from the scorecard.

Grype could be helpful for catching issues outside the main package - though I'm worried about false positives or having the CI constantly break due to the massive total number of dependencies.

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CVE Scanning

permissions:
contents: read

on:
push:
branches: ['main']
pull_request:
branches: ['main']
schedule:
- cron: '0 6 * * 1' # Weekly Monday 6am UTC

jobs:
grype:
name: Grype dependency scan
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit

- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6

- name: Install Grype
id: grype
uses: anchore/scan-action/download-grype@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # v7
with:
cache-db: true

- name: Scan (table)
run: |
${{ steps.grype.outputs.cmd }} dir:. \
--config .grype.yaml \
--only-fixed \
--fail-on high

- name: Scan (SARIF)
if: ${{ always() }}
run: |
${{ steps.grype.outputs.cmd }} dir:. \
--config .grype.yaml \
--only-fixed \
--output sarif --file grype-results.sarif || true

- name: Upload SARIF report
if: ${{ always() }}
uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
with:
sarif_file: grype-results.sarif
10 changes: 10 additions & 0 deletions .grype.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fail-on-severity: high
sort-by: severity

ignore:
- fix-state: 'wont-fix'
- fix-state: 'not-fixed'

# Comment out to include scanning experimental license inventory
exclude:
- './experimental/**'
Loading
Loading