Gallery › SQL › Azure built-in policies
Infrastructure encryption should be enabled for Azure Database for PostgreSQL servers
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Enable infrastructure encryption for Azure Database for PostgreSQL servers to have higher level of assurance that the data is secure. When infrastructure encryption is enabled, the data at rest is encrypted twice using FIPS 140-2 compliant Microsoft managed keys
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONPostgreSQL_InfrastructureEncryption_Audit.json · 50 lines
{
"properties": {
"displayName": "Infrastructure encryption should be enabled for Azure Database for PostgreSQL servers",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Enable infrastructure encryption for Azure Database for PostgreSQL servers to have higher level of assurance that the data is secure. When infrastructure encryption is enabled, the data at rest is encrypted twice using FIPS 140-2 compliant Microsoft managed keys",
"metadata": {
"version": "1.0.0",
"category": "SQL"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.DBforPostgreSQL/servers"
},
{
"field": "Microsoft.DBforPostgreSQL/servers/infrastructureEncryption",
"notEquals": "Enabled"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/24fba194-95d6-48c0-aea7-f65bf859c598",
"name": "24fba194-95d6-48c0-aea7-f65bf859c598"
}Bylaw24fba194-95d6-48c0-aea7-f65bf859c598.bylaw.ps1 · 29 lines
# Converted from PostgreSQL_InfrastructureEncryption_Audit.json by ConvertTo-Bylaw.
Policy '24fba194-95d6-48c0-aea7-f65bf859c598' {
Properties @{
DisplayName = 'Infrastructure encryption should be enabled for Azure Database for PostgreSQL servers'
Description = 'Enable infrastructure encryption for Azure Database for PostgreSQL servers to have higher level of assurance that the data is secure. When infrastructure encryption is enabled, the data at rest is encrypted twice using FIPS 140-2 compliant Microsoft managed keys'
Version = '1.0.0'
Category = 'SQL'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.DBforPostgreSQL/servers' {
Require 'infrastructureEncryption is Enabled' {
Field infrastructureEncryption | Must -Be 'Enabled'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/SQL/PostgreSQL_InfrastructureEncryption_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw