Skip to content

Conversation

cx-andre-pereira
Copy link
Contributor

Reason for Proposed Changes

  • This query is meant to flag all SQL server databases with auditing disabled; to do this the query "walks" through all resources and, in case they are of a type included in the dbTypes array, a search of the resource´s child resources proceeds aiming to find one with a valid type such as "auditingSettings" , those being registered in the "types" array, and , in case they have a state set to enabled, we can be sure auditing is not missing and the flag is avoided.
  • The problem with this query is simple enough, there are some types not account for. In the dbTypes array there should be the Microsoft.Sql/servers type and in the types array there should be the Microsoft.Sql/servers/auditingSettings type.

Proposed Changes

  • I started by simple including the relevant missing types for the dbTypes and types arrays. With this the negative tests started to flag due to being dependent on a Microsoft.Sql/servers that itself triggered the query flag.
  • To prevent the negative as well as the positive tests from flagging this way i simply added the auditing resources missing from the servers; additionally a new positive5 test to test this behavior in itself was added.

I submit this contribution under the Apache-2.0 license.

@cx-andre-pereira cx-andre-pereira requested a review from a team as a code owner July 25, 2025 13:50
@github-actions github-actions bot added query New query feature arm Azure Resource Manager query azure PR related with Azure Cloud labels Jul 25, 2025
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

Copy link

gitguardian bot commented Aug 5, 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.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
19562607 Triggered Generic Password 59a513d 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.

@cx-andre-pereira cx-andre-pereira merged commit 142b31a into Checkmarx:master Aug 5, 2025
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm Azure Resource Manager query azure PR related with Azure Cloud query New query feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants