azureblog.co.uk
← cd ~/roles
// roles/azure · security

Managed HSM contributorAzure built-in role

Lets you manage managed HSM pools, but not access to them.

Role ID18500a29-7fe2-46b2-a342-b16a415e101d
CategorySecurity
Actions5
Data actions0

What it can do

PermissionWhat it allows
Microsoft.KeyVault/managedHSMs/*Every operation under Microsoft.KeyVault/managedHSMs
Microsoft.KeyVault/deletedManagedHsms/readView the properties of a deleted managed hsm
Microsoft.KeyVault/locations/deletedManagedHsms/readView the properties of a deleted managed hsm
Microsoft.KeyVault/locations/deletedManagedHsms/purge/actionPurge a soft deleted managed hsm
Microsoft.KeyVault/locations/managedHsmOperationResults/readCheck the result of a long run operation

Assign it

Scope it as tightly as you can: a resource or resource group rather than the whole subscription.

azure cli
az role assignment create \
  --assignee "jane.doe@contoso.com" \
  --role "Managed HSM contributor" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "Managed HSM contributor" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
  name: guid(resourceGroup().id, principalId, '18500a29-7fe2-46b2-a342-b16a415e101d')
  properties: {
    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '18500a29-7fe2-46b2-a342-b16a415e101d')
    principalId: principalId
  }
}

Who already has it?

kql · azure resource graph
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "18500a29-7fe2-46b2-a342-b16a415e101d"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)

Other security roles

Find the smallest role for a task →