Skip to content

Commit

Permalink
List successful cases as PASS! for 7.27
Browse files Browse the repository at this point in the history
Fixes #373
  • Loading branch information
Tobi Fuhrimann committed Aug 23, 2019
1 parent de5b87c commit 49994d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions checks/check_extra727
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ extra727(){
# 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
textInfo "$regx: SQS queue $queue has a Condition" "$regx"
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
textInfo "$regx: SQS queue $queue seems correct" "$regx"
textPass "$regx: SQS queue $queue seems correct" "$regx"
fi
fi
done
Expand Down

0 comments on commit 49994d1

Please sign in to comment.