Gallery › Data Lake › Azure Community Policy
Enforce encryption on Data Lake Store accounts
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
This policy ensures encryption is enabled on all Data Lake Store accounts
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONazurepolicy.json · 45 lines
{
"name": "c6bf891f-45e2-4a3b-b6f9-b34d942923a9",
"type": "Microsoft.Authorization/policyDefinitions",
"properties": {
"displayName": "Enforce encryption on Data Lake Store accounts",
"description": "This policy ensures encryption is enabled on all Data Lake Store accounts",
"metadata": {
"category": "Data Lake",
"version": "1.0.0"
},
"mode": "Indexed",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Deny, Audit or Disabled the execution of the Policy"
},
"allowedValues": [
"Deny",
"Audit",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.DataLakeStore/accounts"
},
{
"field": "Microsoft.DataLakeStore/accounts/encryptionState",
"equals": "Disabled"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
}Bylawc6bf891f-45e2-4a3b-b6f9-b34d942923a9.bylaw.ps1 · 27 lines
# Converted from azurepolicy.json by ConvertTo-Bylaw.
Policy 'c6bf891f-45e2-4a3b-b6f9-b34d942923a9' {
Properties @{
DisplayName = 'Enforce encryption on Data Lake Store accounts'
Description = 'This policy ensures encryption is enabled on all Data Lake Store accounts'
Category = 'Data Lake'
Version = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Deny', 'Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Deny, Audit or Disabled the execution of the Policy'
}
Resource 'Microsoft.DataLakeStore/accounts' {
Require 'encryptionState is not Disabled' {
Field encryptionState | Must -Not -Be 'Disabled' -IfPresent
}
}
Effect (Param Effect)
}Source: policyDefinitions/Data Lake/enforce-encryption-on-data-lake-store-accounts/azurepolicy.json in Azure/Community-Policy, under the MIT licence.
Bylaw