설명
앱과 운영 도구가 계정 키를 공유하면 Azure Storage에서 각 사용처의 데이터 접근 권한을 나누거나 작업 주체를 구분하기 어렵습니다.
잠재적 영향
키가 유출되면 데이터를 읽거나 수정할 수 있습니다. Shared Key를 끄면 계정 키로 서명한 서비스 SAS와 계정 SAS도 거부됩니다.
해결 방법
Azure Files를 포함해 각 클라이언트가 지원하는 인증 방식을 확인하세요. 지원되는 Microsoft Entra 인증과 필요한 데이터 역할로 전환하고 실제 작업을 시험한 뒤 shared_access_key_enabled = false를 적용하세요. 사용 중인 SAS도 종류별로 점검하세요. 유효한 Blob 사용자 위임 SAS는 계속 사용할 수 있습니다.
예시
두 번째 예시는 다른 이름의 Premium FileStorage 계정으로 리소스 그룹, 리전과 복제 방식도 바꿉니다. 기존 계정의 인증만 바꿀 때는 계정 이름, 종류와 배포 설정을 유지하세요.
변경 전
hcl
resource "azurerm_storage_account" "example" {
name = "examplestorage"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
account_tier = "Standard"
account_replication_type = "GRS"
shared_access_key_enabled = true
}
변경 후
hcl
resource "azurerm_storage_account" "example" {
name = "safestorage"
resource_group_name = "testRG"
location = "northeurope"
account_tier = "Premium"
account_replication_type = "LRS"
account_kind = "FileStorage"
shared_access_key_enabled = false
}