last sync: 2021-Nov-26 17:15:01 UTC

Azure Policy definition

Virtual machines should be connected to a specified workspace

Name Virtual machines should be connected to a specified workspace
Azure Portal
Id f47b5582-33ec-4c5c-87c0-b010a6b2e917
Version 1.1.0
details on versioning
Category Monitoring
Microsoft docs
Description Reports virtual machines as non-compliant if they aren't logging to the Log Analytics workspace specified in the policy/initiative assignment.
Mode Indexed
Type BuiltIn
Preview FALSE
Deprecated FALSE
Effect Default: AuditIfNotExists
Allowed: (AuditIfNotExists, Disabled)
Used RBAC Role none
History
Date/Time (UTC ymd) (i) Change type Change detail
2021-05-18 14:34:48 change Minor (1.0.1 > 1.1.0)
2020-04-22 04:43:16 change Previous DisplayName: [Preview]: Audit Log Analytics Workspace for VM - Report Mismatch
Used in Initiatives
Initiative DisplayName Initiative Id Initiative Category State
[Deprecated]: DoD Impact Level 4 8d792a84-723c-4d92-a3c3-e4ed16a2d133 Regulatory Compliance Deprecated
[Preview]: Australian Government ISM PROTECTED 27272c0b-c225-4cc3-b8b0-f2534b093077 Regulatory Compliance Preview
Canada Federal PBMM 4c4a5f27-de81-430b-b4e5-9cbd50595a87 Regulatory Compliance GA
CMMC Level 3 b5629c75-5c77-4422-87b9-2509e680f8de Regulatory Compliance GA
IRS1075 September 2016 105e0327-6175-4eb2-9af4-1fba43bdb39d Regulatory Compliance GA
NIST SP 800-171 Rev. 2 03055927-78bd-4236-86c0-f36125a10dc9 Regulatory Compliance GA
JSON Changes

JSON
{
  "displayName": "Virtual machines should be connected to a specified workspace",
  "policyType": "BuiltIn",
  "mode": "Indexed",
  "description": "Reports virtual machines as non-compliant if they aren't logging to the Log Analytics workspace specified in the policy/initiative assignment.",
  "metadata": {
    "version": "1.1.0",
    "category": "Monitoring"
  },
  "parameters": {
    "logAnalyticsWorkspaceId": {
      "type": "String",
      "metadata": {
        "displayName": "Log Analytics Workspace Id that virtual machines should be configured for",
        "description": "This is the Id (GUID) of the Log Analytics Workspace that the virtual machines should be configured for."
      }
    },
    "effect": {
      "type": "String",
      "metadata": {
        "displayName": "Effect",
        "description": "Enable or disable the execution of the policy"
      },
      "allowedValues": [
        "AuditIfNotExists",
        "Disabled"
      ],
      "defaultValue": "AuditIfNotExists"
    }
  },
  "policyRule": {
    "if": {
      "field": "type",
      "equals": "Microsoft.Compute/virtualMachines"
    },
    "then": {
      "effect": "[parameters('effect')]",
      "details": {
        "type": "Microsoft.Compute/virtualMachines/extensions",
        "existenceCondition": {
          "allOf": [
            {
              "field": "Microsoft.Compute/virtualMachines/extensions/publisher",
              "equals": "Microsoft.EnterpriseCloud.Monitoring"
            },
            {
              "field": "Microsoft.Compute/virtualMachines/extensions/settings.workspaceId",
              "equals": "[parameters('logAnalyticsWorkspaceId')]"
            }
          ]
        }
      }
    }
  }
}