mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-11 15:25:10 +00:00
22 lines
942 B
Plaintext
22 lines
942 B
Plaintext
CHECK_ID_check22="2.2,2.02"
|
|
CHECK_TITLE_check22="Ensure CloudTrail log file validation is enabled (Scored)"
|
|
CHECK_SCORED_check22="SCORED"
|
|
CHECK_ALTERNATE_check202="check22"
|
|
|
|
check22(){
|
|
# "Ensure CloudTrail log file validation is enabled (Scored)"
|
|
LIST_OF_TRAILS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $REGION --query 'trailList[*].Name' --output text)
|
|
if [[ $LIST_OF_TRAILS ]];then
|
|
for trail in $LIST_OF_TRAILS;do
|
|
LOGFILEVALIDATION_TRAIL_STATUS=$($AWSCLI cloudtrail describe-trails $PROFILE_OPT --region $REGION --query 'trailList[*].LogFileValidationEnabled' --output text --trail-name-list $trail)
|
|
if [[ "$LOGFILEVALIDATION_TRAIL_STATUS" == 'False' ]];then
|
|
textFail "$trail trail in $REGION has not log file validation enabled"
|
|
else
|
|
textPass "$trail trail in $REGION has log file validation enabled"
|
|
fi
|
|
done
|
|
else
|
|
textFail "No CloudTrail trails found!"
|
|
fi
|
|
}
|