-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
LogAnalytics_WorkspaceMismatch_VM_Audit.json
63 lines (63 loc) · 2.01 KB
/
LogAnalytics_WorkspaceMismatch_VM_Audit.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
"properties": {
"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"
},
"version": "1.1.0",
"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')]"
}
]
}
}
}
},
"versions": [
"1.1.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/f47b5582-33ec-4c5c-87c0-b010a6b2e917",
"name": "f47b5582-33ec-4c5c-87c0-b010a6b2e917"
}