Skip to content

Commit

Permalink
fix: omitted severity flags in docker image scan action
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
pankajmouriyakong committed Aug 21, 2024
1 parent a213265 commit df9f3de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions security-actions/scan-docker-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,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 @@ -307,7 +306,7 @@ 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
Expand Down

0 comments on commit df9f3de

Please sign in to comment.