π‘οΈ Azure Key Vault Purge Protection function is not enabledπ’
- Contextual name: π‘οΈ Purge Protection function is not enabledπ’
- ID:
/ce/ca/azure/key-vault/soft-delete-and-purge-protection - Tags:
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
SECURITY
Logicβ
- π§ prod.logic.yamlπ’
- π Azure Key Vault
- π Azure Key Vault - object.extracts.yaml
- π§ͺ test-data.json
Similar Policiesβ
- Cloud Conformity: Enable Key Vault Recoverability
- Internal:
dec-x-0be4dfe5
Similar Internal Rulesβ
| Rule | Policies | Flags |
|---|---|---|
| βοΈ dec-x-0be4dfe5 | 1 |
Descriptionβ
Descriptionβ
Key Vaults contain object keys, secrets, and certificates. Deletion 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 that the Key Vault be made recoverable by enabling the "purge protection" function. This prevents the loss of encrypted data, including storage accounts, SQL databases, and dependent services provided by Key Vault objects (keys, secrets, certificates, etc.).
Note: In February 2025, Microsoft enabled soft delete protection on all Key Vaults. Users can no longer opt out of or turn off soft delete.
WARNING: A current limitation is that role assignments disappear when a Key Vault is deleted. All role assignments must be recreated after recovery.
Rationaleβ
Users may accidentally run delete or purge commands on a Key Vault, or an attacker or malicious user may do so deliberately to cause disruption. Deleting or purging a Key Vault leads to immediate data loss, as keys encrypting data and secrets or certificates allowing access to services become inaccessible.
... see more
Remediationβ
Remediationβ
Note: Once enabled, purge protection cannot be disabled.
From Azure Portalβ
- Go to
Key Vaults.- Click the name of a key vault.
- Under
Settings, clickProperties.- Select the radio button next to
Enable purge protection (enforce a mandatory retention period for deleted vaults and vault objects).- Click
Save.- Repeat steps 1-5 for each key vault requiring remediation.
From Azure CLIβ
For each key vault requiring remediation, run the following command to enable purge protection:
az resource update \
--resource-group {{resource-group-name}} \
--name {{key-vault-name}} \
--resource-type "Microsoft.KeyVault/vaults" \
--set properties.enablePurgeProtection=trueFrom PowerShellβ
For each key vault requiring remediation, run the following command to enable purge protection:
Update-AzKeyVault `
-ResourceGroupName {{resource-group-name}} `
-VaultName {{key-vault-name}} `
-EnablePurgeProtection