설명
상호 TLS가 필요한 Function App은 HTTPS에서 클라이언트 인증서를 요구하세요. Optional 모드에서는 호출자가 인증서 없이도 요청을 보낼 수 있습니다.
잠재적 영향
인증서가 전달됐다는 사실만으로는 신뢰할 수 있는 호출자인지 알 수 없습니다. 검증을 생략하면 권한이 없는 사용자의 요청을 허용할 수 있습니다.
해결 방법
현재 리소스에서는 client_certificate_enabled를 켜고 client_certificate_mode를 Required로 지정하세요. 앱에서 인증서의 신뢰 체인과 유효 기간, 호출 권한을 확인하세요. 보호된 함수에서 허용된 인증서는 성공하고 인증서가 없거나 유효하지 않은 요청은 거부되는지 시험하세요.
예시
AzureRM 3.x의 azurerm_function_app 예시는 client_cert_mode를 Optional에서 Required로 바꿉니다. 스토리지 등 필수 설정과 HTTPS 적용은 별도로 구성하세요.
변경 전
hcl
resource "azurerm_function_app" "example" {
name = "test-azure-functions"
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_mode = "Optional"
}
변경 후
hcl
resource "azurerm_function_app" "example" {
name = "test-azure-functions"
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_mode = "Required"
}