2020-09-15 18:43:27 +00:00
|
|
|
#/bin/sh
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2022-04-20 19:21:46 +00:00
|
|
|
if [ -z $1 ] && [ -z $2 ]; then
|
2022-04-15 16:41:40 +00:00
|
|
|
echo "error: image name and arch name are required as arguments. exiting..."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
ARCH=$2
|
|
|
|
|
|
|
|
# skipping image scan for s390x since trivy doesn't support s390x arch yet
|
|
|
|
if [ "${ARCH}" == "s390x" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2020-09-15 18:43:27 +00:00
|
|
|
if [ -n ${DEBUG} ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
|
2022-04-15 16:41:40 +00:00
|
|
|
|
2020-09-15 18:43:27 +00:00
|
|
|
|
|
|
|
IMAGE=$1
|
|
|
|
SEVERITIES="HIGH,CRITICAL"
|
|
|
|
|
2020-09-16 20:37:42 +00:00
|
|
|
trivy --quiet image --severity ${SEVERITIES} --no-progress --ignore-unfixed ${IMAGE}
|
2020-09-15 18:43:27 +00:00
|
|
|
|
|
|
|
exit 0
|