설명
내부 API나 파트너 연동에서 클라이언트 인증서가 필요하면 App Service가 HTTPS 연결 시 인증서 제출을 요구하도록 설정하세요. 전달받은 인증서를 신뢰할 수 있는지 판단하는 주체는 앱입니다.
잠재적 영향
신뢰 체인과 호출 권한을 확인하지 않으면 인증서를 제출한 것만으로 민감한 기능에 접근할 수 있습니다.
해결 방법
현재 리소스에서는 client_certificate_enabled를 켜고 client_certificate_mode를 Required로 지정하세요. 앱에서 인증서 체인, 유효 기간, 호출자의 신원과 권한을 확인하고 신뢰할 수 없는 인증서나 인증서가 없는 요청이 보호된 경로에서 거부되는지 시험하세요. 앱에서 HTTP/2나 TLS 1.3이 필요하면 TLS 재협상이 필요한 모드를 피하고 클라이언트 인증서 제외 경로를 모두 제거하세요.
예시
AzureRM 3.x의 azurerm_app_service 예시는 client_cert_enabled = true만 추가합니다. HTTPS 적용과 앱의 인증서 검증은 별도입니다.
변경 전
hcl
resource "azurerm_app_service" "example" {
name = "example-app-service"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
}
변경 후
hcl
resource "azurerm_app_service" "example" {
name = "example-app-service"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
app_service_plan_id = azurerm_app_service_plan.example.id
client_cert_enabled = true
}