forked from Azure/azure-policy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpattern-effect-details-2.json
62 lines (62 loc) · 2.17 KB
/
pattern-effect-details-2.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
{
"type": "Microsoft.Authorization/policyDefinitions",
"name": "audit-vm-extension",
"properties": {
"displayName": "Audit if extension does not exist",
"description": "This policy audits if a required extension doesn't exist.",
"parameters": {
"publisher": {
"type": "String",
"metadata": {
"description": "The publisher of the extension",
"displayName": "Extension Publisher"
}
},
"type": {
"type": "String",
"metadata": {
"description": "The type of the extension",
"displayName": "Extension Type"
}
}
},
"policyRule": {
"if": {
"allOf": [{
"field": "type",
"equals": "Microsoft.Compute/virtualMachines"
},
{
"field": "Microsoft.Compute/imagePublisher",
"in": [
"MicrosoftWindowsServer"
]
},
{
"field": "Microsoft.Compute/imageOffer",
"in": [
"WindowsServer"
]
}
]
},
"then": {
"effect": "auditIfNotExists",
"details": {
"type": "Microsoft.Compute/virtualMachines/extensions",
"existenceCondition": {
"allOf": [{
"field": "Microsoft.Compute/virtualMachines/extensions/publisher",
"equals": "[parameters('publisher')]"
},
{
"field": "Microsoft.Compute/virtualMachines/extensions/type",
"equals": "[parameters('type')]"
}
]
}
}
}
}
}
}