π‘οΈ 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 the key vault be made recoverable by enabling the "purge protection" function. This is to prevent the loss of encrypted data, including storage accounts, SQL databases, and/or 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 will need to be recreated after recovery.
Rationaleβ
Users may accidentally run delete/purge commands on a key vault, or an attacker or malicious user may do so deliberately 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 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 <key-vault> --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> -VaultName <key-vault> -EnablePurgeProtection