Skip to content

Commit 3aa0d44

Browse files
authored
Merge pull request #1057 from broadinstitute/trivy-limit-severities-sarif
Enforce Trivy severity filter on SARIF output and fail CI on findings
2 parents 35b4d76 + 2696f56 commit 3aa0d44

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/container-scan.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
format: 'sarif'
3737
output: 'trivy-results.sarif'
3838
severity: 'CRITICAL,HIGH'
39+
limit-severities-for-sarif: true
3940
exit-code: '0'
4041
ignore-unfixed: true
4142
trivyignores: '.trivyignore'
@@ -48,7 +49,7 @@ jobs:
4849
format: 'json'
4950
output: 'trivy-results.json'
5051
severity: 'CRITICAL,HIGH'
51-
exit-code: '0'
52+
exit-code: '1'
5253
ignore-unfixed: true
5354
trivyignores: '.trivyignore'
5455
ignore-policy: '.trivy-ignore-policy.rego'

.github/workflows/docker.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,7 @@ jobs:
10201020
format: 'sarif'
10211021
output: 'trivy-results.sarif'
10221022
severity: 'CRITICAL,HIGH'
1023+
limit-severities-for-sarif: true
10231024
exit-code: '0'
10241025
ignore-unfixed: true
10251026
trivyignores: '.trivyignore'
@@ -1032,7 +1033,7 @@ jobs:
10321033
format: 'json'
10331034
output: 'trivy-results.json'
10341035
severity: 'CRITICAL,HIGH'
1035-
exit-code: '0'
1036+
exit-code: '1'
10361037
ignore-unfixed: true
10371038
trivyignores: '.trivyignore'
10381039
ignore-policy: '.trivy-ignore-policy.rego'

0 commit comments

Comments
 (0)