Skip to content

Commit 18015f4

Browse files
committed
CI: scan code with trivy (#174)
* CI: scan code with trivy * bump trivy action version * include low severity vulns in sbom
1 parent 92121e0 commit 18015f4

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/build-docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
cache-to: type=gha,mode=max
7070

7171
- name: Scan image with Trivy
72-
uses: aquasecurity/trivy-action@0.32.0
72+
uses: aquasecurity/trivy-action@0.33.1
7373
with:
7474
image-ref: "${{ env.GHCR_REPO }}:${{ github.sha }}-${{ matrix.tag }}"
7575
format: "table"

.github/workflows/sbom.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ jobs:
3232
format: 'spdx-json'
3333
output: "defguard-proxy-${{ env.VERSION }}.sbom.json"
3434
scan-ref: '.'
35-
severity: "CRITICAL,HIGH,MEDIUM"
35+
severity: "CRITICAL,HIGH,MEDIUM,LOW"
36+
scanners: "vuln"
3637

3738
- name: Create docker image SBOM with Trivy
3839
uses: aquasecurity/trivy-action@0.33.1
@@ -41,7 +42,7 @@ jobs:
4142
scan-type: 'image'
4243
format: 'spdx-json'
4344
output: "defguard-proxy-${{ env.VERSION }}-docker.sbom.json"
44-
severity: "CRITICAL,HIGH,MEDIUM"
45+
severity: "CRITICAL,HIGH,MEDIUM,LOW"
4546
scanners: "vuln"
4647

4748
- name: Upload SBOM

.github/workflows/test.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ jobs:
3434
uses: actions/checkout@v4
3535
with:
3636
submodules: recursive
37+
- name: Scan code with Trivy
38+
uses: aquasecurity/trivy-action@0.33.1
39+
with:
40+
scan-type: 'fs'
41+
scan-ref: '.'
42+
exit-code: "1"
43+
ignore-unfixed: true
44+
severity: "CRITICAL,HIGH,MEDIUM"
45+
scanners: "vuln"
3746
- name: Cache
3847
uses: Swatinem/rust-cache@v2
3948
- name: Install protoc

0 commit comments

Comments
 (0)