diff --git a/moto/config/resources/aws_managed_rules.json b/moto/config/resources/aws_managed_rules.json index 5d5a36f60..23382b78d 100644 --- a/moto/config/resources/aws_managed_rules.json +++ b/moto/config/resources/aws_managed_rules.json @@ -145,6 +145,22 @@ ], "Trigger type": "Configuration changes" }, + "AURORA_RESOURCES_PROTECTED_BY_BACKUP_PLAN": { + "AWS Region": "All supported AWS regions except China (Beijing), Africa (Cape Town), Asia Pacific (Osaka), Europe (Milan), AWS GovCloud (US-East), AWS GovCloud (US-West), US West (Oregon), and China (Ningxia) Region", + "Parameters": [ + { + "Name": "resourceTags", + "Optional": true, + "Type": "String" + }, + { + "Name": "resourceId", + "Optional": true, + "Type": "String" + } + ], + "Trigger type": "Periodic" + }, "AUTOSCALING_GROUP_ELB_HEALTHCHECK_REQUIRED": { "AWS Region": "All supported AWS regions", "Parameters": [], @@ -155,6 +171,58 @@ "Parameters": [], "Trigger type": "Configuration changes" }, + "BACKUP_PLAN_MIN_FREQUENCY_AND_MIN_RETENTION_CHECK": { + "AWS Region": "All supported AWS regions except China (Beijing), Africa (Cape Town), Asia Pacific (Osaka), Europe (Milan), AWS GovCloud (US-East), AWS GovCloud (US-West), US West (Oregon), and China (Ningxia) Region", + "Parameters": [ + { + "Default": "1", + "Name": "requiredFrequencyValue", + "Optional": true, + "Type": "int" + }, + { + "Default": "35", + "Name": "requiredRetentionDays", + "Optional": true, + "Type": "int" + }, + { + "Default": "days", + "Name": "requiredFrequencyUnit", + "Optional": true, + "Type": "String" + } + ], + "Trigger type": "Configuration changes" + }, + "BACKUP_RECOVERY_POINT_ENCRYPTED": { + "AWS Region": "All supported AWS regions except China (Beijing), Africa (Cape Town), Asia Pacific (Osaka), Europe (Milan), AWS GovCloud (US-East), AWS GovCloud (US-West), US West (Oregon), and China (Ningxia) Region", + "Parameters": [], + "Trigger type": "Configuration changes" + }, + "BACKUP_RECOVERY_POINT_MANUAL_DELETION_DISABLED": { + "AWS Region": "All supported AWS regions except China (Beijing), Africa (Cape Town), Asia Pacific (Osaka), Europe (Milan), AWS GovCloud (US-East), AWS GovCloud (US-West), US West (Oregon), and China (Ningxia) Region", + "Parameters": [ + { + "Name": "principalArnList", + "Optional": true, + "Type": "CSV" + } + ], + "Trigger type": "Configuration changes" + }, + "BACKUP_RECOVERY_POINT_MINIMUM_RETENTION_CHECK": { + "AWS Region": "All supported AWS regions except China (Beijing), Africa (Cape Town), Asia Pacific (Osaka), Europe (Milan), AWS GovCloud (US-East), AWS GovCloud (US-West), US West (Oregon), and China (Ningxia) Region", + "Parameters": [ + { + "Default": "35", + "Name": "requiredRetentionDays", + "Optional": true, + "Type": "int" + } + ], + "Trigger type": "Configuration changes" + }, "BEANSTALK_ENHANCED_HEALTH_REPORTING_ENABLED": { "AWS Region": "All supported AWS regions except China (Beijing), China (Ningxia), AWS GovCloud (US-East), AWS GovCloud (US-West), Asia Pacific (Osaka) Region", "Parameters": [], @@ -593,6 +661,22 @@ "Parameters": [], "Trigger type": "Configuration changes" }, + "DYNAMODB_RESOURCES_PROTECTED_BY_BACKUP_PLAN": { + "AWS Region": "All supported AWS regions except China (Beijing), Africa (Cape Town), Asia Pacific (Osaka), Europe (Milan), AWS GovCloud (US-East), AWS GovCloud (US-West), US West (Oregon), and China (Ningxia) Region", + "Parameters": [ + { + "Name": "resourceTags", + "Optional": true, + "Type": "String" + }, + { + "Name": "resourceId", + "Optional": true, + "Type": "String" + } + ], + "Trigger type": "Periodic" + }, "DYNAMODB_TABLE_ENCRYPTED_KMS": { "AWS Region": "All supported AWS regions except Asia Pacific (Osaka) Region", "Parameters": [ @@ -637,6 +721,22 @@ "Parameters": [], "Trigger type": "Configuration changes" }, + "EBS_RESOURCES_PROTECTED_BY_BACKUP_PLAN": { + "AWS Region": "All supported AWS regions except China (Beijing), Africa (Cape Town), Asia Pacific (Osaka), Europe (Milan), AWS GovCloud (US-East), AWS GovCloud (US-West), US West (Oregon), and China (Ningxia) Region", + "Parameters": [ + { + "Name": "resourceTags", + "Optional": true, + "Type": "String" + }, + { + "Name": "resourceId", + "Optional": true, + "Type": "String" + } + ], + "Trigger type": "Periodic" + }, "EBS_SNAPSHOT_PUBLIC_RESTORABLE_CHECK": { "AWS Region": "All supported AWS regions except Asia Pacific (Osaka) Region", "Parameters": [], @@ -773,6 +873,22 @@ ], "Trigger type": "Configuration changes" }, + "EC2_RESOURCES_PROTECTED_BY_BACKUP_PLAN": { + "AWS Region": "All supported AWS regions except China (Beijing), Africa (Cape Town), Asia Pacific (Osaka), Europe (Milan), AWS GovCloud (US-East), AWS GovCloud (US-West), US West (Oregon), and China (Ningxia) Region", + "Parameters": [ + { + "Name": "resourceTags", + "Optional": true, + "Type": "String" + }, + { + "Name": "resourceId", + "Optional": true, + "Type": "String" + } + ], + "Trigger type": "Periodic" + }, "EC2_SECURITY_GROUP_ATTACHED_TO_ENI": { "AWS Region": "All supported AWS regions except Asia Pacific (Osaka) Region", "Parameters": [], @@ -828,6 +944,22 @@ "Parameters": [], "Trigger type": "Periodic" }, + "EFS_RESOURCES_PROTECTED_BY_BACKUP_PLAN": { + "AWS Region": "All supported AWS regions except China (Beijing), Africa (Cape Town), Asia Pacific (Osaka), Europe (Milan), AWS GovCloud (US-East), AWS GovCloud (US-West), US West (Oregon), and China (Ningxia) Region", + "Parameters": [ + { + "Name": "resourceTags", + "Optional": true, + "Type": "String" + }, + { + "Name": "resourceId", + "Optional": true, + "Type": "String" + } + ], + "Trigger type": "Periodic" + }, "EIP_ATTACHED": { "AWS Region": "All supported AWS regions", "Parameters": [], @@ -1046,7 +1178,7 @@ "Trigger type": "Configuration changes" }, "FMS_WEBACL_RESOURCE_POLICY_CHECK": { - "AWS Region": "All supported AWS regions except China (Beijing), China (Ningxia) Region", + "AWS Region": "All supported AWS regions", "Parameters": [ { "Name": "webACLId", @@ -1077,7 +1209,7 @@ "Trigger type": "Configuration changes" }, "FMS_WEBACL_RULEGROUP_ASSOCIATION_CHECK": { - "AWS Region": "All supported AWS regions except China (Beijing), China (Ningxia) Region", + "AWS Region": "All supported AWS regions", "Parameters": [ { "Name": "ruleGroups", @@ -1097,6 +1229,22 @@ ], "Trigger type": "Configuration changes" }, + "FSX_RESOURCES_PROTECTED_BY_BACKUP_PLAN": { + "AWS Region": "All supported AWS regions except China (Beijing), Africa (Cape Town), Asia Pacific (Osaka), Europe (Milan), AWS GovCloud (US-East), AWS GovCloud (US-West), US West (Oregon), and China (Ningxia) Region", + "Parameters": [ + { + "Name": "resourceTags", + "Optional": true, + "Type": "String" + }, + { + "Name": "resourceId", + "Optional": true, + "Type": "String" + } + ], + "Trigger type": "Periodic" + }, "GUARDDUTY_ENABLED_CENTRALIZED": { "AWS Region": "All supported AWS regions except China (Beijing), China (Ningxia), AWS GovCloud (US-East), Asia Pacific (Osaka), Europe (Milan), Middle East (Bahrain), Africa (Cape Town) Region", "Parameters": [ @@ -1533,6 +1681,22 @@ "Parameters": [], "Trigger type": "Configuration changes" }, + "RDS_RESOURCES_PROTECTED_BY_BACKUP_PLAN": { + "AWS Region": "All supported AWS regions except China (Beijing), Africa (Cape Town), Asia Pacific (Osaka), Europe (Milan), AWS GovCloud (US-East), AWS GovCloud (US-West), US West (Oregon), and China (Ningxia) Region", + "Parameters": [ + { + "Name": "resourceTags", + "Optional": true, + "Type": "String" + }, + { + "Name": "resourceId", + "Optional": true, + "Type": "String" + } + ], + "Trigger type": "Periodic" + }, "RDS_SNAPSHOTS_PUBLIC_PROHIBITED": { "AWS Region": "All supported AWS regions except Asia Pacific (Osaka), Europe (Milan), Africa (Cape Town) Region", "Parameters": [], @@ -2064,7 +2228,7 @@ "Trigger type": "Configuration changes" }, "SSM_DOCUMENT_NOT_PUBLIC": { - "AWS Region": "All supported AWS regions except China (Beijing), China (Ningxia), AWS GovCloud (US-East), AWS GovCloud (US-West) Region", + "AWS Region": "All supported AWS regions", "Parameters": [], "Trigger type": "Periodic" }, diff --git a/scripts/pull_down_aws_managed_rules.py b/scripts/pull_down_aws_managed_rules.py index d0d8f2858..2846df783 100755 --- a/scripts/pull_down_aws_managed_rules.py +++ b/scripts/pull_down_aws_managed_rules.py @@ -40,17 +40,51 @@ AWS_MARKDOWN_URL_START = "https://raw.githubusercontent.com/awsdocs/aws-config-d LIST_OF_MARKDOWNS_URL = "managed-rules-by-aws-config.md" -def managed_rule_info(lines): +def extract_param_info(line): + """Return dict containing parameter info extracted from line.""" + # Examples of parameter definitions: + # maxAccessKeyAgeType: intDefault: 90 + # IgnorePublicAcls \(Optional\)Type: StringDefault: True + # MasterAccountId \(Optional\)Type: String + # endpointConfigurationTypesType: String + + values = re.split(r":\s?", line) + name = values[0] + param_type = values[1] + + # If there is no Optional keyword, then sometimes there + # isn't a space between the parameter name and "Type". + name = re.sub("Type$", "", name) + + # Sometimes there isn't a space between the type and the + # word "Default". + if "Default" in param_type: + param_type = re.sub("Default$", "", param_type) + + optional = False + if "Optional" in line: + optional = True + # Remove "Optional" from the line. + name = name.split()[0] + + param_info = { + "Name": name, + "Optional": optional, + "Type": param_type, + } + + # A default value isn't always provided. + if len(values) > 2: + param_info["Default"] = values[2] + + return param_info + + +def extract_managed_rule_info(lines): """Return dict of qualifiers/rules extracted from a markdown file.""" rule_info = {} label_pattern = re.compile(r"(?:\*\*)(?P