Use identity-based authentication for Event Grid topics#
Security · Event Grid · Rule · 2022_09 · Important
Authenticate publishing clients with Azure AD identities.
Description#
To publish events to Event Grid access keys, SAS tokens, or Azure AD identities can be used. With Azure AD authentication, the identity is validated against the Microsoft Identity Platform. Using Azure AD identities centralizes identity management and auditing.
Once you decide to use Azure AD authentication, you can disable authentication using keys or SAS tokens.
Recommendation#
Consider only using Azure AD identities to publish events to Event Grid. Then disable authentication based on access keys or SAS tokens.
Examples#
Configure with Azure template#
To deploy Event Grid Topics that pass this rule:
- Set the
properties.disableLocalAuth
property totrue
.
For example:
{
"type": "Microsoft.EventGrid/topics",
"apiVersion": "2022-06-15",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"identity": {
"type": "SystemAssigned"
},
"properties": {
"disableLocalAuth": true,
"publicNetworkAccess": "Disabled",
"inputSchema": "CloudEventSchemaV1_0"
}
}
Configure with Bicep#
To deploy Event Grid Topics that pass this rule:
- Set the
properties.disableLocalAuth
property totrue
.
For example:
resource eventGrid 'Microsoft.EventGrid/topics@2022-06-15' = {
name: name
location: location
identity: {
type: 'SystemAssigned'
}
properties: {
disableLocalAuth: true
publicNetworkAccess: 'Disabled'
inputSchema: 'CloudEventSchemaV1_0'
}
}
Configure with Azure Verified Modules
A pre-validated module supported by Microsoft is available from the Azure Bicep public registry. To reference the module, please use the following syntax:
To use the latest version:
Configure with Azure Policy#
To address this issue at runtime use the following policies:
- Azure Event Grid topics should have local authentication methods disabled
- Configure Azure Event Grid topics to disable local authentication
Links#
- SE:05 Identity and access management
- IM-1: Use centralized identity and authentication system
- Authentication and authorization with Microsoft Entra ID
- Disable key and shared access signature authentication
- Azure deployment reference