mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
fixed and improved check27
This commit is contained in:
@@ -16,17 +16,15 @@ 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
|
||||
textPass "KMS key found for $trail"
|
||||
$AWSCLI cloudtrail describe-trails --query 'trailList[].[Name,KmsKeyId]' --output text $PROFILE_OPT --region $REGION | while read trail key; do
|
||||
if [[ "$trail" ]] ; then
|
||||
if [[ "$key" != "None" ]] ; then
|
||||
textPass "KMS key found for $trail"
|
||||
else
|
||||
textFail "encryption is not enabled in your CloudTrail trail $trail (KMS key not found)!"
|
||||
textFail "Encryption is not enabled in your CloudTrail trail $trail (KMS key not found)!"
|
||||
fi
|
||||
done
|
||||
else
|
||||
textFail "CloudTrail bucket doesn't exist!"
|
||||
textFail "CloudTrail bucket doesn't exist!"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user