mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
41 lines
1.8 KiB
Bash
41 lines
1.8 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Prowler - the handy cloud security tool (c) by Toni de la Fuente
|
|
#
|
|
# This Prowler check is licensed under a
|
|
# Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
|
|
#
|
|
# You should have received a copy of the license along with this
|
|
# work. If not, see <http://creativecommons.org/licenses/by-nc-sa/4.0/>.
|
|
|
|
CHECK_ID_check25="2.5"
|
|
CHECK_TITLE_check25="[check25] Ensure AWS Config is enabled in all regions (Scored)"
|
|
CHECK_SCORED_check25="SCORED"
|
|
CHECK_TYPE_check25="LEVEL1"
|
|
CHECK_SEVERITY_check25="Medium"
|
|
CHECK_ASFF_TYPE_check25="Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark"
|
|
CHECK_ALTERNATE_check205="check25"
|
|
CHECK_ASFF_COMPLIANCE_TYPE_check25="ens-op.exp.1.aws.cfg.1"
|
|
CHECK_SERVICENAME_check25="configservice"
|
|
|
|
check25(){
|
|
# "Ensure AWS Config is enabled in all regions (Scored)"
|
|
for regx in $REGIONS; do
|
|
CHECK_AWSCONFIG_RECORDING=$($AWSCLI configservice describe-configuration-recorder-status $PROFILE_OPT --region $regx --query 'ConfigurationRecordersStatus[*].recording' --output text 2>&1)
|
|
CHECK_AWSCONFIG_STATUS=$($AWSCLI configservice describe-configuration-recorder-status $PROFILE_OPT --region $regx --query 'ConfigurationRecordersStatus[*].lastStatus' --output text 2>&1)
|
|
if [[ $(echo "$CHECK_AWSCONFIG_STATUS" | grep AccessDenied) ]]; then
|
|
textFail "Access Denied trying to describe configuration recorder status in $regx"
|
|
continue
|
|
fi
|
|
if [[ $CHECK_AWSCONFIG_RECORDING == "True" ]]; then
|
|
if [[ $CHECK_AWSCONFIG_STATUS == "SUCCESS" ]]; then
|
|
textPass "Region $regx AWS Config recorder enabled"
|
|
else
|
|
textFail "Region $regx AWS Config recorder in failure state"
|
|
fi
|
|
else
|
|
textFail "Region $regx AWS Config recorder disabled"
|
|
fi
|
|
done
|
|
}
|