Skip to content

Commit

Permalink
Adds SECURITY_FAIL_ON
Browse files Browse the repository at this point in the history
  • Loading branch information
nickschuch committed Nov 19, 2024
1 parent 0692812 commit 329700e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ ifndef PHP_VERSION
$(error PHP_VERSION is undefined)
endif

SECURITY_FAIL_ON=critical

security: build
@set +e; \
fpm_exit_code=0; cli_exit_code=0; \
grype ${IMAGE_FPM}-dev-${VERSION_TAG}-${ARCH} --fail-on high; \
grype ${IMAGE_FPM}-dev-${VERSION_TAG}-${ARCH} --fail-on ${SECURITY_FAIL_ON}; \
fpm_exit_code=$$?; \
grype ${IMAGE_CLI}-dev-${VERSION_TAG}-${ARCH} --fail-on high; \
grype ${IMAGE_CLI}-dev-${VERSION_TAG}-${ARCH} --fail-on ${SECURITY_FAIL_ON}; \
cli_exit_code=$$?; \
if [ $$fpm_exit_code -ne 0 ] || [ $$cli_exit_code -ne 0 ]; then \
echo "Containers have high security findings."; \
Expand Down

0 comments on commit 329700e

Please sign in to comment.