Azure Queue Storage operation logs are disabled

Send Queue Storage read, write and delete logs to the required destination.

Description

Apply diagnostic settings to queueServices/default to record operations on Azure Queue Storage.

Potential impact

Without another collection path, you may lack a record of who read or changed queue data.

Remediation

Enable the categories you need from StorageRead, StorageWrite and StorageDelete. Set retention at the destination. Perform the selected operations on a test queue and confirm their logs arrive.

Examples

Supply the existing storage account name and Log Analytics workspace ID. Blob, File and Table services each need their own diagnostic settings.

Before

bicep
param storageAccountName string
param workspaceId string

resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' existing = {
  name: storageAccountName
}

resource queueService 'Microsoft.Storage/storageAccounts/queueServices@2021-09-01' existing = {
  parent: storageAccount
  name: 'default'
}

resource default_Microsoft_Insights 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = {
  name: 'default'
  scope: queueService
  properties: {
    workspaceId: workspaceId
    logs: [
      {
        category: 'StorageRead'
        enabled: false
      }
      {
        category: 'StorageWrite'
        enabled: false
      }
      {
        category: 'StorageDelete'
        enabled: false
      }
    ]
  }
}

After

bicep
param storageAccountName string
param workspaceId string

resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' existing = {
  name: storageAccountName
}

resource queueService 'Microsoft.Storage/storageAccounts/queueServices@2021-09-01' existing = {
  parent: storageAccount
  name: 'default'
}

resource default_Microsoft_Insights 'Microsoft.Insights/diagnosticSettings@2021-05-01-preview' = {
  name: 'default'
  scope: queueService
  properties: {
    workspaceId: workspaceId
    logs: [
      {
        category: 'StorageRead'
        enabled: true
      }
      {
        category: 'StorageWrite'
        enabled: true
      }
      {
        category: 'StorageDelete'
        enabled: true
      }
    ]
  }
}

References