Azure Front Door security
Front Door is ION’s internet-facing security boundary. It terminates TLS, runs the platform WAF, adds browser security headers, answers CORS, and is the only public path to most origins. It does not authenticate users or authorize requests: APIM, the BFFs, and the domain services do that. This page is the source for Front Door security guidance. The security pillar links here.
Request pipeline
WAF policy
Each stack creates its own azurerm_cdn_frontdoor_firewall_policy. The hub
stack’s policy covers the hub endpoints, and each service stack’s policy covers its
own endpoint. Every policy has the same settings:
| Setting | Value |
|---|---|
| SKU | Premium_AzureFrontDoor |
| Mode | Prevention |
| Managed rule set | Microsoft_DefaultRuleSet 2.1, action Block |
| Managed rule set | Microsoft_BotManagerRuleSet 1.0, action Block |
| Custom rules | None |
| Association | Security policy fdsp-<short>-<hubenv>-glb-<nn>, patterns /* |
Exclusions and false positives
- Exclusions are per service policy, as narrow as possible (one rule ID, one match variable, one selector), and added through a PR with the WAF log entry that justifies them.
- Do not switch a policy to
Detectionto work around a false positive. - A single shared policy definition with per-service exclusion overlays is the target, because six or more identical copies drift over time.
Rate limiting
APIM applies caller-aware rate limits and quotas per subscription and caller.
Front Door SHOULD add a coarse per-IP rate-limit custom rule on /api/*. It
rejects floods at the edge before they use Application Gateway and APIM capacity.
Set the threshold well above normal peak per-IP traffic, so it blocks only abuse.
The sample rule is in implementation.
TLS and certificates
| Control | Configuration |
|---|---|
| Client TLS | Minimum TLS 1.2 on every custom domain (the Front Door default) |
| Certificates | Front Door managed certificates; validated through _dnsauth.<endpoint> TXT records in the hub DNS zone and renewed automatically |
| HTTP | supported_protocols includes HTTP only so that https_redirect_enabled can redirect it |
| Origin protocol | forwarding_protocol = "HttpsOnly" on every route |
| Origin certificate name check | Disabled (certificate_name_check_enabled = false). Application Gateway presents its default certificate, which does not match every origin hostname. This is a recorded exception; see exceptions |
Disabling the name check does not disable TLS. The hop is still encrypted. Front Door just does not verify that the certificate’s subject matches the origin hostname. TLS on every hop stays mandatory with no exceptions.
Security headers
Rule sets add these response headers.
| Header | Value |
|---|---|
Strict-Transport-Security | max-age=31536000; includeSubDomains; preload |
X-Frame-Options | SAMEORIGIN |
X-Content-Type-Options | nosniff |
Referrer-Policy | strict-origin-when-cross-origin |
Permissions-Policy | Deny-by-default list; self only for the features ION uses |
Content-Security-Policy | Per stack (see below) |
X-XSS-Protection | 1; mode=block. Deprecated: modern browsers ignore it. Remove it |
The hub has four CSP values (default, Alya, Bondi, and Temporal), and each
service stack has its own. They differ in
connect-src (SignalR wss:, Application Insights, blob storage), frame-src
(Power BI, Defender for Cloud Apps), and reporting. Keep these points in mind:
- Front Door limits rule header values to 640 characters. Bondi stacks drop
script-src(it inheritsdefault-src) to stay under the limit and keep thereport-uri. - Several variants still allow
'unsafe-inline'for styles. Removing it is tracked in the module (TODO). - Header actions use
Append. If an origin also sets a header, the browser gets two copies. For CSP, it enforces both policies. Application Gateway avoids this by adding its headers only whenX-Azure-FDIDdoes not match the ION profile. - CSP variants SHOULD be consolidated into a small set of shared values per shell family.
CORS
The CORS<short> rule set matches the request Origin header against the
environment’s allowed origin list. When it matches, the rule overwrites
Access-Control-Allow-Origin with that origin. It does not handle preflight
requests; APIM’s CORS policy answers those. Allowed origins come from the stack’s
cors_origin_urls tfvars. They must be exact https:// origins, never wildcards.
Origin protection
Front Door is only a boundary if its origins refuse traffic that does not come from it.
| Origin | Required restriction | Why it is enough |
|---|---|---|
| Application Gateway | Allow AzureFrontDoor.Backend; allow internet 443 only for the exceptions | The WebSocket hostnames and the outage bypass need direct access |
| App Service SPA host (priority 2) | Access restrictions: Application Gateway subnet, Front Door service tag with an X-Azure-FDID header match, ZPA subnet (engineer access only, not runtime), deployment runners | The service tag alone admits any Front Door profile in Azure; the header pins it to ION’s profile |
| Static Web Apps (priority 2) | forwardingGateway with the Front Door service tag and the X-Azure-FDID value | Same reason |
| APIM gateway (priority 2) | Inbound policy that rejects requests without ION’s X-Azure-FDID unless they come from Application Gateway or approved sources | APIM is publicly resolvable; the header check limits it to ION’s edge |
| Attachment storage (valet key) | Network rules deny by default and allow Front Door backend ranges, ZPA (engineer access only), and platform IPs. Shared keys disabled, so only user-delegation SAS works | Authorization happens at the BFF when the SAS is issued; storage enforces scope and expiry |
| Operational-data storage | Shared keys disabled; reads need an Entra token with Storage RBAC | Identity is the control. IP rules for Front Door are brittle for static websites |
X-Azure-FDID carries the profile’s resource GUID. Read it from Terraform
(data.azurerm_cdn_frontdoor_profile.rome.resource_guid). Never hard-code it in
documentation or source.
Exceptions
These exceptions are sanctioned by ADR-0015. Each one has compensating controls and an exit condition.
| Exception | Why | Compensating controls | Exit condition |
|---|---|---|---|
SignalR WebSocket direct to Application Gateway (agw-alya-sigr, agw-alya-shell-sigr) | Front Door did not support WebSockets when SignalR was designed | Negotiate goes through Front Door and APIM; SignalR access token is short-lived and user-bound; group membership is backend-controlled; DDoS protection on the public IP | Route SignalR through Front Door, which now supports WebSockets |
| Front Door outage bypass | Front Door is a global single dependency | Human approval; Alya callback and CORS pre-registered; Application Gateway adds security headers; DDoS protection on the public IP | Ends when Front Door recovers |
| Priority-2 direct origins | Keeps APIs and SPAs available when Application Gateway fails | Front Door WAF still applies; origin accepts only ION Front Door (service tag plus X-Azure-FDID) | Permanent pattern |
| Storage origins (valet-key blobs, operational-data portal) | Same-origin blob access; region-independent continuity portal | SAS issued by an authorized BFF, or Entra plus Storage RBAC; shared keys disabled; HTTPS only; WAF at Front Door | Permanent pattern |
| Origin certificate name check off | Application Gateway presents its default certificate for all origin hostnames | TLS still encrypts the hop; origins are fixed Terraform hostnames | Enable per origin group once each origin presents a matching certificate |
Logging
| Log | Contents | Use |
|---|---|---|
FrontDoorAccessLog | Every request: client IP, host, URI, status, route, origin, latency, tracking reference | Incident diagnosis, abuse investigation |
FrontDoorWebApplicationFirewallLog | Every WAF match: rule ID, action, policy, request details | False-positive tuning, attack analysis |
FrontDoorHealthProbeLog | Probe results per origin | Failover diagnosis |
Access logs record the full request URI. Tokens, secrets, and personal data must never appear in query strings. SAS tokens are an accepted exception because they are short-lived and scoped to one blob.