mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-11 07:15:15 +00:00
22 lines
975 B
Plaintext
22 lines
975 B
Plaintext
CHECK_ID_check23="2.3,2.03"
|
|
CHECK_TITLE_check23="Ensure the S3 bucket CloudTrail logs to is not publicly accessible (Scored)"
|
|
CHECK_SCORED_check23="SCORED"
|
|
CHECK_ALTERNATE_check203="check23"
|
|
|
|
check23(){
|
|
# "Ensure the S3 bucket CloudTrail logs to is not publicly accessible (Scored)"
|
|
CLOUDTRAILBUCKET=$($AWSCLI cloudtrail describe-trails --query 'trailList[*].S3BucketName' --output text $PROFILE_OPT --region $REGION)
|
|
if [[ $CLOUDTRAILBUCKET ]];then
|
|
for bucket in $CLOUDTRAILBUCKET;do
|
|
CLOUDTRAILBUCKET_HASALLPERMISIONS=$($AWSCLI s3api get-bucket-acl --bucket $bucket --query 'Grants[?Grantee.URI==`http://acs.amazonaws.com/groups/global/AllUsers`]' $PROFILE_OPT --region $REGION --output text)
|
|
if [[ $CLOUDTRAILBUCKET_HASALLPERMISIONS ]];then
|
|
textFail "check your $bucket CloudTrail bucket ACL and Policy!"
|
|
else
|
|
textPass "Bucket $bucket is set correctly"
|
|
fi
|
|
done
|
|
else
|
|
textFail "No CloudTrail bucket found!"
|
|
fi
|
|
}
|