API Management Policy Model
ION composes APIM behavior from a platform-owned global policy, a platform-governed product policy where one applies, and service-owned API and operation policies. The final behavior is the inherited policy chain, not one XML file viewed in isolation.
Concepts
| Term | ION V3 meaning |
|---|---|
| API | A versioned set of operations imported from an OpenAPI contract and connected to a service backend. |
| Operation | One OpenAPI operationId with a method, public path, backend rewrite, required role, and optional caching behavior. |
| Product | A grouping and publication boundary for APIs. Subscription keys are not used. A product may carry a platform-governed policy; in V3 the MFE product does. |
| Policy | Ordered XML statements that alter or constrain inbound, backend, outbound, and error processing. |
| Named value | Environment-specific APIM configuration, optionally sourced from Key Vault, referenced as {{NAME}} in policy XML. |
| Policy fragment | Shared policy statements included by identifier: the platform request, response, and error trace fragments, and service fragments such as Signet’s mfe-cors-fragment. |
| Backend | The OAuth-protected Azure compute endpoint implementing an API or operation. |
| Diagnostic/logger | API-level Application Insights integration and capture settings used with policy trace events. |
ION does not use the APIM developer portal or subscription keys as the application security boundary. APIs are defined and deployed through OpenAPI, Terraform, and policy XML.
Policy sections
<policies>
<inbound>
<!-- Authenticate, authorize, route, transform, throttle, and cache lookup. -->
</inbound>
<backend>
<!-- Control forwarding and backend execution. -->
</backend>
<outbound>
<!-- Shape, sanitize, trace, and optionally cache the response. -->
</outbound>
<on-error>
<!-- Trace and normalize failures. -->
</on-error>
</policies>
Policies execute top to bottom within each section. Not every APIM statement is valid in every section or scope.
Scope and inheritance
APIM supports global, workspace, product, API, and operation scopes. V3 uses the following effective chain:
Workspace policy is not used. Most products only group APIs and have no policy, so their APIs inherit directly from global scope. The MFE product is the exception.
<base /> inserts the parent scope at its location. In the normal inbound chain:
- The global policy validates caller and tenant, sets trusted headers, and
creates the validated
jwtcontext. - The product policy (MFE only) applies per-user rate limits and per-tenant
quotas, and validates the capability token with Signet. It fails closed with
403. - The API policy selects the backend, applies API traffic controls, obtains the
APIM managed-identity token, and overrides backend
Authorization. - The operation policy rewrites the URI, validates an
Ion.*role, and optionally performs cache lookup. - The inherited global backend section applies per-API concurrency and executes
forward-request.
Moving or removing <base /> can bypass authentication, capability validation,
tracing, backend-token creation, or forwarding. It is therefore a
security-relevant change. Provider webhook APIs
and public health operations are the reviewed exceptions.
Global platform policy
The environment-specific Rome global policy currently provides:
- a required
Authorizationheader; - generation or preservation of
X-Transaction-Id; - extraction of the tenant claim;
- cached tenant-status validation using a managed-identity-authenticated
HEADrequest for non-Ontinue tenants; - JWT signature, issuer, audience, and validity validation;
- required
rolesandtidclaims; - rejection of
idtyp=apptokens from non-Ontinue tenants; - trusted
X-Tenant-Id, theX-Authorizationcaller-context header, and theForwardedheader; - request, response, and error trace fragments;
- per-API backend concurrency; and
- backend forwarding with a 120-second timeout and failure on backend error.
It does not yet check X-Azure-FDID (gap APIM-02) and does not yet
override an inbound X-Authorization (gap APIM-01). See Global policy
implementation for the full deployed
execution flow, environment differences, and risks.
Product policy
A product policy applies to every API in the product, so it is shared
infrastructure. In V3 only the MFE product (apim-product-mfe-{env}-{reg}-01)
has one. It is implemented by the Signet team in
signet/infrastructure-shared/policies/apim-product-mfe-policy.xml and governed
by the platform team.
A product policy:
- MUST call
<base />as the first inbound statement, so global caller validation runs before any product logic; - MUST NOT modify
Authorization,X-Authorization, orX-Tenant-Id; - MUST fail closed on any validation error, timeout, or non-success result;
- MUST keep
<base />in backend, outbound, and on-error sections; and - MUST receive platform and security review (CODEOWNERS) before deployment.
Webhook inbound exception
A dedicated provider webhook API may omit global inbound <base /> only when the
provider cannot present an ION token and the backend implements the provider’s
sender-validation protocol. The API must still authenticate APIM to the protected
backend, enforce bounded traffic controls, and inherit global backend, outbound,
and error sections. In V3, a webhook API that is reached through the edge MUST
also check X-Azure-FDID at API scope, as the Pigeon Twilio API does.
This is not a general public-API pattern. See Webhook flow implementation for the deployed Phoenix and Pigeon examples.
Service API policy
The API policy applies controls common to every operation in one imported API:
- backend base URL;
- per-caller or per-API rate limiting;
- APIM user-assigned managed-identity token acquisition;
- override of backend
Authorizationwith the APIM token; and - removal of technology-disclosure headers.
Backend authentication belongs at API scope when all operations use the same backend trust boundary. Some services, including Signet, acquire the token in the operation template instead; that is acceptable when every operation uses the template. An operation may override a backend only when it still inherits equivalent authentication and authorization.
Operation policy
The operation policy owns behavior that varies by OpenAPI operationId:
- public-to-backend URI rewrite;
- required
Ion.*role or roles; - optional backend override;
- cache lookup and storage; and
- operation-specific transformation or validation.
Every protected OpenAPI operation must have an explicit operation-policy mapping
or an equivalent API-level authorization rule. An OpenAPI security declaration
documents the contract but does not itself create APIM role enforcement. A
Terraform roles_csv variable is equally not proof: the template has to use it.
Gap APIM-05 is a deployed example where it does not.
Original caller context and backend identity
The backend receives an APIM managed-identity token in Authorization. The
global policy also forwards the validated caller token in X-Authorization and
provides trusted tenant and correlation context.
- APIM MUST override
X-Authorizationwith the validated caller token. A client-supplied value MUST NOT reach a backend. This is not yet enforced (gap APIM-01). - An API MAY replace
X-Authorizationwith APIM’s own token when no caller context is needed downstream; the Internal API does this. X-Authorizationis sensitive bearer data. It MUST NOT be logged, stored, replayed, or forwarded to another service. A BFF reads it to bind the capability token and terminates it.
Caching model
APIM cache policy is operation-specific. A cache key must vary by every request dimension that can change authorization or response content, including customer or tenant context and, for MFE routes, the capability set. A cached customer response must never be servable to another customer.
Only safe, idempotent responses may be cached. Mutations, authorization failures, error responses, and sensitive personalized data are not cached unless a reviewed design proves isolation and correctness.
Diagnostics model
Effective diagnostics combine the API diagnostic resource and inherited trace fragments. Correlation identifiers, route, operation, status, latency, cache result, and bounded authorization outcomes are useful. Full payloads, user attributes, raw claims, and request or response headers can contain customer data or credentials and require minimization.
Authorization, X-Authorization, and X-Capabilities must never appear in
diagnostic output. Production trace destinations, access, sampling, and retention
are controlled platform configuration.