| name | cis-azure-storage-8.1 |
| description | Ensure soft delete for Azure File Shares is Enabled |
| category | cis-azure-storage |
| version | 1.0.0 |
| author | cyberstrike-official |
| tags | ["cis","azure","storage","azure-files","soft-delete"] |
| cis_id | 8.1 |
| cis_benchmark | CIS Microsoft Azure Storage Services Benchmark v1.0.0 |
| tech_stack | ["azure"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
8.1 Ensure soft delete for Azure File Shares is Enabled (Automated)
Description
Azure Files offers soft delete for file shares, allowing you to easily recover your data when it is mistakenly deleted by an application or another storage account user.
Rationale
Important data could be accidentally deleted or removed by a malicious actor. With soft delete enabled, the data is retained for the defined retention period before permanent deletion, allowing for recovery of the data.
Impact
When a file share is soft-deleted, the used portion of the storage is charged for the indicated soft-deleted period. All other meters are not charged unless the share is restored.
Audit Procedure
Audit from Azure Portal
- Go to
Storage Accounts.
- For each storage account with file shares, under
Data storage, click on File shares.
- Under
File share settings, ensure the value for Soft delete shows a number of days between 1 and 365, inclusive.
Audit from Azure CLI
Run the following command to list storage accounts:
az storage account list
Run the following command to determine if a storage account has file shares:
az storage share list --account-name <storage-account>
For each storage account with file shares, run the following command:
az storage account file-service-properties show --resource-group <resource-group> --account-name <storage-account>
Ensure that under shareDeleteRetentionPolicy, enabled is set to true, and days is set to an appropriate value between 1 and 365, inclusive.
Audit from PowerShell
Run the following command to list storage accounts:
Get-AzStorageAccount -ResourceGroupName <resource-group>
With a storage account context set, run the following command to determine if a storage account has file shares:
Get-AzStorageShare
For each storage account with file shares, run the following command:
Get-AzStorageFileServiceProperty -ResourceGroupName <resource-group> -AccountName <storage-account>
Ensure that ShareDeleteRetentionPolicy.Enabled is set to and is set to an appropriate value between 1 and 365, inclusive.