Gallery › Storage › Azure built-in policies
Azure NetApp Files Volumes of type NFSv4.1 should use Kerberos data encryption
Converted Policy Audit Deny Disabled Mode All Version 1.0.0
Only allow the use of Kerberos privacy (5p) security mode to ensure data is encrypted.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONANF_VolumesShouldUseKerberosEncryption.json · 114 lines
{
"properties": {
"displayName": "Azure NetApp Files Volumes of type NFSv4.1 should use Kerberos data encryption",
"policyType": "BuiltIn",
"mode": "All",
"description": "Only allow the use of Kerberos privacy (5p) security mode to ensure data is encrypted.",
"metadata": {
"version": "1.0.0",
"category": "Storage"
},
"version": "1.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": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes"
},
{
"count": {
"field": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/protocolTypes[*]",
"where": {
"field": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/protocolTypes[*]",
"equals": "NFSv4.1"
}
},
"greater": 0
},
{
"anyOf": [
{
"field": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/kerberosEnabled",
"exists": "false"
},
{
"field": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/kerberosEnabled",
"equals": "false"
},
{
"allOf": [
{
"field": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/kerberosEnabled",
"equals": "true"
},
{
"count": {
"field": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/exportPolicy.rules[*]",
"where": {
"anyOf": [
{
"allOf": [
{
"field": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/exportPolicy.rules[*].kerberos5pReadWrite",
"equals": "false"
},
{
"field": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/exportPolicy.rules[*].kerberos5pReadOnly",
"equals": "false"
}
]
},
{
"field": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/exportPolicy.rules[*].kerberos5ReadOnly",
"equals": "true"
},
{
"field": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/exportPolicy.rules[*].kerberos5ReadWrite",
"equals": "true"
},
{
"field": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/exportPolicy.rules[*].kerberos5iReadOnly",
"equals": "true"
},
{
"field": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/exportPolicy.rules[*].kerberos5iReadWrite",
"equals": "true"
}
]
}
},
"greater": 0
}
]
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/7c6c7139-7d8e-45d0-9d94-72386a61308b",
"name": "7c6c7139-7d8e-45d0-9d94-72386a61308b"
}Bylaw7c6c7139-7d8e-45d0-9d94-72386a61308b.bylaw.ps1 · 54 lines
# Converted from ANF_VolumesShouldUseKerberosEncryption.json by ConvertTo-Bylaw.
Policy '7c6c7139-7d8e-45d0-9d94-72386a61308b' {
Properties @{
DisplayName = 'Azure NetApp Files Volumes of type NFSv4.1 should use Kerberos data encryption'
Description = 'Only allow the use of Kerberos privacy (5p) security mode to ensure data is encrypted.'
Version = '1.0.0'
Category = 'Storage'
PolicyVersion = '1.0.0'
Mode = 'All'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.NetApp/netAppAccounts/capacityPools/volumes' {
When {
Count 'protocolTypes[*]' -Where {
Element | Must -Be 'NFSv4.1'
} | Must -BeGreaterThan 0
}
Require 'kerberosEnabled exists' {
Field kerberosEnabled | Must -Exist
}
Require 'kerberosEnabled is not false' {
Field kerberosEnabled | Must -Not -Be 'false' -IfPresent
}
Require 'kerberosEnabled, exportPolicy.rules, kerberos5pReadWrite and 5 more are as required' {
AnyOf {
Field kerberosEnabled | Must -Not -Be 'true' -IfPresent
Each 'exportPolicy.rules[*]' {
AnyOf {
Field kerberos5pReadWrite | Must -Not -Be 'false'
Field kerberos5pReadOnly | Must -Not -Be 'false'
}
Field kerberos5ReadOnly | Must -Not -Be 'true'
Field kerberos5ReadWrite | Must -Not -Be 'true'
Field kerberos5iReadOnly | Must -Not -Be 'true'
Field kerberos5iReadWrite | Must -Not -Be 'true'
}
}
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Storage/ANF_VolumesShouldUseKerberosEncryption.json in Azure/azure-policy, under the MIT licence.
Bylaw