Skip to content

Commit 303a9ba

Browse files
author
Corneil du Plessis
committed
Adding Trivy scanning
1 parent 7aacdfe commit 303a9ba

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed

.github/workflows/ci-pr.yml

+21
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,24 @@ jobs:
3434
- name: Clean cache
3535
run: |
3636
find ~/.m2/repository -type d -name '*SNAPSHOT' | xargs rm -fr
37+
scan:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v2
41+
- name: Run Trivy vulnerability scanner in repo mode
42+
uses: aquasecurity/trivy-action@master
43+
with:
44+
scan-type: 'fs'
45+
ignore-unfixed: true
46+
format: 'table'
47+
severity: 'CRITICAL,HIGH'
48+
- name: 'Scanned'
49+
shell: bash
50+
run: echo "::info ::Scanned"
51+
done:
52+
runs-on: ubuntu-latest
53+
needs: [ scan, build ]
54+
steps:
55+
- name: 'Done'
56+
shell: bash
57+
run: echo "::info ::Done"

.github/workflows/ci.yml

+26
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,29 @@ jobs:
8282
- name: Clean cache
8383
run: |
8484
find ~/.m2/repository -type d -name '*SNAPSHOT' | xargs rm -fr
85+
scan:
86+
runs-on: ubuntu-latest
87+
steps:
88+
- uses: actions/checkout@v2
89+
- name: Run Trivy vulnerability scanner in repo mode
90+
uses: aquasecurity/trivy-action@master
91+
with:
92+
scan-type: 'fs'
93+
ignore-unfixed: true
94+
format: 'sarif'
95+
output: 'trivy-results.sarif'
96+
severity: 'CRITICAL,HIGH'
97+
- name: Upload Trivy scan results to GitHub Security tab
98+
uses: github/codeql-action/upload-sarif@v2
99+
with:
100+
sarif_file: 'trivy-results.sarif'
101+
- name: 'Scanned'
102+
shell: bash
103+
run: echo "::info ::Scanned"
104+
done:
105+
runs-on: ubuntu-latest
106+
needs: [ scan, build ]
107+
steps:
108+
- name: 'Done'
109+
shell: bash
110+
run: echo "::info ::Done"

.trivyignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CVE-2022-1471
2+
CVE-2016-1000027

trivy.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
timeout: 20m
2+
scan:
3+
security-checks:
4+
- vuln

0 commit comments

Comments
 (0)