Review App Service FTP transport protection

Use FTPS for file transfer and disable FTP access when it is unnecessary.

Description

Set site_config.ftps_state to Disabled if you do not publish the Web App over FTP. If you need FTP publishing, select FtpsOnly.

Potential impact

AllAllowed also permits plaintext FTP. Using it can expose publishing credentials and leave files open to tampering in transit.

Remediation

For FtpsOnly, set the app’s minimum inbound TLS version to 1.2 or later. FTPS deployment requires both FTP and SCM basic publishing authentication. Restrict publishing credentials and verify that the client validates the server certificate and transfers files over TLS. Check that plaintext FTP is rejected. If you use another deployment path, verify its authentication and transport encryption.

Examples

The AzureRM 3.x azurerm_app_service examples change AllAllowed to FtpsOnly. Current Linux and Windows Web Apps also support the setting. Configure HTTPS and user authentication for web requests 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

  site_config {
    dotnet_framework_version = "v4.0"
    scm_type                 = "LocalGit"
    ftps_state               = "AllAllowed"
  }
}

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

  site_config {
    dotnet_framework_version = "v4.0"
    scm_type                 = "LocalGit"
    ftps_state               = "FtpsOnly"
  }
}

References