π Azure Key Vault Soft Delete and Purge Protection functions are not enabled π’
- Contextual name: π Soft Delete and Purge Protection functions are not enabled π’
- ID:
/ce/ca/azure/key-vault/soft-delete-and-purge-protection
- Located in: π Azure Key Vault
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
SECURITY
Similar Policiesβ
- Cloud Conformity
- Internal
dec-x-0be4dfe5
Similar Internal Rulesβ
Rule | Policies | Flags |
---|---|---|
βοΈ dec-x-0be4dfe5 | 1 |
Logicβ
- π§ prod.logic.yaml π’
- π Azure Key Vault
- π Azure Key Vault - object.extracts.yaml
- π§ͺ test-data.json
Descriptionβ
Descriptionβ
The Key Vault contains object keys, secrets, and certificates. Accidental unavailability of a Key Vault can cause immediate data loss or loss of security functions (authentication, validation, verification, non-repudiation, etc.) supported by the Key Vault objects.
It is recommended the Key Vault be made recoverable by enabling the "Do Not Purge" and "Soft Delete" functions. This is in order to prevent loss of encrypted data, including storage accounts, SQL databases, and/or dependent services provided by Key Vault objects (Keys, Secrets, Certificates) etc. This may happen in the case of accidental deletion by a user or from disruptive activity by a malicious user.
NOTE: In February 2025, Microsoft will enable soft-delete protection on all key vaults, and users will no longer be able to opt out of or turn off soft-delete.
WARNING: A current limitation is that role assignments disappearing when Key Vault is deleted. All role assignments will need to be recreated after recovery.
Rationaleβ
There could be scenarios where users accidentally run delete/purge commands on Key Vault or an attacker/malicious user deliberately does so in order to cause disruption. Deleting or purging a Key Vault leads to immediate data loss, as keys encrypting data and secrets/certificates allowing access/services will become non-accessible.
... see more
Remediationβ
Remediationβ
To enable
Do Not Purge
andSoft Delete
for a Key Vault:From Azure Portalβ
Go to
Key Vaults
.For each Key Vault.
Click
Properties
.Ensure the status of Purge protection reads
Enable purge protection (enforce a mandatory retention period for deleted vaults and vault objects)
.Note: once enabled you cannot disable it.
From Azure CLIβ
az resource update --id /subscriptions/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/<resourceGroupName>/providers/Microsoft.KeyVault /vaults/<keyVaultName> --set properties.enablePurgeProtection=true
From PowerShellβ
Update-AzKeyVault -VaultName <vaultName> -ResourceGroupName <resourceGroupName> -EnablePurgeProtection