A deep architecture guide to closing broken object-level authorization (BOLA) in Azure microservices with a shared enforcement library, a relationship-aware decision service, separate identities for users and workloads, explicit suppressions, and coverage telemetry that flags endpoints where no check ran.
Key points
- OWASP API1:2023 requires an object-level authorization check on every endpoint that accepts an object identifier.
- `AuthorizeAllAsync` reads subject and tenant from the validated identity context, never from caller-supplied parameters.
- Batch calls use all-of semantics: one unauthorized ID rejects the whole request, so partial results need a separate API.
- `Allow`, `Deny` and `Error` stay distinct; `Error` maps to 503, `Deny` to 403, and nothing falls back to allow.
- User-facing chains use the OBO flow; workload operations use managed identity with a narrow, time-bounded service grant.
- Suppression metadata needs a written reason, and a `NotApplied` KQL query over `AppRequests` exposes routes with no decision.
Why it matters
Anyone shipping a CRUD API on Azure eventually hits the record-ID question, and most teams answer it ad hoc inside each handler. What this pattern buys is uniformity: one enforcement entry point, one place where tenant and subject come from validated claims, and a telemetry marker that turns a forgotten check into a failing test instead of an incident.
The cost is real — a network hop per decision and a service grant lifecycle to own — so start with the handlers that expose caller-controlled IDs and batches, and confirm whether your gateway already enforces coarse scopes. Also verify the 403/404 choice against your own disclosure policy.
Real-world use
- A booking flow where a Rules service calls a Records service to detect conflicting bookings, sometimes as the user and sometimes as the system.
- A balances endpoint that returns several members' data from a caller-supplied ID list and must authorize the batch in one call.
- A multi-tenant SaaS API where a valid relationship in one tenant must never grant access in another tenant.
- A reference-data endpoint such as a country list that declares why object authorization does not apply.
This summary was generated by the agent from the original post on Azure Architecture Blog. The full text and all rights belong to its author and publisher. Go to original