Skip to content

Files

Latest commit

 

History

History
41 lines (30 loc) · 1.34 KB

azure-storage-enforce-https.md

File metadata and controls

41 lines (30 loc) · 1.34 KB

Pattern: Use of HTTP for Azure storage

Issue: -

Description

You can configure your storage account to accept requests from secure connections only by setting the Secure transfer required property for the storage account.

When you require secure transfer, any requests originating from an insecure connection are rejected.

Microsoft recommends that you always require secure transfer for all of your storage accounts.

Resolution: Only allow secure connection for transferring data into storage accounts.

Examples

Example of incorrect code:

resource "azurerm_storage_account" "bad_example" {
  name                      = "storageaccountname"
  resource_group_name       = azurerm_resource_group.example.name
  location                  = azurerm_resource_group.example.location
  account_tier              = "Standard"
  account_replication_type  = "GRS"
  enable_https_traffic_only = false
}

Example of correct code:

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"
  enable_https_traffic_only = true
}