이 제품은 선택한 Datadog 사이트에서는 지원되지 않습니다. ().
이 페이지는 아직 영어로 제공되지 않습니다. 현재 번역 작업을 진행 중입니다.
현재 번역 프로젝트에 대해 궁금한 점이나 의견이 있으시면 언제든지 문의하세요!

Metadata

Id: terraform-azure-storage-container-is-publicly-accessible

Provider: Azure

Platform: Terraform

Severity: High

Category: Access Control

Learn More

Description

When a storage container in Azure Blob Storage has container_access_type set to blob or container, it enables anonymous public access to the data stored within. This configuration creates a significant security risk as it allows anyone with the container URL to access, view, and potentially download the stored data without authentication, potentially leading to sensitive data exposure or unauthorized data access.

To secure your storage containers, always set container_access_type to private explicitly, or rely on the default value, which is also private. For example:

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

Avoid using the insecure configuration shown below:

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

Compliant Code Examples

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

resource "azurerm_storage_container" "negative2" {
  name                  = "vhds2"
  storage_account_name  = azurerm_storage_account.example.name
  // default is "private"
}

Non-Compliant Code Examples

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