Skip to content

bug(misconf): storage logging checks ignore Azure Monitor diagnostic settings #11754

Backlog

Description

@nikpivkin

Description

Logging for the services of a storage account can be configured through Azure Monitor diagnostic settings. Trivy does not read them and checks only Storage Analytics logging, so AZU-0057 and AZU-0009 do not see logging configured this way.

Reported in #11088. The queue logging problems from the same discussion are in #11738. Earlier attempts are #11279 and aquasecurity/trivy-checks#637.

Expected behavior

AZU-0057 should pass when at least one service of the account logs requests, and AZU-0009 should pass when the queue service logs requests. A service logs requests when it has a diagnostic setting that enables StorageRead, StorageWrite or StorageDelete, or the allLogs category group. For the queue service, Storage Analytics logging also counts, but only Terraform can configure it.

Steps to reproduce

Run trivy config . with Trivy 0.74.0 on this config.

resource "azurerm_storage_account" "example" {
  name                     = "example"
  resource_group_name      = "example"
  location                 = "westeurope"
  account_kind             = "BlobStorage"
  account_tier             = "Standard"
  account_replication_type = "GRS"
}

resource "azurerm_monitor_diagnostic_setting" "blob" {
  name                       = "blob-logs"
  target_resource_id         = "${azurerm_storage_account.example.id}/blobServices/default"
  log_analytics_workspace_id = "example"

  enabled_log {
    category = "StorageRead"
  }

  enabled_log {
    category = "StorageWrite"
  }

  enabled_log {
    category = "StorageDelete"
  }
}

AZU-0057 fails with "Storage account does not have logging enabled for any service." It should pass, because the blob service sends read, write and delete logs to Log Analytics.

Activity

  1. added
    kind/bug
    scan/misconfiguration
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugscan/misconfiguration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions