Skip to content

Conversation

cx-andre-pereira
Copy link
Contributor

@cx-andre-pereira cx-andre-pereira commented Sep 29, 2025

Closes #6927

Reason for Proposed Changes

Query Name ID Implementation (KICS 2.1.14)
Function App Not Using Latest TLS Encryption Version 45fc717a-bd86-415c-bdd8-677901be1aa6 query 5
Function App Managed Identity Disabled c87749b3-ff10-41f5-9df2-c421e8151759 query 6
Function App HTTP2 Disabled ace823d1-4432-4dee-945b-cdf11a5a6bd0 query 7
Function App FTPS Enforce Disabled 9dab0179-433d-4dff-af8f-0091025691df query 8
Function App Client Certificates Unrequired 9bb3c639-5edf-458c-8ee5-30c17c7d671d query 9
Function App Authentication Disabled e65a0733-94a0-4826-82f4-df529f4c593f query 10

(Queries 1-4 are handled in the "parent" Pull Request where this issue was first handled for some similar "azurerm_app_service" resource related queries)

Proposed Changes

  • Function App Not Using Latest TLS Encryption Version
    • This query is analog to one fixed in the "parent" Pull Request, here all i had to do was add a new CxPolicy for the newer resources; i decided to do this once again since , unlike the legacy resource, these will flag if the field is not defined (because default tls version is 1.2 aka the highest supported in legacy), and the "min_tls_version" is now named "minimum_tls_version".
  • Function App Managed Identity Disabled
    • The change to this query was minimal all i did was update the logic to include the new resources as with all queries with nothing particular to note.
  • Function App HTTP2 Disabled
    • Again not much to note in this query, i did try to merge all the CxPolicy(s) into one but i could not prevent "multiple output for same input" flags so i decided to keep the implementations pretty much unchanged.
  • Function App FTPS Enforce Disabled
    • For this query i decided to add a case for the "site_config" resource missing; although the resource is required for the new resources many of the other queries have this check since the field is technically "Optional" for the legacy "azurerm_function_app".
  • Function App Client Certificates Unrequired
  • Function App Authentication Disabled
    • This final fix was particularly complex, or it would be if the analog query did not get updated very recently. All i had to do was copy the implementation and change the types array to include the relevant resource types. For details on the analog's implementation : PR7591 and PR7715. Simply put the older resource only has the "auth_settings" field to check while the newly supported ones have that same resource plus the new "auth_settings_v2", and both can be defined concurrently in which case the v2 takes precedence, so the logic for the query and the tests had to be more complex/comprehensive overall.

I submit this contribution under the Apache-2.0 license.

@github-actions github-actions bot added query New query feature terraform Terraform query azure PR related with Azure Cloud labels Sep 29, 2025
Copy link
Contributor

kics-logo

KICS version: v2.1.13

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-andre-pereira cx-andre-pereira marked this pull request as ready for review September 29, 2025 16:31
@cx-andre-pereira cx-andre-pereira requested a review from a team as a code owner September 29, 2025 16:31
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 terraform Terraform query
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(query): false negatives for Azure Function app
1 participant