-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathModify-UDR.json
103 lines (103 loc) · 3.9 KB
/
Modify-UDR.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
"name": "Modify-UDR",
"type": "Microsoft.Authorization/policyDefinitions",
"apiVersion": "2021-06-01",
"scope": null,
"properties": {
"policyType": "Custom",
"mode": "All",
"displayName": "Enforce specific configuration of User-Defined Routes (UDR)",
"description": "This policy enforces the configuration of User-Defined Routes (UDR) within a subnet.",
"metadata": {
"version": "1.0.0",
"category": "Network",
"source": "https://github.com/Azure/Enterprise-Scale/",
"alzCloudEnvironments": [
"AzureCloud",
"AzureChinaCloud",
"AzureUSGovernment"
]
},
"parameters": {
"effect": {
"type": "String",
"allowedValues": [
"Modify",
"Disabled"
],
"defaultValue": "Modify",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
},
"addressPrefix": {
"type": "string",
"metadata": {
"description": "The destination IP address range in CIDR notation that this Policy checks for within the UDR. Example: 0.0.0.0/0 to check for the presence of a default route.",
"displayName": "Address Prefix"
}
},
"nextHopType": {
"type": "string",
"metadata": {
"description": "The next hope type that the policy checks for within the inspected route. The value can be Virtual Network, Virtual Network Gateway, Internet, Virtual Appliance, or None.",
"displayName": "Next Hop Type"
},
"allowedValues": [
"VnetLocal",
"VirtualNetworkGateway",
"Internet",
"VirtualAppliance",
"None"
]
},
"nextHopIpAddress": {
"type": "string",
"metadata": {
"description": "The IP address packets should be forwarded to.",
"displayName": "Next Hop IP Address"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Network/routeTables"
},
{
"count": {
"field": "Microsoft.Network/routeTables/routes[*]"
},
"equals": 0
}
]
},
"then": {
"effect": "[[parameters('effect')]",
"details": {
"roleDefinitionIds": [
"/providers/microsoft.authorization/roleDefinitions/4d97b98b-1d4f-4787-a291-c67834d212e7"
],
"conflictEffect": "audit",
"operations": [
{
"operation": "add",
"field": "Microsoft.Network/routeTables/routes[*]",
"value": {
"name": "default",
"properties": {
"addressPrefix": "[[parameters('addressPrefix')]",
"nextHopType": "[[parameters('nextHopType')]",
"nextHopIpAddress": "[[parameters('nextHopIpAddress')]"
}
}
}
]
}
}
}
}
}