Review Azure Key Vault soft-delete protection

Check Key Vault recovery protection and any required protection against permanent deletion.

Description

Key Vault soft delete lets you recover a deleted vault, key, secret or certificate during its retention period. New vaults enable it by default. Once enabled, it cannot be turned off.

Potential impact

Services that rely on a deleted key or secret can stop working. Without purge protection, someone with purge permission can permanently delete it before the recovery window ends.

Remediation

Check soft delete and retention on the deployed vault. Remove old settings that try to disable soft delete. Enable purge protection if deleted items must remain recoverable throughout retention.

Examples

The legacy enable_soft_delete: no cannot turn off existing protection. The second task requests yes. Both omit SKU and access settings.

Before

yaml
- name: Key Vault 생성
  azure_rm_keyvault:
    resource_group: myResourceGroup
    vault_name: samplekeyvault
    enabled_for_deployment: yes
    enable_soft_delete: no
    vault_tenant: 72f98888-8666-4144-9199-2d7cd0111111

After

yaml
- name: Key Vault 생성
  azure_rm_keyvault:
    resource_group: myResourceGroup
    vault_name: samplekeyvault
    enabled_for_deployment: yes
    enable_soft_delete: yes
    vault_tenant: 72f98888-8666-4144-9199-2d7cd0111111

References