-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
StorageNetworkAccessBypassOnly_Modify.json
121 lines (121 loc) · 3.82 KB
/
StorageNetworkAccessBypassOnly_Modify.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{
"properties": {
"displayName": "Configure Storage Accounts to restrict network access through network ACL bypass configuration only.",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "To improve the security of Storage Accounts, enable access only through network ACL bypass. This policy should be used in combination with a private endpoint for storage account access.",
"metadata": {
"version": "1.0.0",
"category": "VirtualEnclaves"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the audit policy"
},
"allowedValues": [
"Modify",
"Disabled"
],
"defaultValue": "Modify"
},
"bypassConfiguration": {
"type": "String",
"metadata": {
"displayName": "Bypass Configuration",
"description": "Bypass the policy for storage accounts that match the configuration"
},
"allowedValues": [
"None",
"AzureServices",
"Logging",
"Metrics",
"Logging, Metrics",
"Logging, Metrics, AzureServices",
"Logging, AzureServices",
"Metrics, AzureServices"
],
"defaultValue": "AzureServices"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Storage/storageAccounts"
},
{
"anyOf": [
{
"field": "Microsoft.Storage/storageAccounts/networkAcls.defaultAction",
"notEquals": "Deny"
},
{
"count": {
"field": "Microsoft.Storage/storageAccounts/networkAcls.ipRules[*]"
},
"greaterOrEquals": 1
},
{
"count": {
"field": "Microsoft.Storage/storageAccounts/networkAcls.resourceAccessRules[*]"
},
"greaterOrEquals": 1
},
{
"count": {
"field": "Microsoft.Storage/storageAccounts/networkAcls.virtualNetworkRules[*]"
},
"greaterOrEquals": 1
},
{
"field": "Microsoft.Storage/storageAccounts/networkAcls.bypass",
"notEquals": "[parameters('bypassConfiguration')]"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"conflictEffect": "audit",
"roleDefinitionIds": [
"/providers/Microsoft.Authorization/roleDefinitions/17d1049b-9a84-46fb-8f53-869881c3d3ab"
],
"operations": [
{
"operation": "addOrReplace",
"field": "Microsoft.Storage/storageAccounts/networkAcls.defaultAction",
"value": "Deny"
},
{
"operation": "addOrReplace",
"field": "Microsoft.Storage/storageAccounts/networkAcls.ipRules",
"value": []
},
{
"operation": "addOrReplace",
"field": "Microsoft.Storage/storageAccounts/networkAcls.virtualNetworkRules",
"value": []
},
{
"operation": "addOrReplace",
"field": "Microsoft.Storage/storageAccounts/networkAcls.bypass",
"value": "[parameters('bypassConfiguration')]"
}
]
}
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/41a72361-06e3-4e80-832a-690bd0708bc1",
"name": "41a72361-06e3-4e80-832a-690bd0708bc1"
}