Skip to content

Commit eb9dd9b

Browse files
authored
Add Trivy scanner workflow for vulnerability scanning
1 parent 24e2a26 commit eb9dd9b

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/trivy.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Trivy Scanner
2+
3+
permissions:
4+
contents: read
5+
security-events: write
6+
on:
7+
push:
8+
branches:
9+
- main
10+
- dev
11+
pull_request:
12+
jobs:
13+
trivy-scan:
14+
name: Use Trivy
15+
runs-on: ubuntu-24.04
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Run Trivy scanner in repo mode
21+
uses: aquasecurity/[email protected]
22+
with:
23+
scan-type: "fs"
24+
ignore-unfixed: true
25+
format: "sarif"
26+
output: "trivy-results.sarif"
27+
severity: "CRITICAL,HIGH,UNKNOWN"
28+
scanners: vuln,secret,misconfig,license
29+
github-pat: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Upload Trivy scan results to GitHub Security tab
32+
uses: github/codeql-action/upload-sarif@v3
33+
with:
34+
sarif_file: "trivy-results.sarif"

0 commit comments

Comments
 (0)