-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (46 loc) · 1.29 KB
/
cve-scan.yml
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
name: CVE Scan
on:
push:
# Workflows triggered by Dependabot on the "push" event run with read-only access.
# Uploading Code Scanning results requires write access. We therefore only use the
# "pull_request" trigger for Dependabot branches.
branches-ignore:
- 'dependabot/**'
pull_request:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
scan:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Cache trivy
uses: actions/cache@v3
env:
cache-name: cache-trivy
with:
path: ~/.cache/trivy
key: ${{ env.cache-name }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ env.cache-name }}-
- name: Run trivy
uses: aquasecurity/trivy-action@master
with:
exit-code: 1
format: 'sarif'
output: 'trivy-results.sarif'
scan-ref: '.'
scan-type: 'fs'
severity: 'CRITICAL,HIGH'
list-all-pkgs: 'true'
ignore-unfixed: true
- name: Publish results
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: 'trivy-results.sarif'