-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrequire_nsg_on_vnet.json
60 lines (60 loc) · 1.63 KB
/
require_nsg_on_vnet.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
{
"type": "Microsoft.Authorization/policyDefinitions",
"name": "require_nsg_on_vnet",
"properties": {
"metadata": {
"category": "Network"
},
"parameters": {
"allowedRanges": {
"type": "Array",
"metadata": {
"displayName": "Approved ranges",
"description": "Provide the list of approved IP ranges for NSGs"
}
},
"effect": {
"type": "String",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "The effect determines what happens when the policy rule is evaluated to match"
}
}
},
"policyRule": {
"if": {
"anyOf": [
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.Network/networkSecurityGroups/securityRules"
},
{
"anyOf": [
{
"field": "Microsoft.Network/networkSecurityGroups/securityRules/sourceAddressPrefix",
"notin": "[parameters('allowedRanges')]"
},
{
"field": "Microsoft.Network/networkSecurityGroups/securityRules/destinationAddressPrefix",
"notin": "[parameters('allowedRanges')]"
}
]
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
}