More Info:
Ensure that Soft Delete feature is enabled for your Microsoft Azure Storage blob objects.Risk Level
MediumAddress
SecurityCompliance Standards
CISAZURE, CBPTriage and Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration of not having Soft Delete enabled for Azure Blob Storage, you can follow the below steps using the Azure console:
- Open the Azure portal and navigate to the storage account that needs to be updated.
- Click on the “Configuration” tab in the left-hand menu.
- Scroll down to the “Blob service” section and click on “Data protection”.
- Under “Soft delete”, toggle the switch to “Enabled”.
- Set the “Retention period” to the desired number of days for which you want to retain the deleted data.
- Click on “Save” to apply the changes.
Using CLI
Using CLI
To enable Soft Delete for Azure Blob Storage using Azure CLI, follow these steps:
- Open Azure CLI on your local machine or use the Azure Cloud Shell.
- Login to your Azure account using the following command:
- Once you are logged in, set the subscription where the storage account is located using the following command:
Replace
<subscription_id>
with the ID of your subscription. - Next, get the resource ID of the storage account for which you want to enable Soft Delete using the following command:
Replace
<storage_account_name>
with the name of your storage account and<resource_group_name>
with the name of the resource group where the storage account is located. - Once you have the resource ID, enable Soft Delete for the storage account using the following command:
Replace
<resource_id>
with the resource ID you obtained in step 4. - Verify that Soft Delete has been enabled by running the following command:
Replace
<storage_account_name>
with the name of your storage account and<resource_group_name>
with the name of the resource group where the storage account is located.
Using Python
Using Python
To enable soft delete for Azure Blob Storage using Python, you can follow these steps:Note: Replace
- Import the necessary libraries:
- Set up the connection to your Azure Blob Storage account:
- Retrieve the Blob Container for which you want to enable soft delete:
- Check if the container has soft delete enabled:
- Save the changes:
- Verify that soft delete is enabled:
<your_account_name>
and <your_account_key>
with your Azure Blob Storage account name and account key, respectively. Also, replace <your_container_name>
with the name of the container for which you want to enable soft delete.