Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aws): Add new RDS check for deletion protection enabled on clusters #4738

Conversation

danibarranqueroo
Copy link
Member

Context

This new check will verify that deletion protection is enabled for Amazon RDS DB clusters. Enabling deletion protection provides a critical safeguard against accidental or unauthorized deletions, ensuring that the clusters cannot be removed without explicitly disabling this setting first.

When you try to create a new RDS database, there is an option in the additional configuration that allows you to enable deletion protection with the following description: "Protects the database from being deleted accidentally. While this option is enabled, you can’t delete the database." This check verifies that every DB cluster has this option enabled.

Description

I added rds_cluster_deletion_protection with its respective unit test.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@danibarranqueroo danibarranqueroo requested review from a team as code owners August 14, 2024 09:03
@github-actions github-actions bot added the provider/aws Issues/PRs related with the AWS provider label Aug 14, 2024
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.11%. Comparing base (cb807e4) to head (e665361).
Report is 12 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4738      +/-   ##
==========================================
+ Coverage   89.06%   89.11%   +0.04%     
==========================================
  Files         914      921       +7     
  Lines       27970    28140     +170     
==========================================
+ Hits        24912    25077     +165     
- Misses       3058     3063       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

"RelatedUrl": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html",
"Remediation": {
"Code": {
"CLI": "aws rds modify-db-instance --db-instance-identifier <db_instance_id> --deletion-protection --apply-immediately",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, change the CLI command for the cluster one.

Copy link
Member

@MrCloudSec MrCloudSec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove the cluster logic from the check rds_instance_deletion_protection, what do you think?

@danibarranqueroo
Copy link
Member Author

Yes, good point. We can do it the same way we did in #4730

@MrCloudSec MrCloudSec force-pushed the PRWLR-4525-rds-clusters-should-have-deletion-protection-enabled branch from f397b7e to 36c1828 Compare August 20, 2024 12:30
Copy link
Member

@MrCloudSec MrCloudSec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏🏼

@MrCloudSec MrCloudSec merged commit 3f78fb4 into prowler-cloud:master Aug 20, 2024
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
provider/aws Issues/PRs related with the AWS provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants