From d2f4601b1245a4c6c17cacc89ee965dbaadffd1f Mon Sep 17 00:00:00 2001 From: Damian Bisignano Date: Fri, 19 Jul 2024 14:06:02 +1000 Subject: [PATCH 1/3] fix: add show suppressed --- action.yaml | 6 ++++++ entrypoint.sh | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index f13a5aa..9253095 100644 --- a/action.yaml +++ b/action.yaml @@ -97,6 +97,11 @@ inputs: docker-host: description: 'unix domain socket path to use for docker scanning, ex. unix:///var/run/docker.sock' required: false + show-suppressed: + description: 'show the suppressed results' + required: false + default: 'false' + runs: using: 'docker' @@ -127,3 +132,4 @@ runs: - '-x ${{ inputs.tf-vars }}' - '-z ${{ inputs.limit-severities-for-sarif }}' - '-y ${{ inputs.docker-host }}' + - '-aa ${{ inputs.show-suppressed }}' diff --git a/entrypoint.sh b/entrypoint.sh index 79fd708..5a3d2b2 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/bash set -e -while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:x:y:z:" o; do +while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:x:y:z:aa:" o; do case "${o}" in a) export scanType=${OPTARG} @@ -77,6 +77,9 @@ while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:x:y:z:" o; do z) export limitSeveritiesForSARIF=${OPTARG} ;; + aa) + export showSuppressed=${OPTARG} + ;; esac done @@ -94,6 +97,7 @@ fi ignoreUnfixed=$(echo $ignoreUnfixed | tr -d '\r') hideProgress=$(echo $hideProgress | tr -d '\r') limitSeveritiesForSARIF=$(echo $limitSeveritiesForSARIF | tr -d '\r') +showSuppressed=$(echo $showSuppressed | tr -d '\r') GLOBAL_ARGS="" if [ $cacheDir ];then @@ -141,6 +145,9 @@ fi if [ $tfVars ] && [ "$scanType" == "config" ];then ARGS="$ARGS --tf-vars $tfVars" fi +if [ "$showSuppressed" == "true" ] ;then + ARGS="$ARGS --show-suppressed" +fi if [ $trivyIgnores ];then for f in $(echo $trivyIgnores | tr "," "\n") From 19e2468b9ae025fc72bdc792cb242ef267238674 Mon Sep 17 00:00:00 2001 From: Damian Bisignano Date: Fri, 19 Jul 2024 14:25:46 +1000 Subject: [PATCH 2/3] fix --- entrypoint.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 5a3d2b2..f7453f3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,7 +1,10 @@ #!/bin/bash set -e -while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:x:y:z:aa:" o; do +while getopts "aa:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:x:y:z:" o; do case "${o}" in + aa) + export showSuppressed=${OPTARG} + ;; a) export scanType=${OPTARG} ;; @@ -77,9 +80,6 @@ while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:x:y:z:aa:" o; do z) export limitSeveritiesForSARIF=${OPTARG} ;; - aa) - export showSuppressed=${OPTARG} - ;; esac done From a62318a93fde6c6bb652706a756720c85b514694 Mon Sep 17 00:00:00 2001 From: Damian Bisignano Date: Fri, 19 Jul 2024 14:59:33 +1000 Subject: [PATCH 3/3] fix: use w --- action.yaml | 2 +- entrypoint.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/action.yaml b/action.yaml index 9253095..596b1e4 100644 --- a/action.yaml +++ b/action.yaml @@ -129,7 +129,7 @@ runs: - '-t ${{ inputs.trivyignores }}' - '-u ${{ inputs.github-pat }}' - '-v ${{ inputs.trivy-config }}' + - '-w ${{ inputs.show-suppressed }}' - '-x ${{ inputs.tf-vars }}' - '-z ${{ inputs.limit-severities-for-sarif }}' - '-y ${{ inputs.docker-host }}' - - '-aa ${{ inputs.show-suppressed }}' diff --git a/entrypoint.sh b/entrypoint.sh index f7453f3..c279b4e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,10 +1,7 @@ #!/bin/bash set -e -while getopts "aa:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:x:y:z:" o; do +while getopts "a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z:" o; do case "${o}" in - aa) - export showSuppressed=${OPTARG} - ;; a) export scanType=${OPTARG} ;; @@ -71,6 +68,9 @@ while getopts "aa:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:x:y:z:" o; do v) export trivyConfig=${OPTARG} ;; + w) + export showSuppressed=${OPTARG} + ;; x) export tfVars=${OPTARG} ;; @@ -145,7 +145,7 @@ fi if [ $tfVars ] && [ "$scanType" == "config" ];then ARGS="$ARGS --tf-vars $tfVars" fi -if [ "$showSuppressed" == "true" ] ;then +if [ "$showSuppressed" == "true" ];then ARGS="$ARGS --show-suppressed" fi