Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a2157eb22 |
+7
-2
@@ -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"
|
||||||
@@ -117,8 +122,8 @@ returnCode=$?
|
|||||||
# regardless of severity level specified in this report.
|
# regardless of severity level specified in this report.
|
||||||
# This is a feature, not a bug :)
|
# This is a feature, not a bug :)
|
||||||
if [[ ${template} == *"sarif"* ]]; then
|
if [[ ${template} == *"sarif"* ]]; then
|
||||||
echo "Building SARIF report"
|
echo "Building SARIF report with options: ${SARIF_ARGS}" "${artifactRef}"
|
||||||
trivy --quiet ${scanType} --format template --template ${template} --output ${output} ${artifactRef}
|
trivy --quiet ${scanType} --format template --template ${template} --output ${output} $SARIF_ARGS ${artifactRef}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit $returnCode
|
exit $returnCode
|
||||||
|
|||||||
Reference in New Issue
Block a user