| name | cis-azure-storage-11.5 |
| description | Ensure 'Versioning' is set to 'Enabled' on Azure Blob Storage storage accounts |
| category | cis-azure-storage |
| version | 1.0.0 |
| author | cyberstrike-official |
| tags | ["cis","azure","storage","blob-storage","versioning"] |
| cis_id | 11.5 |
| cis_benchmark | CIS Microsoft Azure Storage Services Benchmark v1.0.0 |
| tech_stack | ["azure"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
11.5 Ensure 'Versioning' is set to 'Enabled' on Azure Blob Storage storage accounts (Automated)
Description
Enabling blob versioning allows for the automatic retention of previous versions of objects. With blob versioning enabled, earlier versions of a blob are accessible for data recovery in the event of modifications or deletions.
Rationale
Blob versioning safeguards data integrity and enables recovery by retaining previous versions of stored objects, facilitating quick restoration from accidental deletion, modification, or malicious activity.
Impact
Enabling blob versioning for a storage account creates a new version with each write operation to a blob, which can increase storage costs. To control these costs, a lifecycle management policy can be applied to automatically delete older versions.
Audit Procedure
Audit from Azure Portal
- Go to
Storage accounts.
- Click the name of a storage account with blob storage.
- In the
Overview page, on the Properties tab, under Blob service, ensure Versioning is set to Enabled.
- Repeat steps 1-3 for each storage account with blob storage.
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 containers:
az container list --account-name <storage-account>
For each storage account with containers, ensure that the output of the below command contains "isVersioningEnabled": true:
az storage account blob-service-properties show --account-name <storage-account>
Audit from PowerShell
Run the following command to list storage accounts:
Get-AzStorageAccount
Run the following command to create an Azure Storage context for a storage account:
$context = New-AzStorageContext -StorageAccountName <storage-account>
Run the following command to list containers for the storage account:
Get-AzStorageContainer -Context $context
If the storage account has containers, run the following command to get the blob service properties of the storage account:
$account = Get-AzStorageBlobServiceProperty -ResourceGroupName <resource-group> -AccountName <storage-account>