Skip to content

Commit 6d57a56

Browse files
author
Rafael Miranda
committed
Added additional step to submit results from IaC to GitHub Actions
1 parent db24bd4 commit 6d57a56

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/iac_scanner.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,28 @@ jobs:
2222
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
2323
echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -cs) main | sudo tee -a /etc/apt/sources.list.d/trivy.list
2424
sudo apt-get update && sudo apt-get install -yq trivy
25+
2526
build:
2627
name: IaC Scan
2728
runs-on: ubuntu-20.04
2829
steps:
2930
- name: Checkout code
3031
uses: actions/checkout@v4
32+
3133
- name: Run Trivy vulnerability scanner in fs mode
3234
uses: aquasecurity/trivy-action@master
3335
with:
3436
scan-type: "fs"
3537
scanners: "misconfig"
3638
scan-ref: "."
3739
hide-progress: false
38-
format: "table"
40+
format: "sarif"
3941
ignore-unfixed: true
40-
# severity: "HIGH,CRITICAL,MEDIUM"
41-
# exit-code: 1
42+
output: "trivy-results.sarif"
43+
severity: "HIGH,CRITICAL,MEDIUM"
44+
45+
- name: Upload Trivy results to GitHub Actions
46+
uses: github/codeql-action/upload-sarif@v3
47+
if: always()
48+
with:
49+
sarif_file: "trivy-results.sarif"

0 commit comments

Comments
 (0)