Skip to content

Commit

Permalink
fix: omitted severity flags in docker image scan action (#142)
Browse files Browse the repository at this point in the history
* fix: omitted severity flags in docker image scan action

- Update to Step "Generate docker-cis JSON report", removed as it was causing warnings "unknown severity option: unknown severity: FALSE"
- Update to Step "Inspect docker-cis report", removed severity env as it was causing warnings "unknown severity option: unknown severity: FALSE"
- This severity flag is not being used at this point. Trivy uses this flag to restrict the scan to specific severity levels
- Because of no explicit severity flag, shared action uses value of global_enforce_build_failure env defined in our scripts

* Remove severity env
  • Loading branch information
pankajmouriyakong authored Aug 22, 2024
1 parent 5c685ec commit f19e9a7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions security-actions/scan-docker-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,9 @@ runs:
id: cis_json
with:
entrypoint: trivy
args: "image ${{ env.input }} ${{ steps.meta.outputs.scan_image }} --compliance ${{ env.compliance }} -f json --severity ${{ env.severity }} --ignore-unfixed -o ${{ steps.meta.outputs.cis_json_file }}"
args: "image ${{ env.input }} ${{ steps.meta.outputs.scan_image }} --compliance ${{ env.compliance }} -f json --ignore-unfixed -o ${{ steps.meta.outputs.cis_json_file }}"
env:
compliance: docker-cis
severity: ${{ steps.meta.outputs.global_enforce_build_failure }}
input: ${{ steps.docker_tar.outputs.files_exists == 'true' && '--input' || '' }}

- name: upload docker-cis JSON report
Expand All @@ -310,9 +309,8 @@ runs:
uses: docker://ghcr.io/aquasecurity/trivy:0.37.2
with:
entrypoint: trivy
args: "image ${{ env.input }} ${{ steps.meta.outputs.scan_image }} --compliance ${{ env.compliance }} -f table --severity ${{ env.severity }} --ignore-unfixed --exit-code ${{ env.exit-code }}"
args: "image ${{ env.input }} ${{ steps.meta.outputs.scan_image }} --compliance ${{ env.compliance }} -f table --ignore-unfixed --exit-code ${{ env.exit-code }}"
env:
exit-code: ${{ (steps.meta.outputs.global_enforce_build_failure == 'true' || inputs.fail_build == 'true') && '1' || '0' }}
compliance: docker-cis
severity: ${{ steps.meta.outputs.global_enforce_build_failure }}
input: ${{ steps.docker_tar.outputs.files_exists == 'true' && '--input' || '' }}

0 comments on commit f19e9a7

Please sign in to comment.