Gallery › Compute › Azure Community Policy
Deny data access authentication mode
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Disable data access authentication mode to restrict access to export the disk. https://learn.microsoft.com/en-us/azure/virtual-machines/windows/download-vhd?tabs=azure-portal#secure-downloads-and-uploads-with-azure-ad
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONazurepolicy.json · 45 lines
{
"name": "9f4de327-feaa-4825-a42c-03e45010c66a",
"type": "Microsoft.Authorization/policyDefinitions",
"properties": {
"displayName": "Deny data access authentication mode",
"description": "Disable data access authentication mode to restrict access to export the disk. https://learn.microsoft.com/en-us/azure/virtual-machines/windows/download-vhd?tabs=azure-portal#secure-downloads-and-uploads-with-azure-ad",
"metadata": {
"category": "Compute",
"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.Compute/disks"
},
{
"field": "Microsoft.Compute/disks/dataAccessAuthmode",
"equals": "AzureActiveDirectory"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
}Bylaw9f4de327-feaa-4825-a42c-03e45010c66a.bylaw.ps1 · 27 lines
# Converted from azurepolicy.json by ConvertTo-Bylaw.
Policy '9f4de327-feaa-4825-a42c-03e45010c66a' {
Properties @{
DisplayName = 'Deny data access authentication mode'
Description = 'Disable data access authentication mode to restrict access to export the disk. https://learn.microsoft.com/en-us/azure/virtual-machines/windows/download-vhd?tabs=azure-portal#secure-downloads-and-uploads-with-azure-ad'
Category = 'Compute'
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.Compute/disks' {
Require 'dataAccessAuthMode is not AzureActiveDirectory' {
Field dataAccessAuthMode | Must -Not -Be 'AzureActiveDirectory' -IfPresent
}
}
Effect (Param Effect)
}Source: policyDefinitions/Compute/deny-data-access-authentication-mode/azurepolicy.json in Azure/Community-Policy, under the MIT licence.
Bylaw