Front Door should redirect HTTP to HTTPS

High Azure General frontdoors-front-door-redirect-http

Applies to

  • Microsoft.Network/frontDoors

What CGPulse checks

A resource passes this rule when routingRules.hasHttpsRedirect must equal true. Anything else is reported as a finding with the evaluated property value attached as evidence.

How to fix it

Configure HTTP-to-HTTPS redirect to encrypt all user traffic in transit. In Azure Portal: Front Door/App Gateway > Routing rules > add HTTP-to-HTTPS redirect. See: https://learn.microsoft.com/en-us/azure/frontdoor/front-door-how-to-redirect-https

CLI

az afd route list --profile-name "{name}" -g "{rg}" --query "[].{name:name,httpsRedirect:httpsRedirect}" -o table

Bicep

// TODO: Add an HTTP-to-HTTPS redirect rule in Front Door routing rules
// This requires creating a rule set with a URL redirect action

Terraform

resource "azurerm_frontdoor" "{name}" {
  name                = "{name}"
  resource_group_name = "{rg}"
  routing_rule {
    name               = "http-to-https-redirect"
    accepted_protocols = ["Http"]
    patterns_to_match  = ["/*"]
    frontend_endpoints = ["{name}-frontend"]
    redirect_configuration {
      redirect_protocol = "HttpsOnly"
      redirect_type     = "Found"
    }
  }
  # Additional routing rules for HTTPS traffic needed
}

Compliance frameworks

Vendor documentation

Is your environment compliant with this rule?

CGPulse checks it — and 621 others — against your Azure and AWS accounts with read-only access.

Run a free scan

Related Azure rules

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.