Review secure transfer for Azure Storage

Require encrypted connections for Storage requests.

Description

Set https_traffic_only_enabled = true to require HTTPS for Azure Storage REST requests.

Potential impact

Data and SAS tokens sent over HTTP can be read in transit.

Remediation

Switch existing clients to HTTPS first. After applying the setting, verify that a normal HTTPS request succeeds and that a credential-free HTTP request is rejected for insecure transfer. If you use Azure Files, also check encryption on SMB connections.

Examples

The examples use different account names. Keep the existing account name and resource group when changing only the transfer setting.

Before

hcl
resource "azurerm_storage_account" "example" {
  name                      = "example1"
  resource_group_name       = data.azurerm_resource_group.example.name
  location                  = data.azurerm_resource_group.example.location
  account_tier              = "Standard"
  account_replication_type  = "GRS"
  https_traffic_only_enabled = false
}

After

hcl
resource "azurerm_storage_account" "example" {
  name                      = "example"
  resource_group_name       = data.azurerm_resource_group.example.name
  location                  = data.azurerm_resource_group.example.location
  account_tier              = "Standard"
  account_replication_type  = "GRS"
  https_traffic_only_enabled = true
}

References