Join our Newsletter — 33% off our NHI Course
Home› Guides› Azure Key Vault Security Guide: RBAC, Purge Protection…
Guide Cloud Security

Azure Key Vault Security Guide: RBAC, Purge Protection and Network Isolation

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 8 November 2026 13 min read
On this page

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.

AspectAzure RBAC (enableRbacAuthorization true)Vault access policies (false or null)
StatusDefault and recommended; default for new vaults from API version 2026-02-01Legacy; still supported, with Microsoft recommending a move to Azure RBAC
ScopeManagement group, subscription, resource group, vault, or a single key, secret or certificateVault only
Who can grant data accessHolders 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 accessPIM eligible assignments with approval and MFANot supported
ConditionsAzure ABAC conditions on secret data actions (preview at the time of writing)None
Change visibilityRole assignment events in the Activity logVault 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 templateAzure RBAC equivalent
Key, Secret, Certificate ManagementKey Vault Administrator
Key and Secret ManagementKey Vault Crypto Officer plus Key Vault Secrets Officer
Secret ManagementKey Vault Secrets Officer
Certificate ManagementKey Vault Certificates Officer
SQL Server Connector, Exchange Online Customer KeyKey Vault Crypto Service Encryption User
Azure Storage or Data Lake Storage, Azure Backup, Azure Information BYOKCustom role required
  1. Inventory: list vaults with properties.enableRbacAuthorization false or null across subscriptions, and export each vault's accessPolicies.
  2. 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.
  3. 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.
  4. Pilot: switch non-production vaults, watch for HTTP 403 results in AuditEvent logs, then move production vaults in rings.
  5. 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.
  6. Enforce: assign the built-in policy Azure Key Vault should use RBAC permission model in Audit, then Deny.
  7. 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.

PermissionHeld byRiskControl
Microsoft.KeyVault/vaults/writeOwner, Contributor, Key Vault ContributorOn access policy vaults: add self to the policy and read everything. On any vault: open the firewall, switch the permission modelMigrate to RBAC; PIM-eligible only; Deny policies on network and model settings
Microsoft.Authorization/roleAssignments/writeOwner, User Access Administrator, Key Vault Data Access Administrator (constrained)Grant any data role on RBAC vaultsPIM with approval; alert on role assignments at vault scope
Purge (locations/deletedVaults/purge/action)Subscription Owner, Key Vault Purge OperatorIrrecoverable destruction of a soft-deleted vaultPurge protection; no standing assignments
Key Vault AdministratorPlatform or security teamRead every value in the vaultPIM 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.

DetectionDataATT&CK v20
Identity reads many secrets it does not normally read, or lists then gets in bulkAuditEvent SecretGet count per identity against baselineT1555.006 Cloud Secrets Management Stores
Repeated 403 results from one callerAuditEvent resultSignatureT1555.006 (discovery of reachable vaults)
New role assignment or access policy change on a vaultActivity log role assignment writes; VaultAccessPolicyChangedEventGridNotificationT1098.003 Additional Cloud Roles
Firewall opened, public access enabled, permission model changedActivity log vault write; Azure Policy compliance changeT1098 Account Manipulation
Secret, key or vault deleted, or purge attemptedAuditEvent delete operations; Activity log purgeT1485 Data Destruction
Access from unfamiliar IP, Tor or unusual applicationMicrosoft Defender for Key Vault alertsT1078.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 enableRbacAuthorization true, 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.

ControlSettingBuilt-in policy
Permission modelenableRbacAuthorization trueAzure Key Vault should use RBAC permission model
Soft deleteOn (permanent once on); retention 7 to 90 days, default 90, set only at creationKey vaults should have soft delete enabled
Purge protectionOn; cannot be disabled afterwardsKey vaults should have deletion protection enabled
NetworkPublic network access disabled, private endpointAzure Key Vault should disable public network access; Azure Key Vaults should use private link
Firewall fallbackSelected networks only where a private endpoint is not possibleAzure Key Vault should have firewall enabled or public network access disabled
LoggingAuditEvent to Log AnalyticsResource logs in Key Vault should be enabled; Deploy Diagnostic Settings for Key Vault to Log Analytics workspace
ExpiryExpiration date on secrets and keysKey Vault secrets should have an expiration date; Key Vault keys should have an expiration date
CertificatesMaximum validity and lifetime actionsCertificates should have the specified maximum validity period
Threat detectionDefender for Key Vault onDefender 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 publicNetworkAccess to SecuredByPerimeter under 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 areaNIST SP 800-53 Rev. 5NIST CSF 2.0
RBAC, least privilege, PIMAC-2, AC-6PR.AA-05
Managed identities, rotation, expiryIA-5PR.AA-01
Key and certificate managementSC-12, SC-17PR.DS-01
Private endpoints, firewallSC-7PR.IR-01
AuditEvent logging, Defender alertsAU-2, AU-12, SI-4PR.PS-04, DE.CM-09
Soft delete, purge protection, backupCP-9PR.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 SecretNearExpiry events.
  • Update CLI, PowerShell, SDKs and templates for API version 2026-02-01 before February 2027.

Standards and references

Related NHI Mgmt Group resources: Cloud Secrets Managers Guide · Azure Managed Identities Security Guide · Microsoft Azure Security Guide · Azure Storage Security Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 8 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.