From 7b6f168d8ce9b2e24a5eef9a1e4f6e1ba6bd1bbb Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Thu, 6 Jul 2017 14:14:57 -0500 Subject: [PATCH] update output for check 1.22 to handle multiple users --- prowler | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/prowler b/prowler index d623447b..7fa5f15b 100755 --- a/prowler +++ b/prowler @@ -733,10 +733,13 @@ check122(){ SUPPORTPOLICYARN=$($AWSCLI iam list-policies --query "Policies[?PolicyName == 'AWSSupportAccess'].Arn" --profile $PROFILE --region $REGION --output text) if [[ $SUPPORTPOLICYARN ]];then for policyarn in $SUPPORTPOLICYARN;do - POLICYTOSHOW=$($AWSCLI iam list-entities-for-policy --policy-arn $SUPPORTPOLICYARN --profile $PROFILE --region $REGION --output text) - if [[ $POLICYTOSHOW ]];then - textOK "Support Policy attached to $POLICYTOSHOW" - textNotice "Make sure your team can create a Support case with AWS " + POLICYUSERS=$($AWSCLI iam list-entities-for-policy --policy-arn $SUPPORTPOLICYARN --profile $PROFILE --region $REGION --output json) + if [[ $POLICYUSERS ]];then + textOK "Support Policy attached to $policyarn" + for user in $(echo "$POLICYUSERS" | grep UserName | cut -d'"' -f4) ; do + textNotice "User $user has support access via $policyarn" + done + # textNotice "Make sure your team can create a Support case with AWS " else textWarn "Support Policy not applied to any Group / User / Role " fi