diff --git a/README.md b/README.md index 6be77a7..d26b0aa 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,9 @@ The action will only warn and not error when violations are found. ### `sarif_upload` If this variable is included, a sarif file named terrascan.sarif will be generated with the results of the scan. +### `verbose` +If this variable is included, the scan will show violations with additional details (Rule Name/ID, Resource Name/Type, Violation Category) + ## Example usage ```yaml @@ -52,6 +55,7 @@ jobs: iac_version: 'v14' policy_type: 'aws' only_warn: true + verbose: true #sarif_upload: true #non_recursive: #iac_dir: diff --git a/action.yml b/action.yml index cf25b69..2aa5cea 100644 --- a/action.yml +++ b/action.yml @@ -32,6 +32,9 @@ inputs: sarif_upload: description: 'if true a sarif file named terrascan.sarif will be generated with the results of the scan' required: false + verbose: + description: ' will show violations with additional details (applicable for default output)' + required: false runs: using: 'docker' image: 'Dockerfile' @@ -46,6 +49,8 @@ runs: - ${{ inputs.config_path }} - ${{ inputs.only_warn }} - ${{ inputs.sarif_upload }} + - ${{ inputs.verbose }} + branding: icon: 'code' color: 'blue' diff --git a/entrypoint.sh b/entrypoint.sh index aba648f..8237fd4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -11,6 +11,8 @@ echo "INPUT_POLICY_PATH=${INPUT_POLICY_PATH}" echo "INPUT_SKIP_RULES=${INPUT_SKIP_RULES}" echo "INPUT_CONFIG_PATH=${INPUT_CONFIG_PATH}" echo "INPUT_SARIF_UPLOAD=${INPUT_SARIF_UPLOAD}" +echo "INPUT_VERBOSE=${INPUT_VERBOSE}" + # Creating arguments for terrascan args="" @@ -38,7 +40,9 @@ fi if [ "x${INPUT_CONFIG_PATH}" != "x" ]; then args="${args} -c ${INPUT_CONFIG_PATH}" fi - +if [ ${INPUT_VERBOSE} == true ]; then + args="${args} -v" +fi # Executing terrascan echo "Executing terrascan as follows:" echo "terrascan scan ${args}"