Skip to content
Snippets Groups Projects

[PLATFORM-1335] correct usage of TRIVY_SEVERITY environment variable

Merged [PLATFORM-1335] correct usage of TRIVY_SEVERITY environment variable
Merged Joshua David Akers requested to merge akers-main-patch-13888 into main
Compare and
1 file
+ 3
3
Compare changes
  • Side-by-side
  • Inline
@@ -19,9 +19,9 @@
cat ${TRIVY_IGNORE_FILE}
fi
if [ -n "${TRIVY_SEVERITY}" ]; then
export TRIVY_SEVERITY="--severity ${TRIVY_SEVERITY}"
export TRIVY_SEVERITY="${TRIVY_SEVERITY}"
else
export TRIVY_SEVERITY="--severity CRITICAL"
export TRIVY_SEVERITY="CRITICAL"
fi
echo "Scanning $FULL_IMAGE_NAME"
trivy --version
@@ -35,7 +35,7 @@
# Prints full report
time trivy image --exit-code 0 --cache-dir .trivycache/ --no-progress --timeout 15m $TRIVY_IGNORE "$FULL_IMAGE_NAME"
# Fail on critical vulnerabilities
time trivy image --exit-code 1 --cache-dir .trivycache/ $TRIVY_SEVERITY --no-progress --timeout 15m $TRIVY_IGNORE "$FULL_IMAGE_NAME"
time trivy image --exit-code 1 --cache-dir .trivycache/ --no-progress --timeout 15m $TRIVY_IGNORE "$FULL_IMAGE_NAME"
cache:
paths:
- .trivycache/