Skip to content

Commit 6749907

Browse files
committed
Add trivy scan
1 parent fb49c3b commit 6749907

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,26 @@ jobs:
9090
-PimageRegistry=${{ needs.build-vars.outputs.registry }}
9191
-PjdkVersion=${{ needs.build-vars.outputs.jvm-version }}
9292
-PimageTag=${{ needs.sha-tag.outputs.tag }}
93+
94+
vulnerability-scan:
95+
name: Scan for vulnerabilities
96+
runs-on: ubuntu-latest
97+
needs:
98+
- build-vars
99+
- sha-tag
100+
steps:
101+
- name: Run Trivy vulnerability scanner
102+
uses: aquasecurity/trivy-action@0.20.0
103+
with:
104+
image-ref: ${{ needs.build-vars.outputs.registry }}/${{ github.repository }}:${{ needs.sha-tag.outputs.tag }}
105+
format: table
106+
exit-code: 1
107+
ignore-unfixed: true
108+
vuln-type: os,library
109+
severity: CRITICAL,HIGH
110+
111+
- name: Upload Trivy scan results to GitHub Security tab
112+
uses: github/codeql-action/upload-sarif@v2
113+
if: always()
114+
with:
115+
sarif_file: trivy-results.sarif

0 commit comments

Comments
 (0)