Skip to content

Commit

Permalink
chore(trivy): add options according to TRG 8.04
Browse files Browse the repository at this point in the history
  • Loading branch information
evegufy committed Nov 13, 2024
1 parent 1938b28 commit febe62a
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 @@ -60,6 +60,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@2d790406f505036ef40ecba973cc774a50395aac # v3.25.13
Expand Down Expand Up @@ -92,6 +95,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 @@ -60,6 +60,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@2d790406f505036ef40ecba973cc774a50395aac # v3.25.13
Expand Down Expand Up @@ -92,6 +95,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 febe62a

Please sign in to comment.