Skip to content

Conversation

@cx-ricardo-jesus
Copy link
Contributor

@cx-ricardo-jesus cx-ricardo-jesus commented Aug 20, 2025

Closes #

Reason for Proposed Changes

  • Currently, we do not support situations where the field iam_database_authentication_enabled/EnableIAMDatabaseAuthentication is 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 function valid_for_iam_engine_and_version_check from KICS common_lib.

  • The helper function valid_for_iam_engine_and_version_check_edited checks the following points:

    • if the engine field is set to "mariadb" and the version is "10.6", "10.11", or "11.4".
    • if the engines are mysql(or mysql-postgresql), postgres, aurora-postgresql, and mariadb, and there is no version defined.
    • if the engines are mysql(or mysql-postgresql), postgres, and aurora-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.

@cx-ricardo-jesus cx-ricardo-jesus requested a review from a team as a code owner August 20, 2025 15:32
@gitguardian
Copy link

gitguardian bot commented Aug 20, 2025

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
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
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. 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


🦉 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.

@github-actions github-actions bot added feature New feature query New query feature cloudformation CloudFormation query terraform Terraform query aws PR related with AWS Cloud labels Aug 20, 2025
@github-actions
Copy link
Contributor

kics-logo

KICS version: v2.1.11

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 0
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 0
Metric Values
Files scanned placeholder 1
Files parsed placeholder 1
Files failed to scan placeholder 0
Total executed queries placeholder 47
Queries failed to execute placeholder 0
Execution time placeholder 0

Copy link
Contributor

@cx-artur-ribeiro cx-artur-ribeiro left a 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.

Copy link
Contributor

@cx-artur-ribeiro cx-artur-ribeiro left a 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.

@cx-artur-ribeiro cx-artur-ribeiro merged commit bb0d9f0 into master Aug 25, 2025
29 checks passed
@cx-artur-ribeiro cx-artur-ribeiro deleted the AST-40745 branch August 25, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws PR related with AWS Cloud cloudformation CloudFormation query feature New feature query New query feature terraform Terraform query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants