Skip to content

Conversation

@cx-andre-pereira
Copy link
Contributor

@cx-andre-pereira cx-andre-pereira commented Jul 24, 2025

Reason for Proposed Changes

  • Currently this query checks if Microsoft.Storage/storageAccounts resources by assuring the field properties.networkAcls.defaultAction is not set as "Allow" , and that properties.networkAcls.bypass does not contain "AzureServices" as either of those scenarios would enable "Trusted Microsoft Services".
  • The query , however, does not account for the possibility of the resource missing the properties,properties.networkAcls or properties.networkAcls.defaultAction/bypass fields entirely.

Proposed Changes

  • I have implemented a "path_check" function that confirms the path to the defaultAction and/or bypass nested fields exists. Moreover the lack of a complete path will properly flag the Microsoft Services as Not Enabled and point to the "deepest" field along the path route(either"","properties" or "properties.networkAcls") on the "searchKey".

Note: I could not find explicit documentation stating the effects of missing "networkAcls" or other fields, but it seems to result in unexpected behavior depending on file/system context which, i feel, still makes this flag pertinent.

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 24, 2025 15:56
@github-actions github-actions bot added query New query feature arm Azure Resource Manager query labels Jul 24, 2025
@github-actions github-actions bot added the azure PR related with Azure Cloud label 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.

Hey André,
Please take a look at my comments and I'll review again after.

If you need any help, please fell free to contact 😄

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 André, besides my comment, the only other strange thing is this result:
{
"queryName": "Trusted Microsoft Services Not Enabled",
"severity": "MEDIUM",
"line": 19,
"fileName": "positive6.json"
},

Seems like we are pointing to "types" instead of the resource but I can't understand why. It seems to be related to the .json file somehow.

Other than that, everything seems good.

@Checkmarx Checkmarx deleted a comment from gitguardian bot Aug 5, 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

@gitguardian
Copy link

gitguardian bot commented Aug 14, 2025

⚠️ GitGuardian has uncovered 3 secrets 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 secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
19562607 Triggered Generic Password ffdb371 assets/queries/common/passwords_and_secrets/test/positive53.json View secret
4266022 Triggered Generic Password c9ec1e3 assets/queries/cloudFormation/aws/amplify_branch_basic_auth_config_password_exposed/test/negative7.yaml View secret
9419039 Triggered Username Password c9ec1e3 assets/queries/cloudFormation/aws/amplify_branch_basic_auth_config_password_exposed/test/positive5.yaml 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 secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  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-artur-ribeiro cx-artur-ribeiro merged commit bc35823 into Checkmarx:master Aug 14, 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