Diagnostic setting does not capture AuditEvent category Affecting Monitor service in Azure


Severity

0.0
medium
0
10
Severity Framework
Snyk CCSS
Rule category
Logging/ Configuration

Is your environment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
Frameworks
CIS-AzureCIS-ControlsHIPAAISO-27001NIST-800-53PCI-DSSSOC-2
  • Snyk IDSNYK-CC-00478
  • creditSnyk Research Team

Description

Not capturing the diagnostic setting AuditEvent category for appropriate management activities can lead to missing important alerts.

How to fix?

Set properties.logs.category to AuditEvent and properties.logs.enabled to true.

Example Configuration

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {},
    "resources": [
      {
        "type": "Microsoft.Insights/diagnosticSettings",
        "apiVersion": "2021-05-01-preview",
        "scope": "mykeyvault",
        "name": "allowed1",
        "properties": {
          "workspaceId": "myworkspaceId",
          "storageAccountId": "myaccountId",
          "eventHubAuthorizationRuleId": "myeventHubAuthorizationRuleId",
          "eventHubName": "myeventHubName",
          "logs": [
            {
              "category": "AuditEvent",
              "enabled": true
            }
          ],
          "metrics": [
            {
              "category": "AllMetrics",
              "enabled": true
            }
          ]
        }
      }
    ]
  }