-
Notifications
You must be signed in to change notification settings - Fork 174
63 lines (55 loc) · 1.7 KB
/
Copy pathcve.yml
File metadata and controls
63 lines (55 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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: Scan project
uses: anchore/scan-action@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # v7
id: scan
with:
path: .
fail-build: false
severity-cutoff: high
only-fixed: true
config: .grype.yaml
- name: Upload SARIF report
if: ${{ always() }}
uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
- name: Generate table report
if: ${{ always() }}
run: |
export PATH="$(dirname $(find /opt/hostedtoolcache/grype -name grype -type f | head -1)):$PATH"
grype dir:. \
--config .grype.yaml \
--only-fixed \
--output table | tee grype-report.txt || true
- name: Upload scan reports
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: grype-scan
path: |
grype-report.txt
${{ steps.scan.outputs.json }}
retention-days: 30