Skip to content

Conversation

cx-ricardo-jesus
Copy link
Contributor

Closes #

Reason for Proposed Changes

  • Currently, for the query "Trusted Microsoft Services Not Enabled", when a network_rules is not defined, it returns a positive result but that should not happen when the resource is a function app (i.e., tag bdo-attached-service set to "function") for the azurerm_storage_account.
  • The same applies to the query "Default Azure Storage Account Network Access Is Too Permissive", but when the field public_network_access_enabled is set to true.

Proposed Changes

  • For the query "Trusted Microsoft Services Not Enabled", I only added an extra verification using a helper function called is_function_app that checks if a resource is a function app by checking the tags.
  • That helper function covers the cases when the tags field is an object or in HCL format using a regex.
  • For the query "Default Azure Storage Account Network Access Is Too Permissive", I did the same with the same helper function, but, just added the verification (not is_function_app(resource)) before returning a positive result when the field public_network_access_enabled is set to true.
  • Added samples for "Trusted Microsoft Services Not Enabled" that cover the extra case and some cases that were not covered before.
  • Added a negative sample for "Default Azure Storage Account Network Access Is Too Permissive" that covers the case which returned a positive result before the changes on the query.

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 27, 2025 17:05
@github-actions github-actions bot added query New query feature azure PR related with Azure Cloud labels Aug 27, 2025
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

@cx-ricardo-jesus cx-ricardo-jesus marked this pull request as draft September 3, 2025 14:58
@cx-andre-pereira cx-andre-pereira marked this pull request as ready for review September 4, 2025 14:59
@cx-ricardo-jesus cx-ricardo-jesus marked this pull request as draft September 4, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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