Skip to content

Commit

Permalink
chore(trivy): add options according to TRG 8.04 (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
evegufy authored Oct 24, 2024
1 parent 47d02c4 commit 6a6617d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/trivy-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
format: "sarif"
output: "trivy-results1.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).
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 @@ -93,6 +96,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
7 changes: 7 additions & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
format: "sarif"
output: "trivy-results1.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).
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 @@ -93,6 +96,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 6a6617d

Please sign in to comment.