Rollback #562 fix issue #564

This commit is contained in:
Toni de la Fuente
2020-04-22 10:31:30 +02:00
parent d6374f8bc8
commit 92091d9ecd

View File

@@ -16,18 +16,13 @@ CHECK_SCORED_extra712="NOT_SCORED"
CHECK_TYPE_extra712="EXTRA" CHECK_TYPE_extra712="EXTRA"
CHECK_ALTERNATE_check712="extra712" CHECK_ALTERNATE_check712="extra712"
extra712(){ extra712(){
# "Check if Amazon Macie is enabled (Not Scored) (Not part of CIS benchmark)" textInfo "No API commands available to check if Macie is enabled,"
MACIE_NOT_SUPPORTED="Could not connect to the endpoint URL" textInfo "just looking if IAM Macie related permissions exist. "
MACIE_NOT_ENABLED="Macie is not enabled for this AWS account" MACIE_IAM_ROLES_CREATED=$($AWSCLI iam list-roles $PROFILE_OPT --query 'Roles[*].Arn'|grep AWSMacieServiceCustomer|wc -l)
for regx in $REGIONS; do if [[ $MACIE_IAM_ROLES_CREATED -eq 2 ]];then
MACIE_MEMBER_ACCOUNTS=$($AWSCLI macie list-member-accounts $PROFILE_OPT --region $regx --output text --query 'memberAccounts[*]' 2>&1) textPass "Macie related IAM roles exist so it might be enabled. Check it out manually"
if [[ ${MACIE_MEMBER_ACCOUNTS} == *${MACIE_NOT_SUPPORTED}* ]];then else
textInfo "$regx: Amazon Macie is not supported in $regx" "$regx" textFail "No Macie related IAM roles found. It is most likely not to be enabled"
elif [[ ${MACIE_MEMBER_ACCOUNTS} == *${MACIE_NOT_ENABLED}* ]];then fi
textFail "$regx: Amazon Macie is not enabled!" "$regx"
else
textPass "$regx: Amazon Macie is enabled!" "$regx"
fi
done
} }