Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a2157eb22 | ||
|
|
1ccef265f5 | ||
|
|
d62898dfb3 | ||
|
|
6bce46377c | ||
|
|
101d9bacf6 | ||
|
|
8eccb55397 |
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
FROM aquasec/trivy:0.19.1
|
FROM aquasec/trivy:0.20.2
|
||||||
COPY entrypoint.sh /
|
COPY entrypoint.sh /
|
||||||
RUN apk --no-cache add bash
|
RUN apk --no-cache add bash
|
||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|||||||
+1
-1
@@ -54,7 +54,7 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
timeout:
|
timeout:
|
||||||
description: 'timeout (default 2m0s)'
|
description: 'timeout (default 5m0s)'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
ignore-policy:
|
ignore-policy:
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ if [ $cacheDir ];then
|
|||||||
GLOBAL_ARGS="$GLOBAL_ARGS --cache-dir $cacheDir"
|
GLOBAL_ARGS="$GLOBAL_ARGS --cache-dir $cacheDir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
SARIF_ARGS=""
|
||||||
ARGS=""
|
ARGS=""
|
||||||
if [ $format ];then
|
if [ $format ];then
|
||||||
ARGS="$ARGS --format $format"
|
ARGS="$ARGS --format $format"
|
||||||
@@ -82,9 +83,11 @@ if [ $exitCode ];then
|
|||||||
fi
|
fi
|
||||||
if [ "$ignoreUnfixed" == "true" ] && [ "$scanType" != "config" ];then
|
if [ "$ignoreUnfixed" == "true" ] && [ "$scanType" != "config" ];then
|
||||||
ARGS="$ARGS --ignore-unfixed"
|
ARGS="$ARGS --ignore-unfixed"
|
||||||
|
SARIF_ARGS="$SARIF_ARGS --ignore-unfixed"
|
||||||
fi
|
fi
|
||||||
if [ $vulnType ] && [ "$scanType" != "config" ];then
|
if [ $vulnType ] && [ "$scanType" != "config" ];then
|
||||||
ARGS="$ARGS --vuln-type $vulnType"
|
ARGS="$ARGS --vuln-type $vulnType"
|
||||||
|
SARIF_ARGS="$SARIF_ARGS --vuln-type $vulnType"
|
||||||
fi
|
fi
|
||||||
if [ $severity ];then
|
if [ $severity ];then
|
||||||
ARGS="$ARGS --severity $severity"
|
ARGS="$ARGS --severity $severity"
|
||||||
@@ -96,6 +99,7 @@ if [ $skipDirs ];then
|
|||||||
for i in $(echo $skipDirs | tr "," "\n")
|
for i in $(echo $skipDirs | tr "," "\n")
|
||||||
do
|
do
|
||||||
ARGS="$ARGS --skip-dirs $i"
|
ARGS="$ARGS --skip-dirs $i"
|
||||||
|
SARIF_ARGS="$SARIF_ARGS --skip-dirs $i"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if [ $timeout ];then
|
if [ $timeout ];then
|
||||||
@@ -103,6 +107,7 @@ if [ $timeout ];then
|
|||||||
fi
|
fi
|
||||||
if [ $ignorePolicy ];then
|
if [ $ignorePolicy ];then
|
||||||
ARGS="$ARGS --ignore-policy $ignorePolicy"
|
ARGS="$ARGS --ignore-policy $ignorePolicy"
|
||||||
|
SARIF_ARGS="$SARIF_ARGS --ignore-policy $ignorePolicy"
|
||||||
fi
|
fi
|
||||||
if [ "$hideProgress" == "true" ];then
|
if [ "$hideProgress" == "true" ];then
|
||||||
ARGS="$ARGS --no-progress"
|
ARGS="$ARGS --no-progress"
|
||||||
@@ -111,3 +116,14 @@ fi
|
|||||||
echo "Running trivy with options: ${ARGS}" "${artifactRef}"
|
echo "Running trivy with options: ${ARGS}" "${artifactRef}"
|
||||||
echo "Global options: " "${GLOBAL_ARGS}"
|
echo "Global options: " "${GLOBAL_ARGS}"
|
||||||
trivy $GLOBAL_ARGS ${scanType} $ARGS ${artifactRef}
|
trivy $GLOBAL_ARGS ${scanType} $ARGS ${artifactRef}
|
||||||
|
returnCode=$?
|
||||||
|
|
||||||
|
# SARIF is special. We output all vulnerabilities,
|
||||||
|
# regardless of severity level specified in this report.
|
||||||
|
# This is a feature, not a bug :)
|
||||||
|
if [[ ${template} == *"sarif"* ]]; then
|
||||||
|
echo "Building SARIF report with options: ${SARIF_ARGS}" "${artifactRef}"
|
||||||
|
trivy --quiet ${scanType} --format template --template ${template} --output ${output} $SARIF_ARGS ${artifactRef}
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit $returnCode
|
||||||
|
|||||||
Reference in New Issue
Block a user