Gallery › SQL › Azure built-in policies
SQL managed instances should use customer-managed keys to encrypt data at rest
Converted Policy Audit Deny Disabled Mode All Version 2.0.0
Implementing Transparent Data Encryption (TDE) with your own key provides you with increased transparency and control over the TDE Protector, increased security with an HSM-backed external service, and promotion of separation of duties. This recommendation applies to organizations with a related compliance requirement.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONSqlManagedInstance_EnsureServerTDEisEncrypted_Deny.json · 74 lines
{
"properties": {
"displayName": "SQL managed instances should use customer-managed keys to encrypt data at rest",
"description": "Implementing Transparent Data Encryption (TDE) with your own key provides you with increased transparency and control over the TDE Protector, increased security with an HSM-backed external service, and promotion of separation of duties. This recommendation applies to organizations with a related compliance requirement.",
"policyType": "BuiltIn",
"mode": "All",
"metadata": {
"version": "2.0.0",
"category": "SQL"
},
"version": "2.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"anyOf": [
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.Sql/managedInstances"
},
{
"anyOf": [
{
"field": "Microsoft.Sql/managedInstances/keyid",
"exists": false
},
{
"field": "Microsoft.Sql/managedInstances/keyid",
"equals": ""
}
]
}
]
},
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.Sql/managedInstances/encryptionProtector"
},
{
"field": "Microsoft.Sql/managedInstances/encryptionProtector/serverKeyType",
"notequals": "AzureKeyVault"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"2.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/ac01ad65-10e5-46df-bdd9-6b0cad13e1d2",
"name": "ac01ad65-10e5-46df-bdd9-6b0cad13e1d2"
}Bylawac01ad65-10e5-46df-bdd9-6b0cad13e1d2.bylaw.ps1 · 38 lines
# Converted from SqlManagedInstance_EnsureServerTDEisEncrypted_Deny.json by ConvertTo-Bylaw.
Policy 'ac01ad65-10e5-46df-bdd9-6b0cad13e1d2' {
Properties @{
DisplayName = 'SQL managed instances should use customer-managed keys to encrypt data at rest'
Description = 'Implementing Transparent Data Encryption (TDE) with your own key provides you with increased transparency and control over the TDE Protector, increased security with an HSM-backed external service, and promotion of separation of duties. This recommendation applies to organizations with a related compliance requirement.'
Version = '2.0.0'
Category = 'SQL'
PolicyVersion = '2.0.0'
Mode = 'All'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource * {
Require 'type and keyid are as required' {
AnyOf {
Field type | Must -Not -Be 'Microsoft.Sql/managedInstances' -IfPresent
Field 'Microsoft.Sql/managedInstances/keyid' | Must -Not -Be ''
}
}
Require 'type and serverKeyType are as required' {
AnyOf {
Field type | Must -Not -Be 'Microsoft.Sql/managedInstances/encryptionProtector' -IfPresent
Field 'Microsoft.Sql/managedInstances/encryptionProtector/serverKeyType' | Must -Be 'AzureKeyVault'
}
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/SQL/SqlManagedInstance_EnsureServerTDEisEncrypted_Deny.json in Azure/azure-policy, under the MIT licence.
Bylaw