File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 3838 "skip_image_scan" : {
3939 "type" : " boolean" ,
4040 "default" : false ,
41- "description" : " Skip scanning the image for vulnerabilities"
41+ "description" : " [Deprecated: use scan_high_severity or the .trivyignore file instead] Skip scanning the image for vulnerabilities"
42+ },
43+ "scan_high_severity" : {
44+ "type" : " boolean" ,
45+ "default" : true ,
46+ "description" : " Scan the image for high severity vulnerabilities"
4247 }
4348 },
4449 "required" : [" directory" , " ecr_repository" ]
Original file line number Diff line number Diff line change 2626 type : boolean
2727 required : false
2828 default : false
29+ scan_high_severity :
30+ description : ' Include high severity'
31+ type : boolean
32+ required : false
33+ default : true
2934 runs_on :
3035 type : string
3136 required : false
@@ -240,6 +245,16 @@ jobs:
240245 # https://github.com/docker/build-push-action/issues/1156#issuecomment-2437227730
241246 DOCKER_BUILD_SUMMARY : false
242247
248+ - name : Determine trivy scan severity levels
249+ id : set_severity
250+ run : |
251+ if [[ "${{ github.event.inputs.scan_high_severity }}" == "false" ]] || \
252+ [[ "${{ vars.SCAN_HIGH_SEVERITY }}" == "false" ]] || \
253+ [[ "${{ matrix.component.scan_high_severity }}" == "false" ]]; then
254+ echo "severity=CRITICAL" >> "$GITHUB_OUTPUT"
255+ else
256+ echo "severity=HIGH,CRITICAL" >> "$GITHUB_OUTPUT"
257+ fi
243258 - name : Run Trivy vulnerability scanner
244259 if : ${{ inputs.skip_image_scan != true && fromJson(vars.SKIP_IMAGE_SCAN || 'false') != true && matrix.component.skip_image_scan != true }}
245260 uses :
aquasecurity/[email protected] @@ -249,7 +264,7 @@ jobs:
249264 exit-code : ' 1'
250265 ignore-unfixed : false
251266 vuln-type : ' os,library'
252- severity : ' HIGH,CRITICAL '
267+ severity : ${{ steps.set_severity.outputs.severity }}
253268 continue-on-error : false
254269
255270 - name : Push image
You can’t perform that action at this time.
0 commit comments