From ff3ef0b8c07adc353720a470ebf0cb7a0821c189 Mon Sep 17 00:00:00 2001 From: Shubham Shah <82979155+ShubhamShah11@users.noreply.github.com> Date: Mon, 20 Sep 2021 19:11:23 -0400 Subject: [PATCH] Update check_extra7154 --- checks/check_extra7154 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"