Skip to content

This tool is not affiliated with, endorsed by or sponsored by Microsoft Corporation. Azure, Microsoft Azure and Microsoft Defender for Cloud are trademarks of the Microsoft group of companies. Other names are trademarks of their respective owners.

Key Vault audit logs: who read which secret, and when

Use Azure Key Vault audit logs (AuditEvent) to find who read which secret: SecretGet and SecretList, access policy changes, new principals and enumeration.

Published on 6 min read

TL;DR. Secret reads are only visible in the Key Vault AuditEvent log, and only if a diagnostic setting was sending it somewhere before the incident. Look for SecretGet / SecretList by a principal that never touched the vault before, many distinct secrets read by one principal within an hour, and VaultAccessPolicyChangedEventGridNotification or Microsoft.KeyVault/vaults/accessPolicies/write just before. With the access-policy model, anyone holding Contributor on the vault can grant themselves data-plane access. If there are no logs, rotate every secret the identity could reach.

Key Vault is where attackers go right after they get a foothold with any real privilege, because that is where the database password, the payment API key and the backup encryption passphrase live. The good news: when logging is on, the Key Vault audit log is one of the most precise sources in Azure. Every request is recorded with the object URI, the caller identity and the IP.

What the AuditEvent log records

Microsoft's Key Vault logging reference documents the schema. The fields you use in an investigation:

FieldContentInvestigation use
timeUTC timestampTimeline
operationNameSecretGet, SecretList, KeyDecrypt, VaultGet…What was done
identity.claimObject ID (…/objectidentifier), appid, UPN for users, xms_mirid for managed identitiesWho
callerIpAddressClient IPFrom where
properties.idFull object URI, e.g. https://<vault>.vault.azure.net/secrets/<name>/<version>Which secret, which version
properties.clientInfoUser agent (SDK name and version, curl, python…)How
resultSignature / httpStatusCodeHTTP statusSuccess vs denied

The same data lands in the AzureDiagnostics table (with flattened identity_claim_* columns) or the resource-specific AZKVAuditLogs table in Log Analytics. In a storage account it is written to the insights-logs-auditevent container. Microsoft says entries are available at most ten minutes after the operation.

Operation names that matter

Operation names follow an ObjectVerb pattern. The ones that matter for credential theft:

OperationMeaningForensic weight
SecretGetRead a secret valueThe core evidence of credential access
SecretList, SecretListVersionsEnumerate names, not valuesReconnaissance before bulk reads
SecretBackup, KeyBackupExport an encrypted backup blobExfiltration of the whole object
KeyDecrypt, KeyUnwrapUse a key without extracting itData decryption by proxy
CertificateGetRead a certificate's properties and public part; an exportable private key is read through the certificate's backing secret, so it shows up as SecretGetCredential access
SecretPurge, KeyPurge, CertificatePurgePermanent deletionImpact / anti-forensics
VaultAccessPolicyChangedEventGridNotificationAccess policy changedLogged even without an Event Grid subscription
AuthenticationAuthentication via the Entra endpointContext

On the control-plane side, the Activity Log records Microsoft.KeyVault/vaults/accessPolicies/write (access-policy change), Microsoft.KeyVault/vaults/write (vault properties, including soft delete and purge protection) and Microsoft.KeyVault/locations/deletedVaults/purge/action.

The access-policy escalation

Key Vault has two permission models. With Azure RBAC, granting data-plane access requires Owner or User Access Administrator. With the legacy access policy model, Microsoft warns that users with Contributor, Key Vault Contributor or any role including Microsoft.KeyVault/vaults/write "can grant themselves data plane access" by editing the access policy (Azure RBAC vs. access policies).

In practice the chain looks like this, all within a few minutes:

  1. Activity Log: accessPolicies/write by principal X on vault V.
  2. Key Vault log: VaultAccessPolicyChangedEventGridNotification on V.
  3. Key Vault log: SecretList by X from the same IP.
  4. Key Vault log: a burst of SecretGet by X, one per secret.

MITRE ATT&CK tracks reading cloud secret stores as T1555.006 Cloud Secrets Management Stores.

What the analyzer flags

RuleDetectsLevel
AZ-KV-001A principal read secrets, keys or certificates from a vault it never accessed during the 72-hour learning periodHigh
AZ-KV-002One principal read at least 8 distinct secrets / keys / certificates from one vault within 60 minutesHigh
AZ-KV-003Access policy changed (Activity Log or Key Vault log)Medium
AZ-KV-004Soft delete or purge protection disabled, or vaults / objects purgedHigh
AZ-ID-002A managed identity used from an IP it never used before — often a token stolen from a VM and replayed against Key VaultHigh

AZ-KV-002 counts distinct objects, not requests: an application that reads the same connection string every hour never triggers it; a script that walks the vault does. Configuration loaders that read every secret at start-up are the known false positive.

Triage questions

  1. Was logging on? Check the coverage block of the analyzer or the vault's diagnostic settings history in the Activity Log (microsoft.insights/diagnosticSettings/write and /delete). A deleted diagnostic setting is itself a finding (defense evasion).
  2. Is the reader new? Compare with the baseline: which principals read this vault last week, from which IPs, with which client?
  3. How many distinct secrets? One secret read by a new principal can be an onboarding. Twelve in one minute from a Python SDK on a residential IP is not.
  4. Which client? clientInfo tells an application SDK from curl or an ad-hoc script. It can be spoofed, but a change is still informative.
  5. Denied requests? A string of 403s before success is typical of an attacker discovering what the identity can do.
  6. What did the secrets unlock? Each secret read is a new incident scope: the database, the payment provider, the SFTP partner.

Remediation

  • Rotate every secret, key and certificate read by the suspicious principal — and update the systems that consume them. Rotation without updating consumers causes an outage, so coordinate.
  • Remove unexpected access-policy entries; plan the move to the Azure RBAC permission model.
  • Ensure soft delete and purge protection are on.
  • Enable the AuditEvent diagnostic setting now if it was off, and protect it with Azure Policy.

FAQ

Does the Activity Log show Key Vault secret reads?

No. Reading a secret is a data-plane operation. It appears only in the Key Vault AuditEvent resource log, and only if a diagnostic setting sent that log somewhere before the read happened.

Can I recover Key Vault access logs if logging was not enabled?

No. Enabling the diagnostic setting now only records future operations. Assume every secret the compromised identity could read was read, and rotate them.

How quickly do Key Vault logs appear?

Microsoft states that logging information is available at most 10 minutes after the Key Vault operation, usually sooner.

Related articles

Think your Azure subscription is compromised? Which logs to preserve first, the operations that betray an attacker, and how to go from Activity Log to verdict.
Azure Activity Log retention is 90 days and resource logs are off by default. What each Azure log cannot tell you, and how to write an honest conclusion.
A fictional Azure breach investigated end to end: leaked app secret, self-assigned role, Run Command, stolen managed identity token, Key Vault and blob theft.

This tool is not affiliated with, endorsed by or sponsored by Microsoft Corporation. Azure, Microsoft Azure and Microsoft Defender for Cloud are trademarks of the Microsoft group of companies. Other names are trademarks of their respective owners.