-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix(rds): add ReadReplicaSourceDBInstanceIdentifier to db_instance #3912
fix(rds): add ReadReplicaSourceDBInstanceIdentifier to db_instance #3912
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great @uridealo! I think you are planning to use this in an upcoming check or maybe to improve/fix something, am I right?
@jfagoagas yes, i wrote a customized check on the basis of rds_instance_backup_enabled to skip replica instances. |
Are you planning to make a PR with that? Could be interesting to include a flag in the configuration to check that instances whether the value is set or not.
I think you have to configure your local development environment following this guide in our documentation. You have to enable the |
@jfagoagas i committed the customized check but not sure if its worth. Its very close to rds_instance_backup_enabled and would be better to have it as an option for this. But i don't know how to do so. Let me know what think about the check. I followed the guide but i still don't understand the error message. Maybe i start from scratch. |
I think it would be better to adjust that check, let me push some changes and I'll get back to you.
|
Hi @uridealo, I've pushed a new version using the Prowler configuration file with a new |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3912 +/- ##
==========================================
+ Coverage 86.32% 86.40% +0.08%
==========================================
Files 748 749 +1
Lines 23295 23389 +94
==========================================
+ Hits 20110 20210 +100
+ Misses 3185 3179 -6 ☔ View full report in Codecov by Sentry. |
@jfagoagas @uridealo why we have only done this for this check? It would be interesting to add this logic for the rest of RDS Instance checks. |
I think for know we should apply this to the instance backups and then analyze if this can be included in other checks. |
@jfagoagas i tested your changes. ImO the logic is weird. I only skip replicas when check_rds_replicas is NOT set in config. When leaving out "True" in rds_instance_backup_enabled.py:24 i can control the skipping via True/False in config. Do i see something wrong? |
I don't get that. Currently the logic does the following: if db_instance.replica_source and not rds_client.audit_config.get(
"check_rds_replicas", True
):
continue So as you can see in the tests there are two possible scenarios:
Also by default we set that value to |
@jfagoagas yes i see your tests. i tested in real, but maybe its my bad. When you are sure you can merge. I am fine with this |
Hi @uridealo we've made the decision to set the |
@jfagoagas That sounds great. Thanks a lot for your help |
@jfagoagas In which version will this be released? Also in v3? |
…3912) Co-authored-by: Pepe Fagoaga <pepe@prowler.com>
Hi @uridealo this will be included in the following v4.2.0 and v3.16.5. Thanks! |
…3912) Co-authored-by: Pepe Fagoaga <pepe@prowler.com>
Context
We need a way not to generate findings for an RDS Instance replica since could be a read replica in PostgreSQL and Oracle and a read/write replica in MySQL and MariaDB.
Description
ReadReplicaSourceDBInstanceIdentifier
in the RDS service for instances.check_rds_instance_replicas
set toFalse
by default to skip those instances.Including ReadReplicaSourceDBInstanceIdentifier helps skipping replica instances in rds_instance_backup_enabled
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.