Gallery › Network › Azure Community Policy
ExpressRoute should not use Authorization keys
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
This policy denies the creation of Authorization keys for the ExpressRoute. Authorization keys are used to enable cross-subscription/cross-tenant networking functionality to the ExpressRoute. This should be reviewed by the network security team. https://learn.microsoft.com/en-us/azure/expressroute/expressroute-howto-linkvnet-portal-resource-manager
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONazurepolicy.json · 47 lines
{
"name": "0712ea43-15c2-4471-a45d-1f075d60c50f",
"type": "Microsoft.Authorization/policyDefinitions",
"properties": {
"displayName": "ExpressRoute should not use Authorization keys",
"description": "This policy denies the creation of Authorization keys for the ExpressRoute. Authorization keys are used to enable cross-subscription/cross-tenant networking functionality to the ExpressRoute. This should be reviewed by the network security team. https://learn.microsoft.com/en-us/azure/expressroute/expressroute-howto-linkvnet-portal-resource-manager",
"metadata": {
"version": "1.0.0",
"category": "Network"
},
"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.Network/expressRouteCircuits"
},
{
"count": {
"field": "Microsoft.Network/expressRouteCircuits/authorizations[*]"
},
"greaterOrEquals": 1
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
}Bylaw0712ea43-15c2-4471-a45d-1f075d60c50f.bylaw.ps1 · 27 lines
# Converted from azurepolicy.json by ConvertTo-Bylaw.
Policy '0712ea43-15c2-4471-a45d-1f075d60c50f' {
Properties @{
DisplayName = 'ExpressRoute should not use Authorization keys'
Description = 'This policy denies the creation of Authorization keys for the ExpressRoute. Authorization keys are used to enable cross-subscription/cross-tenant networking functionality to the ExpressRoute. This should be reviewed by the network security team. https://learn.microsoft.com/en-us/azure/expressroute/expressroute-howto-linkvnet-portal-resource-manager'
Version = '1.0.0'
Category = 'Network'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Deny', 'Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Deny, Audit or Disabled the execution of the Policy'
}
Resource 'Microsoft.Network/expressRouteCircuits' {
Require 'authorizations is as required' {
Count 'authorizations[*]' | Must -Be 0
}
}
Effect (Param Effect)
}Source: policyDefinitions/Network/expressroute-should-not-use-authorization-keys/azurepolicy.json in Azure/Community-Policy, under the MIT licence.
Bylaw