mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-11 23:35:07 +00:00
Added check extra718 bucket server access logging
This commit is contained in:
27
prowler
27
prowler
@@ -502,6 +502,8 @@ ID716="7.16,7.16"
|
||||
TITLE716="Check if Elasticsearch Service domains allow open access (Not Scored) (Not part of CIS benchmark)"
|
||||
ID717="7.17,7.17"
|
||||
TITLE717="Check if Elastic Load Balancers have logging enabled (Not Scored) (Not part of CIS benchmark)"
|
||||
ID718="7.18,7.18"
|
||||
TITLE718="Check if S3 buckets have server access logging enabled (Not Scored) (Not part of CIS benchmark)"
|
||||
|
||||
printCsvHeader() {
|
||||
>&2 echo ""
|
||||
@@ -2009,6 +2011,24 @@ extra717(){
|
||||
done
|
||||
}
|
||||
|
||||
extra718(){
|
||||
# "Check if S3 buckets have server access logging enabled (Not Scored) (Not part of CIS benchmark)"
|
||||
textTitle "$ID718" "$TITLE718" "NOT_SCORED" "EXTRA"
|
||||
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
|
||||
}
|
||||
|
||||
callCheck(){
|
||||
if [[ $CHECKNUMBER ]];then
|
||||
case "$CHECKNUMBER" in
|
||||
@@ -2081,6 +2101,7 @@ callCheck(){
|
||||
extra715|extra715 ) extra715;;
|
||||
extra716|extra716 ) extra716;;
|
||||
extra717|extra717 ) extra717;;
|
||||
extra718|extra718 ) extra718;;
|
||||
|
||||
## Groups of Checks
|
||||
check1 )
|
||||
@@ -2118,12 +2139,12 @@ callCheck(){
|
||||
extras )
|
||||
extra71;extra72;extra73;extra74;extra75;extra76;extra77;extra78;
|
||||
extra79;extra710;extra711;extra712;extra713;extra714;extra715;extra716;
|
||||
extra717
|
||||
extra717;extra718
|
||||
;;
|
||||
forensics-ready )
|
||||
check21;check22;check23;check24;check25;check26;check27;
|
||||
check43;
|
||||
extra712;extra713;extra714;extra715;extra717
|
||||
extra712;extra713;extra714;extra715;extra717;extra718
|
||||
;;
|
||||
* )
|
||||
textWarn "ERROR! Use a valid check name (i.e. check41 or extra71)\n";
|
||||
@@ -2211,6 +2232,7 @@ if [[ $PRINTCHECKSONLY == "1" ]]; then
|
||||
textTitle "$ID715" "$TITLE715" "NOT_SCORED" "EXTRA"
|
||||
textTitle "$ID716" "$TITLE716" "NOT_SCORED" "EXTRA"
|
||||
textTitle "$ID717" "$TITLE717" "NOT_SCORED" "EXTRA"
|
||||
textTitle "$ID718" "$TITLE718" "NOT_SCORED" "EXTRA"
|
||||
exit $EXITCODE
|
||||
fi
|
||||
|
||||
@@ -2304,6 +2326,7 @@ extra714
|
||||
extra715
|
||||
extra716
|
||||
extra717
|
||||
extra718
|
||||
|
||||
cleanTemp
|
||||
exit $EXITCODE
|
||||
|
||||
Reference in New Issue
Block a user