MEDIUM
Source
Trivy
ID
AVD-AZU-0056

Storage account should have blob soft delete enabled

Blob soft delete protects blob data from being accidentally or erroneously modified or deleted. When blob soft delete is enabled, deleted blobs are retained in the system for a specified retention period. During the retention period, you can restore a soft-deleted blob to its state at the time it was deleted.

Impact

Follow the appropriate remediation steps below to resolve the issue.

Enable soft delete for blobs with an appropriate retention period

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
resource "azurerm_storage_account" "good_example" {
  name                     = "storageaccountname"
  resource_group_name      = azurerm_resource_group.example.name
  location                 = azurerm_resource_group.example.location
  account_tier             = "Standard"
  account_replication_type = "GRS"

  blob_properties {
    delete_retention_policy {
      days = 7
    }
  }
}