-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(backport): master changes to v4.5 branch (#5641)
Co-authored-by: sansns-aws <[email protected]> Co-authored-by: Pepe Fagoaga <[email protected]>
- Loading branch information
1 parent
9802fc1
commit d84d0e7
Showing
20 changed files
with
535 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
32 changes: 32 additions & 0 deletions
32
...s/rds_cluster_protected_by_backup_plan/rds_cluster_protected_by_backup_plan.metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"Provider": "aws", | ||
"CheckID": "rds_cluster_protected_by_backup_plan", | ||
"CheckTitle": "Check if RDS clusters are protected by a backup plan.", | ||
"CheckType": [ | ||
"Software and Configuration Checks, AWS Security Best Practices" | ||
], | ||
"ServiceName": "rds", | ||
"SubServiceName": "", | ||
"ResourceIdTemplate": "arn:aws:rds:region:account-id:db-cluster", | ||
"Severity": "medium", | ||
"ResourceType": "AwsRdsDbInstance", | ||
"Description": "Check if RDS clusters are protected by a backup plan.", | ||
"Risk": "Without a backup plan, RDS clusters are vulnerable to data loss, accidental deletion, or corruption. This could lead to significant operational disruptions or loss of critical data.", | ||
"RelatedUrl": "https://docs.aws.amazon.com/aws-backup/latest/devguide/assigning-resources.html", | ||
"Remediation": { | ||
"Code": { | ||
"CLI": "aws backup create-backup-plan --backup-plan , aws backup tag-resource --resource-arn <rds-cluster-arn> --tags Key=backup,Value=true", | ||
"NativeIaC": "", | ||
"Other": "https://docs.aws.amazon.com/securityhub/latest/userguide/rds-controls.html#rds-26", | ||
"Terraform": "" | ||
}, | ||
"Recommendation": { | ||
"Text": "Create a backup plan for the RDS cluster to protect it from data loss, accidental deletion, or corruption.", | ||
"Url": "https://docs.aws.amazon.com/aws-backup/latest/devguide/assigning-resources.html" | ||
} | ||
}, | ||
"Categories": [], | ||
"DependsOn": [], | ||
"RelatedTo": [], | ||
"Notes": "" | ||
} |
33 changes: 33 additions & 0 deletions
33
...services/rds/rds_cluster_protected_by_backup_plan/rds_cluster_protected_by_backup_plan.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from prowler.lib.check.models import Check, Check_Report_AWS | ||
from prowler.providers.aws.services.backup.backup_client import backup_client | ||
from prowler.providers.aws.services.rds.rds_client import rds_client | ||
|
||
|
||
class rds_cluster_protected_by_backup_plan(Check): | ||
def execute(self): | ||
findings = [] | ||
for db_cluster_arn, db_cluster in rds_client.db_clusters.items(): | ||
report = Check_Report_AWS(self.metadata()) | ||
report.region = db_cluster.region | ||
report.resource_id = db_cluster.id | ||
report.resource_arn = db_cluster_arn | ||
report.resource_tags = db_cluster.tags | ||
report.status = "FAIL" | ||
report.status_extended = ( | ||
f"RDS Cluster {db_cluster.id} is not protected by a backup plan." | ||
) | ||
|
||
if ( | ||
db_cluster_arn in backup_client.protected_resources | ||
or f"arn:{rds_client.audited_partition}:rds:*:*:cluster:*" | ||
in backup_client.protected_resources | ||
or "*" in backup_client.protected_resources | ||
): | ||
report.status = "PASS" | ||
report.status_extended = ( | ||
f"RDS Cluster {db_cluster.id} is protected by a backup plan." | ||
) | ||
|
||
findings.append(report) | ||
|
||
return findings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.