feat(query): implements "Beta - Service Without Resource Logging"#7837
Merged
cx-andre-pereira merged 7 commits intoDec 9, 2025
Conversation
Contributor
…esource_logging_is_enabled_for_all_services
…esource_logging_is_enabled_for_all_services
…esource_logging_is_enabled_for_all_services
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








Reason for Proposed Changes
Currently there is no query to ensure that there is a "azurerm_monitor_diagnostic_setting" resource configured for all resources that support it.
Quoting CIS_Microsoft_Azure_Foundations_Benchmark_v5.0.0 page 275: "
A lack of monitoring reduces the visibility into the data plane, and therefore an organization's ability to detect reconnaissance, authorization attempts or other malicious activity. Unlike Activity Logs, Resource Logs are not enabled by default. Specifically, without monitoring it would be impossible to tell which entities had accessed a data store that was breached. In addition, alerts for failed attempts to access APIs for Web Services or Databases are only possible when logging is enabled."In this initial implementation it was decided that the query should support the 12 main resources outlined in the CIS Benchmark(page 277) :
For 'Key Vault' the analog terraform resource is the 'azurerm_key_vault', but this exact check is already done by the "Vault Auditing Disabled" query.
For all resources the naming schemes make association easy except for "Azure Data Lake Store"(*) and "Data Lake Analytics"(*). Resource association is as follows :
App ServiceBatch accountsEvent HubIoT HubLogic AppsSearch servicesService BusAzure Stream AnalyticsApplication Gateway"Azure Data Lake Store"(*) and "Data Lake Analytics"(*) are harder to pinpoint. From what i can tell from current terraform documentation to define a "Data Lake Store" we use a "azurerm_storage_account" and associate a "azurerm_storage_data_lake_gen2_filesystem" resource with it.
The truth is gen1 "Data Lake Store" and "Data Lake Analytics" support is deprecated and has been for years as we can see in the official documentation's 3.0-upgrade-guide. Still given the simplicity of the query implementation it was easy to include the "azurerm_data_lake_store" and "azurerm_data_lake_analytics_account" legacy resources.
Proposed Changes
I submit this contribution under the Apache-2.0 license.