From 63898690c8f785ee37dd89ce2db7f524e26f64fd Mon Sep 17 00:00:00 2001 From: gabrielsoltz Date: Thu, 24 Oct 2019 13:25:18 +0200 Subject: [PATCH] remove_old_check --- checks/check_extra727 | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/checks/check_extra727 b/checks/check_extra727 index ab8e4daf..b8bf354f 100644 --- a/checks/check_extra727 +++ b/checks/check_extra727 @@ -47,36 +47,4 @@ extra727(){ textInfo "$regx: No SQS queues found" "$regx" fi done - - - - - - - - - - - for regx in $REGIONS; do - LIST_SQS=$($AWSCLI sqs list-queues $PROFILE_OPT --region $regx --query QueueUrls --output text |grep -v ^None) - if [[ $LIST_SQS ]]; then - for queue in $LIST_SQS; do - # check if the policy has Principal as * - SQS_TO_CHECK=$($AWSCLI sqs get-queue-attributes --queue-url $queue $PROFILE_OPT --region $regx --attribute-names All --query Attributes.Policy --output text | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | awk '/Principal/ || /Condition/ && !skip { print } { skip = /Deny/} ') - PUBLIC_SQS_WCONDITION=$(echo $SQS_TO_CHECK|grep Condition) - if [[ $PUBLIC_SQS_WCONDITION ]]; then - textPass "$regx: SQS queue $queue has a Condition" "$regx" - else - PUBLIC_SQS=$(echo $SQS_TO_CHECK|grep \"Principal|grep \*) - if [[ $PUBLIC_SQS ]]; then - textFail "$regx: SQS queue $queue seems to be public (Principal: \"*\")" "$regx" - else - textPass "$regx: SQS queue $queue seems correct" "$regx" - fi - fi - done - else - textInfo "$regx: No SQS queues found" "$regx" - fi - done }