diff --git a/checks/check_extra7154 b/checks/check_extra7154 index eb571303..c44787c1 100644 --- a/checks/check_extra7154 +++ b/checks/check_extra7154 @@ -39,8 +39,8 @@ extra7154() { if [[ $LIST_OF_CFN_STACKS ]];then for stack in $LIST_OF_CFN_STACKS; do CFN_STACK_DETAILS=$($AWSCLI cloudformation describe-stacks $PROFILE_OPT --region $regx --stack-name $stack --output json) - TERMINATION_ENABLED=echo $CFN_STACK_DETAILS | jq -r '.Stacks[] | select( .EnableTerminationProtection == true )' - if [[ $TERMINATION_ENABLED ]]; then + TERMINATION_ENABLED=$(echo $CFN_STACK_DETAILS | jq -r '.Stacks[].EnableTerminationProtection') + if [[ $TERMINATION_ENABLED == "true" ]]; then textPass "$regx: Cloudformation stack $stack has termination protection enabled" "$regx" "$stack" else textFail "$regx: Cloudformation stack $stack has termination protection disabled" "$regx" "$stack"