File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed
Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ name : " Trivy - Scan for vulnerabilities"
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ # The branches below must be a subset of the branches above
8+ branches : [main]
9+ schedule :
10+ # Runs every Monday morning PST
11+ - cron : " 17 15 * * 1"
12+
13+ jobs :
14+ scan-repo :
15+ name : Scan repository
16+ runs-on : ubuntu-20.04
17+ steps :
18+ - name : Checkout code
19+ - uses : actions/checkout@v2
20+
21+ - name : Run Trivy vulnerability scanner in repo mode
22+ uses : aquasecurity/trivy-action@master
23+ with :
24+ scan-type : ' fs'
25+ format : ' template'
26+ template : ' @/contrib/sarif.tpl'
27+ output : ' trivy-repo-results.sarif'
28+ severity : ' CRITICAL'
29+
30+ - name : Upload Trivy scan results to GitHub Security tab
31+ uses : github/codeql-action/upload-sarif@v1
32+ with :
33+ sarif_file : ' trivy-repo-results.sarif'
34+
35+ scan-image :
36+ name : Scan Docker image
37+ runs-on : ubuntu-20.04
38+ steps :
39+ - name : Checkout code
40+ - uses : actions/checkout@v2
41+
42+ - name : Build an image from Dockerfile
43+ run : |
44+ docker build -t codercom/code-server:${{ github.sha }} --file ./ci/release-image/Dockerfile .
45+
46+ - name : Run Trivy vulnerability scanner in image mode
47+ uses : aquasecurity/trivy-action@master
48+ with :
49+ scan-type : ' image'
50+ format : ' template'
51+ template : ' @/contrib/sarif.tpl'
52+ output : ' trivy-image-results.sarif'
53+ severity : ' CRITICAL'
54+
55+ - name : Upload Trivy scan results to GitHub Security tab
56+ uses : github/codeql-action/upload-sarif@v1
57+ with :
58+ sarif_file : ' trivy-image-results.sarif'
You can’t perform that action at this time.
0 commit comments