Azure Front Door guidelines
These rules apply to every change to the ION Front Door profile, in both the hub stack and the service stacks. MUST and MUST NOT are mandatory. SHOULD and SHOULD NOT are the expected default, and any deviation is recorded in the PR. MAY is optional. Where the current configuration differs from a rule, the gap and its remediation are listed in implementation.
Routing and topology
- New public hostnames MUST be added through a service stack under
hub/azure-front-door/services/. The hub stack owns the profile, the shared origin groups, and existing hub endpoints. - Public HTTP traffic MUST enter through Front Door. The only exceptions are listed under exceptions.
- API routes MUST target
RomeApiOriginGroupand map the public/api/...prefix to the APIM API path withorigin_path. A route MUST NOT target a BFF, Function App, or domain service directly. - SPA routes MUST NOT proxy
/api/*to the SPA host. API prefixes are separate routes on the same endpoint (ADR-0027). - New routes MUST NOT use the legacy
RomeAppGatewaygroup (raw Application Gateway IP) or the duplicateRomeAppGatewayDomaingroup. The Yammer and Herald routes on those groups are being retired with those services. - A wildcard route’s
origin_pathMUST end with/. An exact-match route’sorigin_pathMUST NOT end with/. - Every route MUST set
forwarding_protocol = "HttpsOnly"andhttps_redirect_enabled = true.
Origins and failover
- Origin groups with more than one origin MUST use priority routing.
Priority 1 is the Application Gateway hostname (
agw-apioragw-<app>-webapp). Priority 2 is the direct origin. - A direct origin (APIM gateway, App Service, Static Web Apps) MUST be used only as priority 2 behind an Application Gateway priority-1 origin (ADR-0015).
- Every priority-2 origin MUST accept traffic only from ION’s Front Door: the
AzureFrontDoor.Backendservice tag and anX-Azure-FDIDmatch on the ION profile GUID. - Storage origins MAY be used only for valet-key blob routes and the operational-data portal. They MUST use HTTPS and MUST have shared-key access disabled.
- Valet-key SAS tokens MUST be user-delegation SAS, scoped to one container or blob, with the minimum permissions and a short expiry. They MUST be issued by a BFF behind APIM, after authorization.
- A Switzerland West origin MUST NOT be added until the ADR-0017 warm spare exists, with data replication, callback URLs, CORS, certificates, network restrictions, and a failback runbook (resiliency).
Health probes
- Every origin group with more than one origin MUST have a health probe.
- Single-origin groups MUST NOT have a health probe.
- Probes MUST target a dedicated, shallow, anonymous endpoint that returns no
sensitive data and does not call optional dependencies. Probes SHOULD use
HEAD. - Probe interval MUST be 60 seconds or less on
RomeApiOriginGroupand web app groups. Keep the default load-balancing sample settings (4 samples, 3 required) unless a measured reason exists. - Service stacks MUST NOT define a probe on a shared origin group. The hub owns it.
Caching
- Front Door MUST NOT cache
/api/*, any authenticated response, or any response that varies by user, customer, or tenant. Front Door edge locations are outside Switzerland. - Front Door MUST NOT cache shell HTML (
index.html), runtime configuration (config.js), or Module Federation manifests (mf-manifest.json). They must change as soon as a deployment lands. - Caching SHOULD be enabled for content-hashed static assets (JavaScript, CSS, fonts, images whose filename includes a build hash), on a dedicated route for the asset path, with compression on.
- Origins MUST send
Cache-Control: public, max-age=31536000, immutablefor hashed assets, andno-cachefor HTML, configuration, and manifests.
WAF
- Every endpoint and every custom domain MUST be associated with a WAF policy. Engineers MUST verify custom-domain association after any change to domains or security policies (security).
- WAF policies MUST run in
Preventionmode withMicrosoft_DefaultRuleSet2.1 andMicrosoft_BotManagerRuleSet1.0 (or a later approved version), both with actionBlock. - A policy MUST NOT be switched to
Detectionto work around a false positive. Exclusions MUST be per service, as narrow as possible, and added by PR with the WAF log evidence. - Front Door SHOULD have a coarse per-IP rate-limit custom rule on
/api/*. APIM keeps the caller-aware limits. - Stacks SHOULD share one WAF policy definition, with per-service policies only where a service needs its own exclusions.
- Front Door Premium WAF is the platform WAF. Application Gateway WAF is target state. Until it is enabled, documents and dashboards MUST NOT describe Application Gateway as a second WAF.
Headers and CORS
- Every SPA route MUST attach a security-header rule set with HSTS,
X-Content-Type-Options,X-Frame-Options,Referrer-Policy,Permissions-Policy, andContent-Security-Policy. - Each header value MUST fit Front Door’s 640-character limit for rule header values.
- CSP variants SHOULD be consolidated into a small shared set. The deprecated
X-XSS-Protectionheader SHOULD be removed.'unsafe-inline'SHOULD be removed where the frontend allows it. - CORS allowed origins MUST be exact
https://origins for the environment and MUST NOT be*. - Rule sets MUST NOT inject credentials, API keys, or shared secrets into requests.
TLS and certificates
- TLS MUST be used on every hop, with no exceptions. Custom domains MUST use Front Door managed certificates with TLS 1.2 or later.
- Origin certificate name checking SHOULD be enabled. Where an origin cannot present a matching certificate (today, Application Gateway’s default certificate), disabling it is a recorded exception.
_dnsauthTXT records MUST stay in IaC. Removing them stops managed certificate renewal.
Exceptions
Only these paths may skip Front Door or skip Application Gateway. Each is sanctioned by ADR-0015 and described in security.
- SignalR WebSocket to
agw-alya-sigrandagw-alya-shell-sigr. ION SHOULD re-evaluate routing SignalR through Front Door, which now supports WebSockets. - Front Door outage bypass through
agw-*hostnames. A human change approved by the incident commander. - Priority-2 direct origins, only as described under origins and failover.
- Storage origins, only for valet-key blobs and the operational-data portal.
A new exception MUST be added through an ADR-0015 amendment before it is deployed.
Observability
- Diagnostics MUST send
AllLogsandAllMetricsto the observability Log Analytics workspace in Switzerland North. - These alerts MUST exist, routed to the CPE action group:
- origin health percentage on every multi-origin group;
5xxpercentage;- latency;
- WAF block spikes;
- Resource Health (production).
- Front Door outages MUST follow the manual bypass runbook.
Change management
- Front Door modules MUST be consumed from pinned, versioned JFrog sources, not local relative paths.
- Changes MUST go through a PR and be deployed through Runway by CPE. Emergency portal changes MUST be reconciled into IaC immediately.
- Changes SHOULD be promoted through
mgtapa,mgtbta, andmgtgmabeforemgtprd. - IDs (subscription, tenant, profile GUID) MUST NOT be hard-coded in documentation. Read them from Terraform data sources.