diff --git a/action.yaml b/action.yaml index f13a5aa..596b1e4 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' @@ -124,6 +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 }}' diff --git a/entrypoint.sh b/entrypoint.sh index 79fd708..c279b4e 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:w:x:y:z:" o; do case "${o}" in a) export scanType=${OPTARG} @@ -68,6 +68,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 v) export trivyConfig=${OPTARG} ;; + w) + export showSuppressed=${OPTARG} + ;; x) export tfVars=${OPTARG} ;; @@ -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")