Review App Service client certificate requirements

Apply certificate requirements and validation to paths that need certificate-based caller authentication.

Description

If an internal API or partner integration requires client certificates, configure App Service to require one over HTTPS. The app must decide whether to trust the certificate App Service forwards.

Potential impact

A caller who presents a certificate may reach protected functions if the app skips trust or permission checks.

Remediation

On current resources, enable client_certificate_enabled and set client_certificate_mode to Required. Validate the chain, validity period, caller identity and permissions in the app. Test that protected paths reject missing or untrusted certificates. For HTTP/2 or TLS 1.3, avoid modes and exclusion paths that require TLS renegotiation.

Examples

The AzureRM 3.x azurerm_app_service example adds only client_cert_enabled = true. Configure HTTPS and application-level certificate validation separately.

Before

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
}

After

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
}

References