-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
ASC_All_Internet_traffic_should_be_routed_via_Azure_Firewall.json
97 lines (97 loc) · 3.38 KB
/
ASC_All_Internet_traffic_should_be_routed_via_Azure_Firewall.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
{
"properties": {
"displayName": "[Preview]: All Internet traffic should be routed via your deployed Azure Firewall",
"policyType": "BuiltIn",
"mode": "All",
"description": "Azure Security Center has identified that some of your subnets aren't protected with a next generation firewall. Protect your subnets from potential threats by restricting access to them with Azure Firewall or a supported next generation firewall",
"metadata": {
"version": "3.0.0-preview",
"category": "Network",
"preview": true
},
"version": "3.0.0-preview",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "AuditIfNotExists",
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable All Internet traffic should be routed via your deployed Azure Firewall"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Network/virtualNetworks"
},
{
"count": {
"field": "Microsoft.Network/virtualNetworks/subnets[*]",
"where": {
"allOf": [
{
"count": {
"field": "Microsoft.Network/virtualNetworks/subnets[*].ipConfigurations[*]",
"where": {
"value": "[empty(field('Microsoft.Network/virtualNetworks/subnets[*].ipConfigurations[*].id'))]",
"equals": false
}
},
"greaterOrEquals": 2
},
{
"field": "Microsoft.Network/virtualNetworks/subnets[*].routeTable",
"exists": false
},
{
"not": {
"anyOf": [
{
"field": "Microsoft.Network/virtualNetworks/subnets[*].name",
"equals": "AzureBastionSubnet"
},
{
"field": "Microsoft.Network/virtualNetworks/subnets[*].name",
"equals": "GatewaySubnet"
}
]
}
}
]
}
},
"greater": 0
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Network/azureFirewalls",
"existenceCondition": {
"count": {
"field": "Microsoft.Network/azureFirewalls/ipConfigurations[*]",
"where": {
"field": "Microsoft.Network/azureFirewalls/ipConfigurations[*].subnet.id",
"like": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/*/providers/Microsoft.Network/virtualNetworks/', first(split(field('fullName'), '/')), '/subnets/AzureFirewallSubnet')]"
}
},
"equals": 1
}
}
}
},
"versions": [
"3.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/9df61aa2-b10c-4efe-aae0-295cc936930b",
"name": "9df61aa2-b10c-4efe-aae0-295cc936930b"
}