Gallery › Event Hub › Azure Community Policy
Audit authorization rules on Event Hub namespaces
Converted Policy Audit Disabled Mode All Version 1.0.0
Event Hub clients should not use a namespace level access policy that provides access to all queues and topics in a namespace. To align with the least previlege security model, you should create access policies at the entity level for queues and topics to provide access to only the specific entity
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONazurepolicy.json · 44 lines
{
"name": "3d9b055f-ba04-40c9-b40c-0b6bf5275726",
"type": "Microsoft.Authorization/policyDefinitions",
"properties": {
"displayName": "Audit authorization rules on Event Hub namespaces",
"description": "Event Hub clients should not use a namespace level access policy that provides access to all queues and topics in a namespace. To align with the least previlege security model, you should create access policies at the entity level for queues and topics to provide access to only the specific entity",
"metadata": {
"category": "Event Hub",
"version": "1.0.0"
},
"mode": "All",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Audit or Disabled the execution of the Policy"
},
"allowedValues": [
"Audit",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "name",
"notEquals": "RootManageSharedAccessKey"
},
{
"field": "type",
"equals": "Microsoft.EventHub/namespaces/authorizationRules"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
}Bylaw3d9b055f-ba04-40c9-b40c-0b6bf5275726.bylaw.ps1 · 27 lines
# Converted from azurepolicy.json by ConvertTo-Bylaw.
Policy '3d9b055f-ba04-40c9-b40c-0b6bf5275726' {
Properties @{
DisplayName = 'Audit authorization rules on Event Hub namespaces'
Description = 'Event Hub clients should not use a namespace level access policy that provides access to all queues and topics in a namespace. To align with the least previlege security model, you should create access policies at the entity level for queues and topics to provide access to only the specific entity'
Category = 'Event Hub'
Version = '1.0.0'
Mode = 'All'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Audit or Disabled the execution of the Policy'
}
Resource 'Microsoft.EventHub/namespaces/authorizationRules' {
Require 'name is RootManageSharedAccessKey' {
Field name | Must -Be 'RootManageSharedAccessKey'
}
}
Effect (Param Effect)
}Source: policyDefinitions/Event Hub/audit-authorization-rules-on-event-hub-namespaces/azurepolicy.json in Azure/Community-Policy, under the MIT licence.
Bylaw