mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
22 lines
928 B
Plaintext
22 lines
928 B
Plaintext
CHECK_ID_extra718="7.18"
|
|
CHECK_TITLE_extra718="Check if S3 buckets have server access logging enabled (Not Scored) (Not part of CIS benchmark)"
|
|
CHECK_SCORED_extra718="NOT_SCORED"
|
|
CHECK_ALTERNATE_check718="extra718"
|
|
|
|
extra718(){
|
|
# "Check if S3 buckets have server access logging enabled (Not Scored) (Not part of CIS benchmark)"
|
|
LIST_OF_BUCKETS=$($AWSCLI s3api list-buckets $PROFILE_OPT --query Buckets[*].Name --output text|xargs -n1)
|
|
if [[ $LIST_OF_BUCKETS ]]; then
|
|
for bucket in $LIST_OF_BUCKETS;do
|
|
BUCKET_SERVER_LOG_ENABLED=$($AWSCLI s3api get-bucket-logging --bucket $bucket $PROFILE_OPT --query [LoggingEnabled] --output text|grep -v "^None$")
|
|
if [[ $BUCKET_SERVER_LOG_ENABLED ]];then
|
|
textOK "Bucket $bucket has server access logging enabled"
|
|
else
|
|
textWarn "Bucket $bucket has server access logging disabled!"
|
|
fi
|
|
done
|
|
else
|
|
textNotice "No S3 Buckets found"
|
|
fi
|
|
}
|