mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 23:05:05 +00:00
Fixed issue #247
This commit is contained in:
@@ -23,11 +23,17 @@ extra727(){
|
||||
if [[ $LIST_SQS ]]; then
|
||||
for queue in $LIST_SQS; do
|
||||
# check if the policy has Principal as *
|
||||
PUBLIC_SQS=$($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/ && !skip { print } { skip = /Deny/} '|grep \"Principal|grep \*)
|
||||
if [[ $PUBLIC_SQS ]]; then
|
||||
textFail "$regx: SQS queue $queue seems to be public (Principal: \"*\")" "$regx"
|
||||
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"
|
||||
else
|
||||
textInfo "$regx: SQS queue $queue seems correct" "$regx"
|
||||
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"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user