1. Resources
  2. Detection rules
  3. Soft-Deleted Key Vault or Secret Recovered

Soft-Deleted Key Vault or Secret Recovered detection rules

Someone recovers a deleted Azure key vault, or a deleted secret, key or certificate inside a vault. Recovery brings back credentials that their owner believed were gone, and makes them readable again.

Platform
Azure
Severity
Medium
Log source
Azure Key Vault resource logs (AuditEvent)
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft Sentinel
What an attacker needs
The recover permission on the vault's objects, or Key Vault Contributor for a deleted vault, and an object whose credential was never revoked at its source.
Impact
Access to credentials that were taken out of use but still work, with little chance that anyone watches for their use.
Response
Rotate at its source every credential in the recovered secret or vault, remove the caller's recover permission and delete the object again.
Mitigation
Revoke a credential at its source before deleting its secret, and keep the recover permission and the officer roles to a few identities.
Key Vault operations
SecretRecoverKeyRecoverCertificateRecoverVaultRecover

How the attack works

With soft delete, a deleted key vault and a deleted secret, key or certificate are not destroyed. They stay in a deleted state for the retention period of the vault, 7 to 90 days, and Microsoft documents that an object in that state can only be listed, recovered or purged. Recovery reverses the deletion: the object, or the whole vault with its content, is available again under the same name. Soft delete is on by default for new vaults and cannot be turned off, so every vault has this second life for what was deleted from it.

Teams often delete a secret as the last step of retiring a credential, and delete a vault when a project ends, without revoking each credential at the system that accepts it. An attacker who holds the recover permission lists what is in the deleted state, recovers it and reads it like any other secret. Microsoft Defender for Resource Manager has an alert for this, "Suspicious key vault recovery detected", and describes it as a possible attempt to discover secrets and keys to gain access to sensitive resources or to move laterally. The vault's resource log (category AuditEvent) records the recovery of an object as SecretRecover, KeyRecover or CertificateRecover and the recovery of a vault as VaultRecover. The log exists only when a diagnostic setting on the vault exports it. Through Azure Resource Manager a vault is recovered with a create request whose create mode is recover, so the Azure Activity log shows that step as a write to the vault.

What an attacker needs

  • For an object: the recover permission on secrets, keys or certificates in the vault's access policy, or an Azure role that includes the recover data action, such as Key Vault Secrets Officer, Key Vault Crypto Officer, Key Vault Certificates Officer or Key Vault Administrator.
  • For a vault: Microsoft names the Key Vault Contributor role as the permission to recover a soft-deleted vault. Owner and Contributor include it.
  • An object or a vault that is still inside its retention period and whose credentials were not revoked at their source.

Impact

Access to credentials that were taken out of use but never invalidated: old database passwords, API keys and certificates that the target systems still accept. Because nobody expects a deleted secret to be read, its use is less likely to be noticed. A recovered vault comes back with its content. Microsoft documents that the Azure role assignments of a soft-deleted vault are deleted and that recovery does not restore them, so check who has access to a recovered vault before it is used again.

Detection rules

Deleted Key Vault Secret, Key or Certificate Recovered

Detects the successful recovery of a soft-deleted secret, key or certificate in an Azure key vault (operations SecretRecover, KeyRecover and CertificateRecover in the vault's AuditEvent resource log). Recovery reverses the deletion and puts the object back under its name, so a credential that was deleted but never revoked at its source can be read again. Most recoveries undo an accidental deletion, so compare the caller with the one that deleted the object and look for reads that follow. The log exists only where a diagnostic setting on the vault exports the AuditEvent category.

LevelMediumStatusExperimentalLog sourceAzure Key Vault resource logs (AuditEvent)
title: Deleted Key Vault Secret, Key or Certificate Recovered
id: af56337b-d3ff-42e7-a8d1-7a5c06388636
status: experimental
description: >-
  Detects the successful recovery of a soft-deleted secret, key or certificate
  in an Azure key vault (operations SecretRecover, KeyRecover and
  CertificateRecover in the vault's AuditEvent resource log). Recovery
  reverses the deletion and puts the object back under its name, so a
  credential that was deleted but never revoked at its source can be read
  again. Most
  recoveries undo an accidental deletion, so compare the caller with the one
  that deleted the object and look for reads that follow. The log exists only
  where a diagnostic setting on the vault exports the AuditEvent category.
references:
  - https://attack.mitre.org/techniques/T1555/006/
  - https://learn.microsoft.com/en-us/azure/key-vault/general/logging
  - https://learn.microsoft.com/en-us/azure/key-vault/general/soft-delete-overview
  - https://learn.microsoft.com/en-us/azure/key-vault/general/key-vault-recovery
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1555.006
logsource:
  product: azure
  service: keyvault
detection:
  selection:
    OperationName:
      - SecretRecover
      - KeyRecover
      - CertificateRecover
    ResultType: Success
  condition: selection
falsepositives:
  - An administrator or a pipeline that undoes an accidental deletion. Match the recovery to a ticket and to the caller that deleted the object.
  - Infrastructure-as-code tools that recover a soft-deleted object of the same name before they create it again. Exclude their addresses in a filter_ selection by CallerIpAddress once confirmed.
level: medium

False positives

  • An administrator or a pipeline that undoes an accidental deletion. Match the recovery to a ticket and to the caller that deleted the object.
  • Infrastructure-as-code tools that recover a soft-deleted object of the same name before they create it again. Exclude their addresses in a filter_ selection by CallerIpAddress once confirmed.

Soft-Deleted Key Vault Recovered

Detects the recovery of a soft-deleted Azure key vault, recorded as the operation VaultRecover in the vault's AuditEvent resource log. A recovered vault returns with the secrets, keys and certificates it held. Microsoft Defender for Resource Manager describes a suspicious vault recovery as a possible attempt to discover secrets and keys. The rule matches on the operation name and the result only. The record reaches a SIEM only if the recovered vault has a diagnostic setting at that moment, and Microsoft's documentation does not say whether a diagnostic setting survives the deletion of its vault, so confirm on a test vault that this record arrives. In the Azure Activity log the same step is a write to the vault, which the rule Azure Key Vault Updated in this library reads.

LevelMediumStatusExperimentalLog sourceAzure Key Vault resource logs (AuditEvent)
title: Soft-Deleted Key Vault Recovered
id: 559bf8ca-915f-435d-8cce-ac8576e1c316
status: experimental
description: >-
  Detects the recovery of a soft-deleted Azure key vault, recorded as the
  operation VaultRecover in the vault's AuditEvent resource log. A recovered
  vault returns with the secrets, keys and certificates it held. Microsoft
  Defender for Resource Manager describes a suspicious vault
  recovery as a possible attempt to discover secrets and keys. The rule
  matches on the operation name and the result only. The record reaches a SIEM
  only if the recovered vault has a diagnostic setting at that moment, and
  Microsoft's documentation does not say whether a diagnostic setting survives
  the deletion of its vault, so confirm on a test vault that this record
  arrives. In the Azure Activity log the same step is a write to the vault,
  which the rule Azure Key Vault Updated in this library reads.
references:
  - https://attack.mitre.org/techniques/T1555/006/
  - https://learn.microsoft.com/en-us/azure/key-vault/general/logging
  - https://learn.microsoft.com/en-us/azure/key-vault/general/key-vault-recovery
  - https://learn.microsoft.com/en-us/azure/defender-for-cloud/alerts-resource-manager
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1555.006
logsource:
  product: azure
  service: keyvault
detection:
  selection:
    OperationName: VaultRecover
    ResultType: Success
  condition: selection
falsepositives:
  - Recovery of a vault that was deleted by mistake, or that an infrastructure-as-code tool recovers before it deploys a vault of the same name. Match the recovery to a ticket and to the caller that deleted the vault.
level: medium

False positives

  • Recovery of a vault that was deleted by mistake, or that an infrastructure-as-code tool recovers before it deploys a vault of the same name. Match the recovery to a ticket and to the caller that deleted the vault.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Object recovered by a different caller than the one that deleted it

Detection hypothesisJoins two logs

An administrator who deletes a secret by mistake recovers it soon after, from the same place. A recovery that comes from another address or identity, or long after the deletion, is not somebody undoing their own mistake. Microsoft Defender for Resource Manager uses the same idea for vaults: the user recovering the resource is different from the user that deleted it.

  1. In the Key Vault resource log, take each SecretRecover, KeyRecover or CertificateRecover record with ResultType Success. Keep ResourceId (the vault), CallerIpAddress, the identity claims and the object name from RequestUri.
  2. Find the earlier SecretDelete, KeyDelete or CertificateDelete record for the same object in the same vault.
  3. Compare CallerIpAddress and the identity claims of the two records, and the time between them. A different caller, or more than a day between deletion and recovery, is a starting point for review.

EventsSecretDeleteSecretRecoverKeyDeleteKeyRecoverCertificateDeleteCertificateRecover

LimitsA second administrator who repairs a colleague's mistake looks the same, so check for a ticket. The deletion can be older than the log retention of the SIEM, and then there is nothing to compare with. The one day is a starting point.

Deleted secret recovered and read from the same address shortly after

Detection hypothesisSequence of events

Recovering a secret is only useful to an attacker when the value is read afterwards. A recovery followed by a read of that secret from the same address, with no application using the secret again, is collection and not repair.

  1. In the Key Vault resource log, find SecretRecover with ResultType Success. Keep ResourceId, CallerIpAddress and the secret name from RequestUri.
  2. Within 60 minutes, find SecretGet with ResultType Success in the same vault whose Id names the same secret and whose CallerIpAddress is the same.
  3. Check whether any other address read the secret after the recovery. An application that starts using it again explains the recovery.

EventsSecretRecoverSecretGet

LimitsAn administrator who recovers a secret and checks its value in the portal produces the same two records. The 60 minutes are a starting point. An attacker who reads from a second address is not matched by the address comparison, so also review reads from any new address after a recovery.

Triage

  • Identify the vault, the object that was recovered (the object identifier of the record) and the caller. The record carries the caller's IP address and identity claims.
  • Find the deletion of the same object or vault. Check who deleted it and when, and whether the recovery is the same person undoing a mistake.
  • Check for a change request or an incident that explains the recovery. Recovering after an accidental deletion is the purpose of the feature.
  • Look at what the caller did next in the same vault, such as reads of the recovered secret, backups, or a new deletion that hides the recovery.
  • Find out whether the credential in the recovered secret is still valid at the system it belongs to.

Response

Once the attack is confirmed:

  1. Rotate or revoke at its source every credential that was in a recovered secret or in the recovered vault, whether or not a read is visible.
  2. Remove the recover permission or the role from the caller, revoke its sessions and rotate its credentials.
  3. Delete the recovered object again once the credential is invalid, and purge it if the vault's purge protection allows.
  4. For a recovered vault, review its access policies and role assignments before anyone uses it, and delete it again if it was not meant to return.
  5. Review the logs of the systems whose credentials were recovered for use of those credentials after the recovery.

Mitigation

  • Revoke or rotate a credential at its source before you delete its secret. Deleting the secret removes the copy in the vault, not the credential.
  • Keep the recover permission and the officer roles to a few identities, assigned through Privileged Identity Management. Applications that only read secrets need Key Vault Secrets User, which cannot recover.
  • Limit Key Vault Contributor, Contributor and Owner on the subscriptions that hold deleted vaults.
  • Create a diagnostic setting on every vault that sends the AuditEvent category to your SIEM, and send the Azure Activity log there as well.
  • Review the deleted objects of important vaults from time to time, and purge the ones that must never come back, where purge protection allows it.

Frequently asked questions

Why is recovering a deleted secret a security event?

A deleted secret often still holds a valid credential, because the secret was removed from the vault without the password, key or certificate being revoked at the system that accepts it. Recovery makes that credential readable again. Microsoft Defender for Resource Manager treats a suspicious vault recovery as a possible attempt to discover secrets and keys.

Does the Azure Activity log show the recovery of a secret?

No. Recovering a secret, key or certificate is a data-plane operation of the vault and is written to the vault's resource log, category AuditEvent, when a diagnostic setting exports it. The recovery of a whole vault through Azure Resource Manager is a write to the vault and does appear in the Activity log.

Is every recovery malicious?

No. Soft delete exists so that an accidental deletion can be undone, and that is what most recoveries are. The useful questions are who deleted the object, who recovered it, how much time passed and what was read afterwards. A recovery by a different identity, long after the deletion and followed by a read, deserves attention.

Does purge protection stop an attacker from recovering a deleted secret?

No. Purge protection prevents permanent deletion before the retention period has passed. It does not limit recovery, and it keeps deleted objects recoverable for the whole period. The control over recovery is the recover permission, so limit who holds it.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.