Skip to main content

Triage and Remediation

Remediation

Using Console

Sure, here are the step-by-step instructions to enable Key Vault Recoverability in Azure using the Azure console:
  1. Log in to the Azure portal (https://portal.azure.com).
  2. Navigate to the Key Vault that needs to be remediated.
  3. Click on the “Properties” tab.
  4. Scroll down to the “Soft delete” section and click on the “Configure” button.
  5. In the “Soft delete” blade, toggle the “Recoverable” switch to the “On” position.
  6. Set the “Retention period” to the desired number of days.
  7. Click on the “Save” button to save the changes.
  8. Once the changes are saved, the Key Vault will have recoverability enabled.
That’s it! You have successfully remediated the misconfiguration of Key Vault Recoverability in Azure using the Azure console.

To enable Key Vault Recoverability in AZURE using AZURE CLI, follow these steps:
  1. Open the AZURE CLI on your local machine or use the AZURE Cloud Shell.
  2. Login to your AZURE account using the following command:
  1. Once you are logged in, set the subscription where your Key Vault is located using the following command:
  1. Next, enable soft delete for the Key Vault using the following command:
  1. Finally, enable purge protection for the Key Vault using the following command:
That’s it! You have now enabled Key Vault Recoverability for your AZURE Key Vault.
To enable Key Vault Recoverability in Azure using Python, follow these steps:
  1. First, you need to install the azure-mgmt-keyvault package. You can do this by running the following command:
  2. Next, you need to authenticate with Azure. You can do this by creating a ServicePrincipalCredentials object and passing in your Azure credentials:
  3. Once you’re authenticated, you can create a KeyVaultManagementClient object and use it to enable recoverability:
    This code will enable both soft delete and purge protection for the specified Key Vault.
  4. Finally, you can verify that recoverability has been enabled by checking the enable_soft_delete and enable_purge_protection properties of the vault:
And that’s it! You have successfully enabled Key Vault Recoverability in Azure using Python.
Enabling purge_protection_enabled = true is irreversible on this vault; after it is turned on, it cannot be disabled without recreating the vault and losing its contents, so this change can be operationally impactful.Verification: terraform plan should show an in-place update to azurerm_key_vault.THIS_VAULT setting purge_protection_enabled from false (or unset) to true and updating soft_delete_retention_days if it was different.