mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
fix(rds checks): test if key exists prior checking it (#2489)
This commit is contained in:
@@ -13,7 +13,12 @@ class rds_instance_deletion_protection(Check):
|
||||
report.resource_tags = db_instance.tags
|
||||
# Check if is member of a cluster
|
||||
if db_instance.cluster_id:
|
||||
if rds_client.db_clusters[db_instance.cluster_arn].deletion_protection:
|
||||
if (
|
||||
db_instance.cluster_arn in rds_client.db_clusters
|
||||
and rds_client.db_clusters[
|
||||
db_instance.cluster_arn
|
||||
].deletion_protection
|
||||
):
|
||||
report.status = "PASS"
|
||||
report.status_extended = f"RDS Instance {db_instance.id} deletion protection is enabled at cluster {db_instance.cluster_id} level."
|
||||
else:
|
||||
|
||||
@@ -13,7 +13,10 @@ class rds_instance_multi_az(Check):
|
||||
report.resource_tags = db_instance.tags
|
||||
# Check if is member of a cluster
|
||||
if db_instance.cluster_id:
|
||||
if rds_client.db_clusters[db_instance.cluster_arn].multi_az:
|
||||
if (
|
||||
db_instance.cluster_arn in rds_client.db_clusters
|
||||
and rds_client.db_clusters[db_instance.cluster_arn].multi_az
|
||||
):
|
||||
report.status = "PASS"
|
||||
report.status_extended = f"RDS Instance {db_instance.id} has multi-AZ enabled at cluster {db_instance.cluster_id} level."
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user