Gallery › Storage › Azure built-in policies
Azure NetApp Files Volumes of type NFSv4.1 should use Kerberos data integrity or data privacy
Converted Policy Audit Deny Disabled Mode All Version 1.0.0
Ensure that at least either Kerberos integrity (krb5i) or Kerberos privacy (krb5p) is selected to ensure data integrity and data privacy.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONANF_VolumesShouldUseKerberosIntegrityPrivacy.json · 114 lines
{
"properties": {
"displayName": "Azure NetApp Files Volumes of type NFSv4.1 should use Kerberos data integrity or data privacy",
"policyType": "BuiltIn",
"mode": "All",
"description": "Ensure that at least either Kerberos integrity (krb5i) or Kerberos privacy (krb5p) is selected to ensure data integrity and data privacy.",
"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[*].kerberos5iReadWrite",
"equals": "false"
},
{
"field": "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/exportPolicy.rules[*].kerberos5iReadOnly",
"equals": "false"
},
{
"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"
}
]
}
},
"greater": 0
}
]
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/16f4af95-96b1-4220-805a-367ca59cd72e",
"name": "16f4af95-96b1-4220-805a-367ca59cd72e"
}Bylaw16f4af95-96b1-4220-805a-367ca59cd72e.bylaw.ps1 · 54 lines
# Converted from ANF_VolumesShouldUseKerberosIntegrityPrivacy.json by ConvertTo-Bylaw.
Policy '16f4af95-96b1-4220-805a-367ca59cd72e' {
Properties @{
DisplayName = 'Azure NetApp Files Volumes of type NFSv4.1 should use Kerberos data integrity or data privacy'
Description = 'Ensure that at least either Kerberos integrity (krb5i) or Kerberos privacy (krb5p) is selected to ensure data integrity and data privacy.'
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, kerberos5iReadWrite and 5 more are as required' {
AnyOf {
Field kerberosEnabled | Must -Not -Be 'true' -IfPresent
Each 'exportPolicy.rules[*]' {
AnyOf {
Field kerberos5iReadWrite | Must -Not -Be 'false'
Field kerberos5iReadOnly | Must -Not -Be 'false'
Field kerberos5pReadWrite | Must -Not -Be 'false'
Field kerberos5pReadOnly | Must -Not -Be 'false'
}
Field kerberos5ReadOnly | Must -Not -Be 'true'
Field kerberos5ReadWrite | Must -Not -Be 'true'
}
}
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Storage/ANF_VolumesShouldUseKerberosIntegrityPrivacy.json in Azure/azure-policy, under the MIT licence.
Bylaw