ADR-0013 — Service-to-service auth: UAMI + Entra app-roles; user tokens terminate at BFF
Context
Every ION micro-service either implements a REST API, calls other ION services’ REST APIs, participates in event-driven pipelines on the shared Service Bus (per ADR-0008), or runs as a daemon against Azure data-plane services (Cosmos DB, Storage, Key Vault, Log Analytics, Graph). All of that traffic needs an authentication and authorisation model that is:
- Secretless by default (no long-lived credential in workload code or Key Vault where an Entra-native alternative exists).
- Auditable — every call traceable to a named identity, every identity’s capability enumerable via Entra sign-in logs + Azure RBAC assignments.
- Least-privilege at the identity level — one identity per micro- service, with a role set matching only what that service does.
- Uniform at the API gateway — the same token-validation story regardless of who is calling (customer, advisor, ION service, CI/CD).
Constraints from Azure that shape the design:
- Azure Functions Easy Auth supports only one Entra app registration as the authenticating audience per Function App. ION has at least three customer/advisor-facing apps (Portal app, Alya Workbench, Advisor Workbench) plus internal service-to-service traffic. Backends cannot accept “any of these” natively.
- User-Assigned Managed Identity (UAMI) roles are grant-able at resource-group scope; broader scope is a security-exception request.
- App-role assignment to a Managed Identity is not exposed in the Azure Portal; PowerShell / CLI / Graph API only.
Forces / Drivers
- Microsoft security best practice — Microsoft’s Managed Identities Best Practice Recommendations explicitly recommend Managed Identity over service-principal-with-secret for any Azure-hosted workload: secretless by construction, credential rotation is handled by the platform, and the identity cannot be used outside Azure (removing an entire exfiltration vector). This is a first-class force independent of § 12 — the § 12 principle exists because MS security guidance says so.
- principles/README.md § 12 Managed Identity for service-to-service authentication — the platform-wide default; this ADR is where § 12 becomes concrete.
- principles/README.md § 22 Least privilege — one identity per service, RG-scoped roles.
- principles/README.md § 23 Blast-radius containment — a compromised service’s identity must not carry capability beyond that service; a compromised customer/advisor token must not reach a backend directly.
- principles/README.md § 21 Azure-native managed services first — auth model must live inside what Entra + Azure RBAC + APIM natively support.
- principles/README.md § 13 BFF pattern for frontend access — customer/advisor tokens terminate at the BFF/APIM edge; they do not reach backends.
- Tenant topology established in ADR-0009 — all internal identities live in
ontinue.com. - Customer-tenant integration paths established in ADR-0010 (Graph/MDE) and ADR-0011 (customer Azure RBAC + FIC) — this ADR is the ION-side counterpart to those, and its FIC scope covers inbound callers into ION (CI/CD, workloads outside Azure) rather than outbound cross-tenant.
Decision
Adopt a three-layer service-to-service auth model:
1. Identity layer — one User-Assigned Managed Identity per micro-service
- Every micro-service gets its own UAMI, provisioned in its own resource group.
- Data-plane and control-plane RBAC (Cosmos DB Data Contributor, Service Bus Data Sender / Data Receiver, Key Vault Secrets User, Storage Blob Data Contributor, Log Analytics Reader / Metrics Publisher, etc.) are assigned to the UAMI at the resource-group scope of that service.
- Cross-RG RBAC grants require an explicit security-exception ADR — they are not routine. This is the platform-wide implementation of § 22.
- Shared UAMIs across services are disallowed. System-Assigned Managed Identities are not used for ION micro-services (see Option B).
- Single recorded exception — the shared App Service authentication
identity. Easy Auth on every Function App / App Service authenticates
to the ION Platform API app as a confidential client. Instead of a
per-service client secret, one shared UAMI (the rome auth identity)
is registered as a Federated Identity Credential on the ION Platform
API app, and each service attaches it and sets
client_secret_setting_name = "OVERRIDE_USE_MI_FIC_ASSERTION_CLIENTID". The identity is shared because an Entra application accepts at most 20 Federated Identity Credentials, and the Platform API app is used by more than 20 services. The exception is narrow: the rome auth identity holds no Azure RBAC, noIon.*app roles, and is never used for data-plane or service-to-service calls — it only signs the Easy Auth client assertion. Every service still has its own UAMI for all other access.
2. Role layer — the “ION Platform API” Entra app is the shared role catalogue
- A single Entra app registration in
ontinue.com— the ION Platform API app — declares the fullIon.*app-role catalogue (Ion.SecurityIncidents.Read,Ion.SecurityIncidents.ReadWrite,Ion.Vulnerability.Read,Ion.Machine.Read,Ion.RemediationAction.*,Ion.Platform.CustomerConfigurationData.*,Ion.CustomerEnvironmentData.*,Ion.Platform.ThreatIndicators.Read,Ion.AuditLogs.*, etc. — seeIdentity Management- Micro-services Communication.md§ Micro-services). - Each service’s UAMI is assigned the subset of
Ion.*roles it needs to hold when calling out (via Graph / PowerShell — not portal). - The service’s UAMI acquires tokens for the ION Platform API app URI as
the
scope(api://<ion-platform-api-app-id>/.default); the emitted JWT carries the assignedIon.*roles asrolesclaims. - Downstream APIs enforce the required
Ion.*role at their APIM policy.
3. Gateway layer — user tokens terminate at the BFF; service-to-service tokens flow through APIM
ION splits the token-exchange responsibility along the user-vs-service axis:
User traffic (customer / advisor / Alya analyst) → BFF is the token boundary.
- Customer, advisor, and Alya user tokens — issued by the respective
Entra apps (
azsp-ontinue-rome-idm-ion-portal-prd-01,azsp-ontinue-rome-idm-ion-portal-advisors-prd-01,azsp-ontinue-rome-idm-ion-defenderwb-prd-01) — are validated at APIM (aud,tidagainst Pratt’s tenant-subscription list,roles, and for advisor OBO the advisor-to-customer relationship claim) and routed only to the corresponding BFF service (Customer Portal BFF, Advisor Workbench BFF, Alya Workbench BFF). - The BFF is the token boundary. User tokens do not propagate
beyond the BFF. The BFF authenticates itself to downstream ION
services using its own UAMI + ION Platform API app token, carrying
the
Ion.*roles the BFF has been assigned. This realises § 13 BFF pattern for frontend access: aggregation, authorisation, and security-boundary separation. - Backends downstream of a BFF never see a customer or advisor token.
Service-to-service traffic → UAMI + ION Platform API app.
- Every ION service-to-service call authenticates using the caller’s
UAMI acquiring a token for the ION Platform API app URI
(
api://<ion-platform-api-app-id>/.default). The emitted JWT carries the caller’s assignedIon.*roles. - Where the call goes through APIM, APIM validates the caller’s
UAMI token (
audagainst the environment allow-list of supported client application audiences,roles), then acquires its own token withauthentication-managed-identityfor the ION Platform API app and places it in the backendAuthorizationheader. The backend’s Easy Auth therefore authenticates APIM, and the backend audience is uniformly the ION Platform API app. - APIM forwards the original, already-validated caller token in the
X-Authorizationheader so the receiving service can read caller context (for example a BFF binding a capability token to the user, or a service attributing the calling workload). APIM MUST overrideX-Authorizationwith the validated inboundAuthorizationvalue so that a client-suppliedX-Authorizationnever reaches a backend. The deployed global policy does not yet do this (gap APIM-01; see the Amendments). An API may deliberately replace it with APIM’s own token when no caller context is needed downstream.X-Authorizationis caller context, not a credential the backend may replay to another service. - Where a service calls another service directly (bypassing APIM — e.g., event-handler workloads publishing to Service Bus, calls into Cosmos or Key Vault), the same UAMI token is used against the appropriate data-plane scope.
Why backends uniformly trust one audience. Backends (Azure Functions /
Container Apps) accept only the ION Platform API app as their
audience, regardless of whether the token was minted for a BFF UAMI or a
downstream-service UAMI. This works around the Azure Functions Easy Auth
“one audience per Function App” limitation and closes off direct backend
invocation from a customer tenant — a customer-tenant-issued token can
never have aud = ION Platform API app.
4. Federated Identity Credentials — the credential-less inbound frontier
- CI/CD (Runway) authenticates into ION via FIC on a Runway Entra application — the GitHub Actions OIDC token is exchanged through a per-environment federated credential on that application (ADR-0024 § 6). The federation is configured as a Runway prerequisite, not through Terraform. No PAT, no client secret, no certificate in the pipeline configuration.
- Workloads outside Azure that need to call ION APIs federate through the same pattern — their native OIDC token is trusted by a purpose- scoped UAMI. This is the ION-side symmetric application of the cross-tenant pattern from ADR-0011.
- Credential-less-everywhere is the direction. Any remaining client-secret or certificate-credential path in ION services is on an active migration list toward UAMI + (where the caller lives outside Azure) FIC. No new secret-based paths are introduced.
- Recorded exception — Pigeon delegated Teams publishing. Microsoft
Graph has no application permission for posting channel messages, only
the delegated
ChannelMessage.Send. Pigeon therefore posts notifications and replies into customer shared channels, and creates Teams meetings through/me, as a dedicated Ontinue user service account. It acquires the delegated Graph token with the resource owner password credentials (ROPC) grant against the Ontinue tenant (RopcAuthService). The service account password and the Teams application’s client secret are read from Pigeon’s Key Vault. The exception is limited to Graph Teams calls from Pigeon. Pigeon’s UAMI is still used for every other call. The required controls are in the identity guidelines. The exception is reviewed whenever Microsoft changes the Teams permission model.
Alternatives Considered
Option A — Client secrets / certificates on service principals
- Rejected. Grounds:
- (decisive) § 12 mandates Managed Identity where possible, and Microsoft’s own managed-identity best-practice guidance recommends MI over service-principal-with-secret precisely because MI cannot be used outside Azure and requires no rotation. Every ION workload runs on an Azure compute surface (Functions, Container Apps) that supports UAMI natively.
- Secret rotation is permanent operational tax across every service, every environment. UAMI has no secret to rotate.
- Compromise blast radius — a leaked client secret is a silent, offline-usable credential; a UAMI token is short-lived and bound to the compute identity.
Option B — System-Assigned Managed Identity (SAMI) per service
- Rejected. Grounds:
- (decisive) Shared-lifecycle with the resource. Recreating a
Function App (blue/green swap, region migration, IaC redeploy)
rotates the identity; every RBAC assignment and every
Ion.*role assignment on that identity must be re-issued. - Cannot be pre-provisioned. Bootstrap workflows that assume the identity exists before the resource is fully deployed break.
- Cannot be shared across resources — some services legitimately run across multiple compute resources (a Function App + an ancillary jobs container); SAMI would force multiple identities per service, defeating the “one identity per service” model.
- (decisive) Shared-lifecycle with the resource. Recreating a
Function App (blue/green swap, region migration, IaC redeploy)
rotates the identity; every RBAC assignment and every
- UAMI solves all three: independent lifecycle, pre-provisionable, shareable within a single service’s RG boundary.
Option C — Direct customer/advisor tokens to backends (Azure Functions Easy Auth as the sole authenticator)
- Rejected. Grounds:
- (decisive) Azure Functions Easy Auth accepts one audience per app. ION has multiple customer-facing and advisor-facing apps. Some backends would have to accept customer tokens, others advisor tokens; the same backend cannot accept both without a bespoke validator inside the function code — the exact wheel-reinvention § 21 forbids.
- Customers can obtain a token from their own Entra tenant and invoke backends directly, bypassing every APIM policy (rate limit, tenant-subscription check, request shaping). Structural violation of § 23.
- No consistent audit story across caller classes.
- The BFF token boundary keeps user tokens away from downstream backends;
service-to-service callers use the ION Platform API app audience with
their own Managed Identity. APIM validates that token, authenticates to
the backend with its own managed-identity token, and passes the
validated caller token only as
X-Authorizationcontext.
Option D — Central ION token-broker service
- Rejected. Grounds:
- Reinvents APIM
authentication-managed-identity. Azure APIM already implements exactly this exchange as a policy primitive. Fails § 21. - Adds an SPOF in front of every service-to-service call.
- Operational cost of another service on the critical path.
- Reinvents APIM
Option E — One shared UAMI for all ION services
- Rejected. Grounds:
Rationale
The three layers each solve exactly one problem:
- UAMI-per-service gives ION a stable, per-service, credential-less identity that lifecycles independently of the compute it runs on and can be RBAC’d at RG scope. It is the smallest identity granularity that meets least-privilege without turning every service redeploy into an identity re-provisioning event.
- ION Platform API app as the shared role catalogue collapses N app
registrations (one per service) into one, where role assignment is the
granularity of policy. This is what makes the
Ion.*role vocabulary a first-class thing services can reason about — every token in the platform carriesrolesclaims from the same catalogue. - APIM as the exchanger turns the “Azure Functions one-audience
limit” from a design constraint into a non-issue, and closes the
direct-backend-invocation attack path that Option C would leave open.
Backends validate one thing: an APIM-issued token for the ION Platform
API app carrying required
Ion.*roles.
FIC as the inbound-frontier lever pairs symmetrically with ADR-0011’s outbound-frontier lever: on both sides of the tenant boundary, ION replaces long-lived credentials with tokens exchanged via Entra Workload Identity Federation.
Consequences
Positive
- Zero client secrets in production ION workloads for Azure-hosted paths, apart from the recorded Pigeon delegated Teams publishing exception (§ 4).
- One identity per service, RBAC’d at RG scope — audit and least- privilege are structural properties, not conventions.
- One backend-audience story regardless of caller class. Backends do not distinguish customer / advisor / ION-service / CI/CD — they trust APIM.
- Runway CI/CD is credential-less via FIC.
- Direct backend invocation from a customer tenant is structurally impossible.
Negative / Trade-offs
- APIM is on the critical path for every backend call. Availability and scale of APIM is load-bearing (addressed in ADR-0014).
- App-role assignment tooling is CLI/PowerShell/Graph only. Runway IaC must automate this; portal-only workflows do not work.
- The ION Platform API app is a single admin object. Rotating it, extending its role catalogue, or migrating it is a coordinated platform-wide change. Versioning strategy: additive-only for roles; breaking changes require a new app registration and a migration window.
- Managed Identity tokens cache for ~24 h. RBAC or role revocation is not instantaneous — service must be aware for incident-response runbooks.
- Any remaining secret-based paths are on active migration to UAMI + FIC. Some V2-era services still carry Key-Vault-hosted client secrets during transition; the target-state is credential-less everywhere.
- APIM UAMI token acquisition adds handshake latency on cold paths; cached-token semantics keep hot paths free.
WAF Pillar Impact
- Security (primary) — least privilege at identity granularity; no long-lived secrets in Azure-hosted paths; single backend audience closes off direct-invoke bypass; consistent audit trail.
- Operational Excellence — no secret-rotation runbook for the common path; identity lifecycle is IaC-driven per service.
- Reliability — APIM on the critical path; token cache reduces Entra dependency on hot paths.
- Performance Efficiency — token cache (~24 h) keeps Entra traffic bounded; APIM adds a hop that must be sized (ADR-0014).
- Cost Optimization — neutral; no per-secret Key Vault cost on the common path.
Previous approach (V2)
V2 already used Managed Identity in principle (§ 12 was declared V2) but
enforcement was uneven — several services carried client-secret-based
service-principal credentials in Key Vault, and Azure Functions Easy Auth
was used directly in some flows. V3 tightens the model to structural
enforcement: UAMI-per-service becomes the platform default, the BFF is
the explicit token boundary for user traffic, and FIC replaces long-lived
credentials for CI/CD and external-workload inbound. Remaining V2-era
secret-based paths are on active migration to credential-less. The
Ion.* role catalogue and the ION Platform API app registration itself
are V2 artefacts retained unchanged.
Amendments
- 2026-10-14 — Gateway token handling clarified. § 3 and Option C
previously stated there was no APIM-side token exchange for
service-to-service traffic. That contradicted this ADR’s own Rationale
and Option D and the deployed policies. Corrected: APIM validates the
caller token, authenticates to the backend with its own managed
identity, and forwards the validated caller token in an
APIM-overwritten
X-Authorizationheader. - 2026-10-14 — SAMI excluded; shared Easy Auth identity recorded. § 1 now states that SAMIs are not used for micro-services, and records the rome auth identity as the single shared-UAMI exception, justified by the 20-FIC-per-application Entra limit and constrained to Easy Auth client assertions only.
- 2026-10-14 — CI/CD federation target corrected. § 4 previously bound the GitHub Actions OIDC token to a Runway-scoped UAMI. Corrected to match ADR-0024 § 6: the token is federated through a per-environment federated credential on a Runway Entra application, configured as a Runway prerequisite rather than in Terraform.
- 2026-10-15 — Pigeon delegated Teams publishing recorded as an exception. § 4 now records Pigeon’s ROPC service-account path for Graph Teams calls. The path is not on the migration list because no application permission exists for sending channel messages. It is an accepted exception with mandatory controls, not a transitional secret.
- 2026-10-15 —
X-Authorizationoverride is a requirement, not yet deployed behavior. § 3 stated that APIM always overwritesX-Authorization. The deployed Rome global policy sets it withexists-action="skip", so a client-supplied value survives. § 3 now states the requirement as a MUST and references gap APIM-01 in the APIM global policy implementation. Until it is fixed, backends must validate anyX-Authorizationtoken they use. - 2026-10-15 — APIM caller check is
aud, notazp. § 3 stated that APIM validatesazpagainst an allow-list of UAMI client IDs. The deployed global policy does not checkazp. Itsvalidate-jwtvalidatesaudagainst an environment allow-list of supported client application audiences, covering both single-tenant and multi-tenant applications, and requires arolesclaim. Operation policies enforce the route’sIon.*role. § 3 is corrected to match. - 2026-10-15 — Application-permissions-only rule stated at pillar level. The V3 security architecture and the application permissions only pattern restate that workloads use application permissions or managed identity only. The Pigeon ROPC path in § 4 remains the only delegated workload credential. End-user sign-in scopes are out of scope of this rule.
References
- references/Identity Management - App Service Managed Identity.md — shared rome auth identity for Easy Auth.
- references/Identity Management- Micro-services Communication.md — primary source: per-service role tables, APIM policy patterns, rationale.
- references/Identity Management- Azure AD Implementation.md — ION Platform API app-registration best practices.
- references/Identity Management- Entra App Role Creation.md —
Ion.*role catalogue and assignment mechanics. - Managed identities for Azure resources overview.
- Assign app role to a managed identity — Graph/PowerShell mechanics.
- APIM
authentication-managed-identitypolicy. - Entra Workload Identity Federation overview.
- ADR-0009, ADR-0010, ADR-0011, ADR-0012.
- principles/README.md §§ 12, 13, 21, 22, 23.
Related ADRs
- ADR-0009 — establishes Entra as the platform IdP that makes UAMI + app-roles + FIC possible.
- ADR-0010 — outbound customer-tenant Graph/MDE app model; this ADR is its ION-side equivalent for internal traffic.
- ADR-0011 — outbound customer-tenant Azure RBAC via FIC; this ADR is its inbound symmetric counterpart for CI/CD + non-Azure workloads.
- ADR-0012 — customer/advisor token issuance surface that terminates at APIM in this ADR.
- ADR-0014 — Shared APIM topology; where the APIM managed-identity backend authentication this ADR relies on is deployed.