File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed
Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 66 - name : " TFSec Scan - Components"
77 shell : bash
88 run : |
9- for component in $(find infrastructure/terraform/components -mindepth 1 -type d); do
10- scripts/terraform/tfsec.sh $component
11- done
12- - name : " TFSec Scan - Modules"
13- shell : bash
14- run : |
15- for module in $(find infrastructure/terraform/modules -mindepth 1 -type d); do
16- scripts/terraform/tfsec.sh $module
17- done
9+ components_exit_code=0
10+ modules_exit_code=0
11+
12+ ./scripts/terraform/tfsec.sh ./infrastructure/terraform/components || components_exit_code=$?
13+ ./scripts/terraform/tfsec.sh ./infrastructure/terraform/modules || modules_exit_code=$?
14+
15+ if [ $components_exit_code -ne 0 ] || [ $modules_exit_code -ne 0 ]; then
16+ echo "One or more TFSec scans failed."
17+ exit 1
18+ fi
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ terraform-sec: # TFSEC check against Terraform files - optional: terraform_dir|d
6161 --exclude-downloaded-modules \
6262 --tfvars-file infrastructure/terraform/etc/global.tfvars \
6363 --tfvars-file infrastructure/terraform/etc/env_eu-west-2_main.tfvars \
64- --config-file scripts/config/tfsec.yml
64+ --config-file scripts/config/tfsec.yaml
6565
6666# ==============================================================================
6767# Module tests and examples - please DO NOT edit this section!
Original file line number Diff line number Diff line change @@ -37,12 +37,10 @@ function run-tfsec-natively() {
3737
3838 echo " Running TFSec on directory: $dir_to_scan "
3939 tfsec \
40- --concise-output \
4140 --force-all-dirs \
4241 --exclude-downloaded-modules \
4342 --config-file scripts/config/tfsec.yaml \
4443 --format text \
45- --soft-fail \
4644 " $dir_to_scan "
4745
4846 check-tfsec-status
You can’t perform that action at this time.
0 commit comments