Azure Key Vault holds the secrets, keys and certificates that most Azure workloads use to authenticate, so one over-broad role or an open network path to a vault can hand an attacker every credential an application estate depends on. Many vaults still run on the legacy access policy model, where a control-plane Contributor can grant itself data access, and Microsoft's API changes in 2026 and 2027 make this the right moment to migrate. This guide covers the Key Vault permission models, the privileged roles to control, how workloads should authenticate, logging and Defender alerts, and a hardening baseline built from Microsoft's built-in Azure Policy definitions. It is for cloud security engineers, platform teams and identity architects. For a comparison of secrets managers across clouds see the Cloud Secrets Managers Guide; this page goes deeper on Key Vault only.
This is an independent guide from NHI Mgmt Group, based on Microsoft's public documentation as of November 2026. It is not sponsored or reviewed by Microsoft. Product features change, so confirm settings against Microsoft's current documentation.
Key takeaways
- Move every vault to Azure RBAC. Microsoft recommends Azure RBAC over legacy access policies, and Privileged Identity Management works with Azure RBAC; from API version 2026-02-01, new vaults default to RBAC, but existing vaults do not change on their own.
- Vault write is a data permission on access policy vaults. Any role with
Microsoft.KeyVault/vaults/write, including Key Vault Contributor, can add itself to an access policy and read every secret. - One vault per application, environment and region. A vault is the practical security boundary: object-scope roles do not isolate teams because network, monitoring and management still need vault-level rights.
- Turn on purge protection for anything holding keys. Soft delete is on and permanent; purge protection stops anyone, including Microsoft, permanently deleting objects before the retention period ends, and it cannot be switched off.
- Private endpoints, managed identities and audit logs are the baseline. Disable public network access, authenticate workloads without secrets, and send AuditEvent logs to your SIEM with alerts on reads and deletes.
How identity and access work in Azure Key Vault
Key Vault has two planes. The management plane (Azure Resource Manager) creates and configures vaults: networking, soft delete, purge protection and the permission model. The data plane (https://<vault>.vault.azure.net) reads and writes secrets, keys and certificates. Every caller authenticates with Microsoft Entra ID; there are no vault-local passwords or keys. What differs is how the data plane is authorised, set by the vault property enableRbacAuthorization.
| Aspect | Azure RBAC (enableRbacAuthorization true) | Vault access policies (false or null) |
|---|---|---|
| Status | Default and recommended; default for new vaults from API version 2026-02-01 | Legacy; still supported, with Microsoft recommending a move to Azure RBAC |
| Scope | Management group, subscription, resource group, vault, or a single key, secret or certificate | Vault only |
| Who can grant data access | Holders of Microsoft.Authorization/roleAssignments/write (Owner, User Access Administrator, Key Vault Data Access Administrator) | Anyone with Microsoft.KeyVault/vaults/write, including Contributor and Key Vault Contributor |
| Just-in-time access | PIM eligible assignments with approval and MFA | Not supported |
| Conditions | Azure ABAC conditions on secret data actions (preview at the time of writing) | None |
| Change visibility | Role assignment events in the Activity log | Vault write events; VaultAccessPolicyChangedEventGridNotification in AuditEvent logs |
Built-in data roles
- Key Vault Administrator: all data-plane operations on all objects; cannot manage the vault resource or role assignments.
- Key Vault Secrets Officer, Crypto Officer, Certificates Officer: full control of secrets, keys or certificates respectively, except permissions.
- Key Vault Secrets User: reads secret values, including the private key portion of a certificate. This is the normal role for an application.
- Key Vault Crypto User: performs cryptographic operations with keys. Crypto Service Encryption User reads key metadata and wraps and unwraps, which is what customer-managed key integrations need.
- Key Vault Certificate User: reads full certificate contents including secret and key portions.
- Key Vault Reader: metadata only; cannot read values or key material.
- Key Vault Data Access Administrator: adds and removes the data-plane role assignments above, constrained by an ABAC condition.
- Key Vault Purge Operator: permanently deletes soft-deleted vaults.
Assign data roles at vault scope. Microsoft advises object scope only for narrow cases, such as one person reading one SSH key for Azure Bastion, or one secret shared between two applications. For the general Azure RBAC model see the Azure RBAC and Service Principals Guide.
Migrating from access policies
| Access policy template | Azure RBAC equivalent |
|---|---|
| Key, Secret, Certificate Management | Key Vault Administrator |
| Key and Secret Management | Key Vault Crypto Officer plus Key Vault Secrets Officer |
| Secret Management | Key Vault Secrets Officer |
| Certificate Management | Key Vault Certificates Officer |
| SQL Server Connector, Exchange Online Customer Key | Key Vault Crypto Service Encryption User |
| Azure Storage or Data Lake Storage, Azure Backup, Azure Information BYOK | Custom role required |
- Inventory: list vaults with
properties.enableRbacAuthorizationfalse or null across subscriptions, and export each vault'saccessPolicies. - Right-size while mapping: most application policies grant Get and List on secrets; map them to Key Vault Secrets User, not Secrets Officer. Drop principals that no longer exist.
- Create role assignments first: access policies stop being enforced the moment RBAC is enabled, so every principal needs its role before the switch. Microsoft's community compare tool (KeyVault-AccessPolicyToRBAC-CompareTool) checks coverage.
- Pilot: switch non-production vaults, watch for HTTP 403 results in AuditEvent logs, then move production vaults in rings.
- Roll back if needed: keep the exported access policies so the vault can be returned to the access policy model while a missing role is fixed, and record it as a time-bound exception.
- Enforce: assign the built-in policy Azure Key Vault should use RBAC permission model in Audit, then Deny.
- Update tooling: Microsoft retires control-plane API versions earlier than 2026-02-01 on 27 February 2027; the documented minimums are Azure CLI 2.90.0 and Azure PowerShell 16.3.0. Templates that need access policies must now set the property to false explicitly.
Admin roles and privileged access
The most dangerous Key Vault permissions sit on the management plane, because they change who can reach the data plane.
| Permission | Held by | Risk | Control |
|---|---|---|---|
Microsoft.KeyVault/vaults/write | Owner, Contributor, Key Vault Contributor | On access policy vaults: add self to the policy and read everything. On any vault: open the firewall, switch the permission model | Migrate to RBAC; PIM-eligible only; Deny policies on network and model settings |
Microsoft.Authorization/roleAssignments/write | Owner, User Access Administrator, Key Vault Data Access Administrator (constrained) | Grant any data role on RBAC vaults | PIM with approval; alert on role assignments at vault scope |
Purge (locations/deletedVaults/purge/action) | Subscription Owner, Key Vault Purge Operator | Irrecoverable destruction of a soft-deleted vault | Purge protection; no standing assignments |
| Key Vault Administrator | Platform or security team | Read every value in the vault | PIM with approver and MFA, per Microsoft's recommendation |
The Azure Key Vault Contributor escalation reported in 2024 showed how easily this is misread: the role was documented as having no data access, yet on access policy vaults it could grant itself full rights. Microsoft's position was that this is by design, and its answer is the RBAC model. For PIM configuration see the Privileged Identity Management (PIM) Guide.
Integrations, API tokens and service accounts
Most vault callers are non-human identities, and the goal is that the identity used to reach the vault is not itself a secret stored somewhere else.
- Azure-hosted workloads: use a managed identity with Key Vault Secrets User (or Crypto User) at vault scope. App Service and Azure Functions can resolve Key Vault references in settings using the app's identity. See the Azure Managed Identities Security Guide.
- Pipelines and external workloads: use workload identity federation for GitHub Actions, Azure DevOps service connections and Kubernetes, rather than a client secret that would itself need protecting. See the Azure Entra Client Secrets Security Guide.
- Customer-managed keys: services such as Storage and SQL TDE use the vault key through Crypto Service Encryption User, and Microsoft notes many integrations require purge protection. Disabling or deleting such a key takes the dependent service offline, so on compromise rotate to a new key and migrate first.
- Certificates: store them as Key Vault certificates, not secrets, and set lifetime actions for autorotation with an integrated issuer.
- Rotation: Microsoft suggests 60 to 90 days for sensitive credentials, with the dual-credential pattern: keep two valid credentials on the target, rotate one, update the vault, then rotate the other. Trigger rotation from the Event Grid event
Microsoft.KeyVault.SecretNearExpiry. - Client behaviour: cache secrets in memory and refresh on rotation, with exponential back-off for HTTP 429 throttling. Polling the vault on every request is both a throttling risk and log noise that hides real anomalies.
- Not a data store: configuration belongs in App Configuration, data in Storage or Cosmos DB. A vault full of non-secret values gets broad read access granted to it.
Logging and detection
Enable a diagnostic setting with the AuditEvent category on every vault, sent to a Log Analytics workspace or SIEM. Records arrive within about 10 minutes and include operationName (for example SecretGet, SecretListVersions, VaultPut, VaultPatch, VaultDelete, VaultRecover), resultSignature (HTTP status), callerIpAddress and the caller identity. Management-plane changes, including role assignments and network changes, appear in the Azure Activity log. See the Azure Monitor, Activity Log and Diagnostic Settings Guide.
| Detection | Data | ATT&CK v20 |
|---|---|---|
| Identity reads many secrets it does not normally read, or lists then gets in bulk | AuditEvent SecretGet count per identity against baseline | T1555.006 Cloud Secrets Management Stores |
| Repeated 403 results from one caller | AuditEvent resultSignature | T1555.006 (discovery of reachable vaults) |
| New role assignment or access policy change on a vault | Activity log role assignment writes; VaultAccessPolicyChangedEventGridNotification | T1098.003 Additional Cloud Roles |
| Firewall opened, public access enabled, permission model changed | Activity log vault write; Azure Policy compliance change | T1098 Account Manipulation |
| Secret, key or vault deleted, or purge attempted | AuditEvent delete operations; Activity log purge | T1485 Data Destruction |
| Access from unfamiliar IP, Tor or unusual application | Microsoft Defender for Key Vault alerts | T1078.004 Cloud Accounts |
Microsoft Defender for Key Vault flags unusual and potentially harmful access attempts, with the object ID and UPN or IP of the caller. Microsoft's own guidance is not to dismiss an alert just because the identity is familiar, since the feature exists to catch stolen credentials, and to remember that Azure-hosted attackers come from Microsoft IP ranges. On a confirmed alert: identify the caller, remove its access, check which secrets it read in the alert and the logs, then rotate those secrets and audit the systems they open. See the Microsoft Defender for Cloud Guide.
Metrics
- RBAC coverage: percentage of vaults with
enableRbacAuthorizationtrue, target 100%. - Standing privilege: count of permanent (non-PIM) Key Vault Administrator, Owner and Contributor assignments covering vaults.
- Network exposure: vaults with public network access enabled and no firewall, target zero.
- Expiry hygiene: percentage of secrets and keys with an expiration date, and number past expiry.
- Log coverage: vaults with AuditEvent flowing to the SIEM, target 100%.
Hardening baseline
The policy names below are Microsoft built-in Azure Policy definitions. Assign them as an initiative at management group scope, in Audit first.
| Control | Setting | Built-in policy |
|---|---|---|
| Permission model | enableRbacAuthorization true | Azure Key Vault should use RBAC permission model |
| Soft delete | On (permanent once on); retention 7 to 90 days, default 90, set only at creation | Key vaults should have soft delete enabled |
| Purge protection | On; cannot be disabled afterwards | Key vaults should have deletion protection enabled |
| Network | Public network access disabled, private endpoint | Azure Key Vault should disable public network access; Azure Key Vaults should use private link |
| Firewall fallback | Selected networks only where a private endpoint is not possible | Azure Key Vault should have firewall enabled or public network access disabled |
| Logging | AuditEvent to Log Analytics | Resource logs in Key Vault should be enabled; Deploy Diagnostic Settings for Key Vault to Log Analytics workspace |
| Expiry | Expiration date on secrets and keys | Key Vault secrets should have an expiration date; Key Vault keys should have an expiration date |
| Certificates | Maximum validity and lifetime actions | Certificates should have the specified maximum validity period |
| Threat detection | Defender for Key Vault on | Defender for Cloud plan |
- Trusted services and perimeters: "Allow trusted Microsoft services to bypass this firewall" lets listed Azure services in; others, such as Azure DevOps, need a network rule or private endpoint. Setting
publicNetworkAccesstoSecuredByPerimeterunder a network security perimeter overrides the trusted-services bypass, so test dependent services first. Disabling public access does not remove the vault's public DNS name. - Recovery behaviour: recovering a soft-deleted vault does not restore its RBAC assignments or Event Grid subscriptions; keep them in infrastructure as code so they can be reapplied.
- Backups: back up keys that cannot be recreated and test restores. A restored key in another vault is independent of the original.
- Small versus large estates: a small organisation can run a vault per application with RBAC and private endpoints without much tooling. A large estate needs vault creation through a landing zone module so the baseline is applied at birth, plus the policy initiative to catch drift. See the Azure Landing Zones Security Guide.
Framework mapping
| Control area | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 |
|---|---|---|
| RBAC, least privilege, PIM | AC-2, AC-6 | PR.AA-05 |
| Managed identities, rotation, expiry | IA-5 | PR.AA-01 |
| Key and certificate management | SC-12, SC-17 | PR.DS-01 |
| Private endpoints, firewall | SC-7 | PR.IR-01 |
| AuditEvent logging, Defender alerts | AU-2, AU-12, SI-4 | PR.PS-04, DE.CM-09 |
| Soft delete, purge protection, backup | CP-9 | PR.DS-01 |
Common misconfigurations
- Access policies left in place: Contributor-level operators can grant themselves data access, as in the Key Vault Contributor escalation, and there is no just-in-time path.
- Shared vaults: one vault for every application or for dev and prod together, so a single leaked identity or broad role exposes everything.
- Secrets Officer for applications: granting write and delete where the workload only needs to read, which lets a compromised app tamper with or destroy secrets.
- Public endpoint with "allow all networks": any stolen token works from anywhere on the internet.
- No purge protection on key vaults used for encryption: an attacker with the right role can destroy the key and, with it, access to the data it protects.
- Logs not enabled: after an incident nobody can say which secrets were read, so everything must be rotated.
Practitioner checklist
- Inventory all vaults for permission model, public network access, purge protection and diagnostic settings.
- Migrate access policy vaults to RBAC, mapping applications to Key Vault Secrets User or Crypto User.
- Make Owner, Contributor, Key Vault Contributor and Key Vault Administrator PIM-eligible with approval and MFA.
- Split shared vaults into one per application, environment and region.
- Disable public network access and use private endpoints; document every trusted-service dependency.
- Enable purge protection on every production vault and all vaults holding customer-managed keys.
- Replace client secrets used to reach the vault with managed identities or workload identity federation.
- Send AuditEvent logs to the SIEM and alert on bulk reads, access changes, deletes and Defender alerts.
- Set expiration dates and automate rotation from
SecretNearExpiryevents. - Update CLI, PowerShell, SDKs and templates for API version 2026-02-01 before February 2027.
Standards and references
- Microsoft Learn: Secure your Azure Key Vault
- Microsoft Learn: Provide access to Key Vault keys, certificates and secrets with Azure RBAC
- Microsoft Learn: Migrate to Azure RBAC from access policies
- Microsoft Learn: Prepare for Key Vault API version 2026-02-01 and later
- Microsoft Learn: Azure Key Vault soft-delete overview
- Microsoft Learn: Azure Key Vault logging
- Microsoft Learn: Azure Policy built-in definitions for Key Vault
- NIST: SP 800-53 Rev. 5
Related NHI Mgmt Group resources: Cloud Secrets Managers Guide · Azure Managed Identities Security Guide · Microsoft Azure Security Guide · Azure Storage Security Guide