-
Notifications
You must be signed in to change notification settings - Fork 356
feat(queries): query IAM DB Cluster Auth Not Enabled implemented for terraform/aws and cloudFormation/aws #7667
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
Conversation
…us complete boolean logic update
…_Update--cloudformation/aws
…dformation/aws' of https://github.com/cx-andre-pereira/kics into AST-40783--FN_CloudFormation_Boolean_Logic_Update--cloudformation/aws
…_Update--cloudformation/aws
…_Update--cloudformation/aws
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 19562607 | Triggered | Generic Password | 5cbea1a | assets/queries/common/passwords_and_secrets/test/positive53.json | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
cx-artur-ribeiro
left a comment
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.
Hey Ricardo, some quality of life changes and a typo 😄.
Please refer to my comments.
assets/queries/terraform/aws/iam_db_cluster_auth_not_enabled/query.rego
Outdated
Show resolved
Hide resolved
cx-artur-ribeiro
left a comment
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.
LGTM, thanks for the changes and the unit tests addition.








Closes #
Reason for Proposed Changes
iam_database_authentication_enabled/EnableIAMDatabaseAuthenticationis not defined or is set to false for CloudFormation and Terraform.Proposed Changes
For both platforms, I used the same reasoning. Two policies, one for the cases when the target field is not defined, and the other for the cases when the target field is set to false.
For both platforms, I used the same helper function called
valid_for_iam_engine_and_version_check_edited, which is a modified version of the helper functionvalid_for_iam_engine_and_version_checkfrom KICS common_lib.The helper function
valid_for_iam_engine_and_version_check_editedchecks the following points:mysql(ormysql-postgresql),postgres,aurora-postgresql, andmariadb, and there is no version defined.mysql(ormysql-postgresql),postgres, andaurora-postgresql.These verifications made on the helper function were approved by the APPSEC team in the office.
Regarding the original function present on the common_lib called
valid_for_iam_engine_and_version_check, I made a change to also support the versions "10.11" and "11.4", which was discussed with the APPSEC team and got the approval from them too.Added samples to cover all the possible scenarios.
NOTE: on the query implementation for the Terraform platform, I did not add support for modules because I didn't find any module equivalent to the resource
aws_rds_cluster.I submit this contribution under the Apache-2.0 license.