mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
22 lines
922 B
Plaintext
22 lines
922 B
Plaintext
CHECK_ID_check27="2.7,2.07"
|
|
CHECK_TITLE_check27="Ensure CloudTrail logs are encrypted at rest using KMS CMKs (Scored)"
|
|
CHECK_SCORED_check27="SCORED"
|
|
CHECK_ALTERNATE_check207="check27"
|
|
|
|
check27(){
|
|
# "Ensure CloudTrail logs are encrypted at rest using KMS CMKs (Scored)"
|
|
CLOUDTRAILNAME=$($AWSCLI cloudtrail describe-trails --query 'trailList[*].Name' --output text $PROFILE_OPT --region $REGION)
|
|
if [[ $CLOUDTRAILNAME ]];then
|
|
for trail in $CLOUDTRAILNAME;do
|
|
CLOUDTRAILENC_ENABLED=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $REGION --trail $trail --query 'trailList[*].KmsKeyId' --output text)
|
|
if [[ $CLOUDTRAILENC_ENABLED ]];then
|
|
textOK "KMS key found for $trail"
|
|
else
|
|
textWarn "encryption is not enabled in your CloudTrail trail $trail (KMS key not found)!"
|
|
fi
|
|
done
|
|
else
|
|
textWarn "CloudTrail bucket doesn't exist!"
|
|
fi
|
|
}
|