azure-mhsm-can-decrypt

explicit azure emits CanDecrypt

match (effective permission)

{ "action": "Microsoft.KeyVault/managedHsm/keys/decrypt/action", "resource_type": "Microsoft.KeyVault/managedHSMs/keys" }

where

the effective grant is a Managed HSM LOCAL role dataAction carrying keys/decrypt/action (Crypto User only — Crypto Officer does NOT hold any crypto data action), NOT Azure RBAC (also emit for Microsoft.KeyVault/managedHsm/keys/unwrap/action)

emit

target typeEncryptionKey
source<principal>
target<key node>
permissionsMicrosoft.KeyVault/managedHsm/keys/decrypt/action Microsoft.KeyVault/managedHsm/keys/unwrap/action

Narrative

{principal.name} can decrypt/unwrap with {key.name} (Managed HSM local Crypto role).

Raw rule rules/explicit/azure-managedhsm.yaml

id: azure-mhsm-can-decrypt
emits: CanDecrypt
applies_to:
- azure
match_effective_permission:
  action: Microsoft.KeyVault/managedHsm/keys/decrypt/action
  resource_type: Microsoft.KeyVault/managedHSMs/keys
where:
- "the effective grant is a Managed HSM LOCAL role dataAction carrying keys/decrypt/action (Crypto User\
  \ only \u2014 Crypto Officer does NOT hold any crypto data action), NOT Azure RBAC"
- (also emit for Microsoft.KeyVault/managedHsm/keys/unwrap/action)
emit:
  target_type: EncryptionKey
  source: <principal>
  target: <key node>
  api_source: GET {hsm}/RoleAssignments + roleDefinition dataActions
  permissions:
  - Microsoft.KeyVault/managedHsm/keys/decrypt/action
  - Microsoft.KeyVault/managedHsm/keys/unwrap/action
  narrative: '{principal.name} can decrypt/unwrap with {key.name} (Managed HSM local Crypto role).'
move · open · esc close