Skip to content

Commit

Permalink
chore(trivy): add options according to TRG 8.04 (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
evegufy authored Oct 23, 2024
1 parent 48c350e commit 8792409
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ jobs:
output: "trivy-results1.sarif"
vuln-type: "os,library"
skip-dirs: "docs/"
severity: "CRITICAL,HIGH" # While vulnerabilities of all severities are reported in the SARIF output, the exit code and workflow failure are triggered only by these specified severities (CRITICAL or HIGH).
exit-code: "1" # Trivy exits with code 1 if vulnerabilities are found, causing the workflow step to fail.
limit-severities-for-sarif: true

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
Expand Down Expand Up @@ -91,6 +94,10 @@ jobs:
format: "sarif"
output: "trivy-results2.sarif"
vuln-type: "os,library"
severity: "CRITICAL,HIGH" # While vulnerabilities of all severities are reported in the SARIF output, the exit code and workflow failure are triggered only by these specified severities (CRITICAL or HIGH).
hide-progress: false
exit-code: "1" # Trivy exits with code 1 if vulnerabilities are found, causing the workflow step to fail.
limit-severities-for-sarif: true

- name: Upload Trivy scan results to GitHub Security tab
if: always()
Expand Down

0 comments on commit 8792409

Please sign in to comment.