mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-11 07:15:15 +00:00
26 lines
1.1 KiB
Plaintext
26 lines
1.1 KiB
Plaintext
CHECK_ID_check122="1.22"
|
|
CHECK_TITLE_check122="[check122] Ensure a support role has been created to manage incidents with AWS Support (Scored)"
|
|
CHECK_SCORED_check122="SCORED"
|
|
CHECK_ALTERNATE_check122="check122"
|
|
|
|
check122(){
|
|
# "Ensure a support role has been created to manage incidents with AWS Support (Scored)"
|
|
SUPPORTPOLICYARN=$($AWSCLI iam list-policies --query "Policies[?PolicyName == 'AWSSupportAccess'].Arn" $PROFILE_OPT --region $REGION --output text)
|
|
if [[ $SUPPORTPOLICYARN ]];then
|
|
for policyarn in $SUPPORTPOLICYARN;do
|
|
POLICYUSERS=$($AWSCLI iam list-entities-for-policy --policy-arn $SUPPORTPOLICYARN $PROFILE_OPT --region $REGION --output json)
|
|
if [[ $POLICYUSERS ]];then
|
|
textPass "Support Policy attached to $policyarn"
|
|
for user in $(echo "$POLICYUSERS" | grep UserName | cut -d'"' -f4) ; do
|
|
textInfo "User $user has support access via $policyarn"
|
|
done
|
|
# textInfo "Make sure your team can create a Support case with AWS "
|
|
else
|
|
textFail "Support Policy not applied to any Group / User / Role "
|
|
fi
|
|
done
|
|
else
|
|
textFail "No Support Policy found"
|
|
fi
|
|
}
|