-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathDeploy-Storage-sslEnforcement.json
138 lines (138 loc) · 4.65 KB
/
Deploy-Storage-sslEnforcement.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
{
"name": "Deploy-Storage-sslEnforcement",
"type": "Microsoft.Authorization/policyDefinitions",
"apiVersion": "2021-06-01",
"scope": null,
"properties": {
"policyType": "Custom",
"mode": "Indexed",
"displayName": "Azure Storage deploy a specific min TLS version requirement and enforce SSL/HTTPS ",
"description": "Deploy a specific min TLS version requirement and enforce SSL on Azure Storage. Enables secure server to client by enforce minimal Tls Version to secure the connection between your database server and your client applications helps protect against 'man in the middle' attacks by encrypting the data stream between the server and your application. This configuration enforces that SSL is always enabled for accessing your Azure Storage.",
"metadata": {
"version": "1.3.0",
"category": "Storage",
"source": "https://github.com/Azure/Enterprise-Scale/",
"alzCloudEnvironments": [
"AzureCloud",
"AzureChinaCloud",
"AzureUSGovernment"
]
},
"parameters": {
"effect": {
"type": "String",
"defaultValue": "DeployIfNotExists",
"allowedValues": [
"DeployIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect Azure Storage",
"description": "Enable or disable the execution of the policy minimum TLS version Azure STorage"
}
},
"minimumTlsVersion": {
"type": "String",
"defaultValue": "TLS1_2",
"allowedValues": [
"TLS1_2",
"TLS1_1",
"TLS1_0"
],
"metadata": {
"displayName": "Select TLS version for Azure Storage server",
"description": "Select version minimum TLS version Azure STorage to enforce"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Storage/storageAccounts"
},
{
"anyOf": [
{
"field": "Microsoft.Storage/storageAccounts/supportsHttpsTrafficOnly",
"notEquals": "true"
},
{
"field": "Microsoft.Storage/storageAccounts/minimumTlsVersion",
"less": "[[parameters('minimumTlsVersion')]"
}
]
}
]
},
"then": {
"effect": "[[parameters('effect')]",
"details": {
"type": "Microsoft.Storage/storageAccounts",
"existenceCondition": {
"allOf": [
{
"field": "Microsoft.Storage/storageAccounts/supportsHttpsTrafficOnly",
"equals": "true"
},
{
"field": "Microsoft.Storage/storageAccounts/minimumTlsVersion",
"equals": "[[parameters('minimumTlsVersion')]"
}
]
},
"name": "current",
"roleDefinitionIds": [
"/providers/microsoft.authorization/roleDefinitions/17d1049b-9a84-46fb-8f53-869881c3d3ab"
],
"deployment": {
"properties": {
"mode": "Incremental",
"template": {
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resourceName": {
"type": "String"
},
"minimumTlsVersion": {
"type": "String"
},
"location": {
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[[concat(parameters('resourceName'))]",
"location": "[[parameters('location')]",
"properties": {
"supportsHttpsTrafficOnly": true,
"minimumTlsVersion": "[[parameters('minimumTlsVersion')]"
}
}
],
"outputs": {}
},
"parameters": {
"resourceName": {
"value": "[[field('name')]"
},
"minimumTlsVersion": {
"value": "[[parameters('minimumTlsVersion')]"
},
"location": {
"value": "[[field('location')]"
}
}
}
}
}
}
}
}
}