설명
Azure Container Registry의 관리자 계정은 공유 사용자 이름과 비밀번호로 레지스트리 전체의 이미지를 가져오거나 게시할 수 있습니다.
잠재적 영향
계정을 공유하면 누가 이미지를 바꿨는지 확인하거나 한 사용자의 접근만 해제하기 어렵습니다. 비밀번호가 유출되면 다른 배포에서 사용하는 이미지까지 바뀔 수 있습니다.
해결 방법
사용자는 개인 Microsoft Entra ID로, 워크로드는 지원되는 관리 ID나 서비스 주체로 전환하세요. 각 ID로 필요한 이미지 가져오기 또는 게시가 되는지 확인한 뒤 admin_enabled = false를 적용하세요. 관리자 계정이 꼭 필요한 연동은 사용 범위를 제한하고 비밀번호를 보호·교체하세요. 노출된 비밀번호는 재발급하고 연동을 다시 시험하세요.
예시
예시는 같은 Premium 레지스트리에서 관리자 계정만 끕니다. 사용 가능한 전역 고유 이름을 지정하세요. 새 ID와 역할은 별도로 구성해야 합니다.
변경 전
hcl
resource "azurerm_resource_group" "example" {
name = "resourceGroup1"
location = "West US"
}
resource "azurerm_container_registry" "example" {
name = "containerRegistry1"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
sku = "Premium"
admin_enabled = true
georeplications {
location = "East US"
}
georeplications {
location = "West Europe"
}
}
변경 후
hcl
resource "azurerm_resource_group" "example" {
name = "resourceGroup1"
location = "West US"
}
resource "azurerm_container_registry" "example" {
name = "containerRegistry1"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
sku = "Premium"
admin_enabled = false
georeplications {
location = "East US"
}
georeplications {
location = "West Europe"
}
}