mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-13 00:05:04 +00:00
populated checks
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
CHECK_ID_check28=""
|
||||
CHECK_TITLE_check28=""
|
||||
CHECK_SCORED_check28=""
|
||||
CHECK_TYPE_check28=""
|
||||
CHECK_ALTERNATE_check28="check28"
|
||||
|
||||
check28(){
|
||||
# "Ensure rotation for customer created CMKs is enabled (Scored)"
|
||||
textTitle "$ID28" "$TITLE28" "SCORED" "LEVEL2"
|
||||
for regx in $REGIONS; do
|
||||
CHECK_KMS_KEYLIST=$($AWSCLI kms list-keys $PROFILE_OPT --region $regx --output text --query 'Keys[*].KeyId')
|
||||
if [[ $CHECK_KMS_KEYLIST ]];then
|
||||
CHECK_KMS_KEYLIST_NO_DEFAULT=$(for key in $CHECK_KMS_KEYLIST ; do $AWSCLI kms describe-key --key-id $key $PROFILE_OPT --region $regx --output text --query 'KeyMetadata.[KeyId, KeyManager]'|grep -v 'AWS'|awk '{ print $1 }'; done)
|
||||
for key in $CHECK_KMS_KEYLIST_NO_DEFAULT; do
|
||||
CHECK_KMS_KEY_TYPE=$($AWSCLI kms describe-key --key-id $key $PROFILE_OPT --region $regx --query 'KeyMetadata.Origin' | sed 's/["]//g')
|
||||
if [[ "$CHECK_KMS_KEY_TYPE" == "EXTERNAL" ]];then
|
||||
textOK "Key $key in Region $regx Customer Uploaded Key Material." "$regx"
|
||||
else
|
||||
CHECK_KMS_KEY_ROTATION=$($AWSCLI kms get-key-rotation-status --key-id $key $PROFILE_OPT --region $regx --output text)
|
||||
if [[ "$CHECK_KMS_KEY_ROTATION" == "True" ]];then
|
||||
textOK "Key $key in Region $regx is set correctly"
|
||||
else
|
||||
textWarn "Key $key in Region $regx is not set to rotate!!!" "$regx"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
else
|
||||
textNotice "Region $regx doesn't have encryption keys" "$regx"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user