Azure Storage Container allows anonymous reads

Set Blob containers to private when public access is not required.

Description

When the account permits anonymous access and the network permits the connection, blob allows anyone with a blob’s URL to read it. container also allows listing the blobs. Neither grants anonymous writes.

Potential impact

Private files can be read without signing in. Listing also exposes names and storage structure.

Remediation

Separate intentionally public data and set container_access_type = "private" on protected containers. Disable anonymous reads on the account if no container needs them. From an allowed network, test the same blob anonymously and with the required data permission or valid SAS. Only the authorized read should succeed.

Examples

Both excerpts target vhds and omit account settings. They use AzureRM syntax that supports storage_account_name.

Before

hcl
resource "azurerm_storage_container" "artifact_container" {
  name                  = "vhds"
  storage_account_name  = azurerm_storage_account.example.name
  container_access_type = "blob"
}

After

hcl
resource "azurerm_storage_container" "artifact_container" {
  name                  = "vhds"
  storage_account_name  = azurerm_storage_account.example.name
  container_access_type = "private"
}

References