-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathDeploy-Sql-Tde.json
127 lines (126 loc) · 3.88 KB
/
Deploy-Sql-Tde.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
{
"name": "Deploy-Sql-Tde",
"type": "Microsoft.Authorization/policyDefinitions",
"apiVersion": "2021-06-01",
"scope": null,
"properties": {
"policyType": "Custom",
"mode": "Indexed",
"displayName": "[Deprecated] Deploy SQL Database Transparent Data Encryption",
"description": "Deploy the Transparent Data Encryption when it is not enabled in the deployment. Please use this policy instead https://www.azadvertizer.net/azpolicyadvertizer/86a912f6-9a06-4e26-b447-11b16ba8659f.html",
"metadata": {
"deprecated": true,
"supersededBy": "86a912f6-9a06-4e26-b447-11b16ba8659f",
"version": "1.1.1-deprecated",
"category": "SQL",
"source": "https://github.com/Azure/Enterprise-Scale/",
"alzCloudEnvironments": [
"AzureCloud",
"AzureChinaCloud",
"AzureUSGovernment"
]
},
"parameters": {
"effect": {
"type": "String",
"defaultValue": "DeployIfNotExists",
"allowedValues": [
"DeployIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
},
"excludedDatabases": {
"type": "Array",
"metadata":{
"displayName": "Excluded Databases",
"description": "Array of databases that are excluded from this policy"
},
"defaultValue": [
"master",
"model",
"tempdb",
"msdb",
"resource"
]
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Sql/servers/databases"
},
{
"field": "name",
"notIn": "[[parameters('excludedDatabases')]"
}
]
},
"then": {
"effect": "[[parameters('effect')]",
"details": {
"type": "Microsoft.Sql/servers/databases/transparentDataEncryption",
"existenceCondition": {
"allOf": [
{
"field": "Microsoft.Sql/transparentDataEncryption.status",
"equals": "Enabled"
}
]
},
"deployment": {
"properties": {
"mode": "Incremental",
"template": {
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "String"
},
"sqlServerName": {
"type": "String"
},
"sqlServerDataBaseName": {
"type": "String"
}
},
"variables": {},
"resources": [
{
"name": "[[concat( parameters('sqlServerName'),'/',parameters('sqlServerDataBaseName'),'/current')]",
"type": "Microsoft.Sql/servers/databases/transparentDataEncryption",
"apiVersion": "2014-04-01",
"properties": {
"status": "Enabled"
}
}
],
"outputs": {}
},
"parameters": {
"location": {
"value": "[[field('location')]"
},
"sqlServerName": {
"value": "[[first(split(field('fullname'),'/'))]"
},
"sqlServerDataBaseName": {
"value": "[[field('name')]"
}
}
}
},
"roleDefinitionIds": [
"/providers/Microsoft.Authorization/roleDefinitions/056cd41c-7e88-42e1-933e-88ba6a50c9c3"
]
}
}
}
}
}