Overview

13 Using policy engines with existing systems

ACME’s Customer Collaboration platform started as an internal tool with authorization logic scattered across controllers, stored procedures, and service endpoints. As the company turned it into the multi-tenant Customer Collaboration Cloud, the old project-ID-based boundary was no longer enough: the system needed tenant isolation, federated identity, auditable decisions, and customer-specific customization without sacrificing ACME’s global controls. The chapter shows that adopting a policy engine is a gradual transformation, not a big-bang replacement, and that the core idea is to move decisions out of application code while preserving existing collaboration behavior.

The platform keeps its relationship-based access model for sharing documents, but surrounds it with a broader authorization architecture. A platform layer enforces ACME-wide rules such as tenant separation, data residency, support constraints, and device requirements for employees, while tenant-level policies continue to govern who can view, edit, share, or administer resources inside each tenant’s workspace. Identity and tenancy are formalized through tenant IDs, OIDC-based customer authentication, and separate treatment of ACME-managed employees versus tenant-managed users, with dynamic facts fetched at evaluation time rather than baked into tokens.

To make this work in existing systems, ACME inserts policy enforcement points at multiple places: the gateway for early rejection and global checks, services for fine-grained resource-aware decisions, and the UI for better visibility and usability. These enforcement points share a common schema, request-building logic, logging format, and policy life cycle so that decisions stay consistent, testable, and auditable across the stack. The chapter closes by showing how layered policies, partial evaluation for discovery queries, controlled tenant templates, and strict precedence rules let ACME offer flexibility to customers while keeping platform governance intact.

Evolution of the Customer Collaboration platform. The internal Customer Collaboration Platform (top) is compared with the multi-tenant Customer Collaboration Cloud (C³) (bottom).
C³ authorization flow through global and tenant PEP/PDP layers
Concentric policy layers in the C³ authorization model. Policies in C³ are organized by scope rather than hierarchy. System policies form the outermost layer, overseeing the entire platform and its automation. Inside this layer, application policies govern the Customer Collaboration Cloud service itself, managing multi-tenant governance, data residency, and compliance. At the core, tenant policies handle collaboration within each tenant’s workspace using ReBAC and approved templates.

Summary

  • Converting an internal application into a multi-tenant service requires rethinking authorization boundaries and data isolation.
  • A layered authorization model, including system, application, and tenant layers, clarifies ownership and separates trust domains.
  • A consistent identity and tenancy foundation supports policy evaluation across both federated and hosted tenants.
  • Requests pass through global and tenant PEP/PDP pairs, following the PARC model from enforcement to decision.
  • Policy enforcement points can operate at different levels, such as gateway, service, and UI, with each enhancing security and usability.
  • The UI uses graph traversal, partial evaluation, and batch PDP checks to efficiently address visibility questions.
  • A layered policy architecture and template system enable tenants to customize collaboration securely within shared constraints.
  • ACME’s internal case studies show the effectiveness of layered authorization in real-world operations.
  • An integration checklist now guides new systems joining ACME’s policy engine architecture.

FAQ

What problem did ACME face when turning its internal collaboration tool into a multi-tenant cloud service?ACME had to move from a single-tenant system with authorization rules scattered across controllers, stored procedures, and service endpoints to a multi-tenant SaaS platform with tenant isolation, federated identity, auditable decisions, and controlled customization. The old embedded checks were no longer sufficient.
Why was the original project_id-based boundary not good enough for C³?project_id was only a database convention, not a real tenant boundary. It did not provide separate namespaces for identities, policies, relationship graphs, or audit logs, and each service interpreted it differently.
How did ACME preserve the original sharing model while adding multi-tenancy?ACME kept the ReBAC sharing model for owners, editors, viewers, and delegated sharing, but added a surrounding platform authorization layer. The new layer enforces global rules like tenant isolation and data residency, while tenant-level ReBAC still governs collaboration inside each tenant.
What role does OpenID Connect play in C³?ACME uses OIDC so tenants can authenticate their own users through either federated or hosted identity providers. Tokens carry stable claims such as sub, iss, aud, and tenant_id, which the PEP uses to map the caller to the correct authorization context.
Why does C³ use a PEP as a broker between the application and the policy engine?The PEP verifies tokens, preserves request context, gathers runtime facts, and builds a normalized authorization request for the PDP. This helps avoid confused-deputy problems by ensuring decisions reflect the initiating principal, tenant, action, resource, and context.
What are the two layers in C³’s authorization architecture?The first layer is the platform PDP, which enforces ACME-wide rules such as tenant isolation, device compliance, and data residency. The second layer is the tenant PDP, which enforces collaboration policies within a tenant’s namespace using ReBAC.
Where are policy enforcement points placed in C³?C³ places PEPs at the gateway, inside collaboration services, and in the UI. The gateway handles coarse-grained platform checks, services handle fine-grained resource decisions, and the UI uses policy results to improve usability without replacing backend enforcement.
How does the UI answer “who can access what?” questions?The UI combines relationship-graph traversal, policy scope prefiltering, and batch PDP evaluation. It first gathers candidates from the ReBAC graph, narrows them using partially evaluated policy scopes, and then confirms the results with the tenant PDP.
How does ACME let tenants customize authorization safely?ACME uses approved policy templates and configuration options rather than allowing tenants to write arbitrary Cedar policies. Tenant-generated policies are validated against a shared schema and cannot override platform or application guardrails.
What is the main lesson from ACME’s migration to externalized authorization?The key lesson is that policy engines work best when boundaries, identity, enforcement points, schema, logging, and policy ownership are designed together. Externalized authorization improves consistency, auditability, and flexibility while keeping platform control intact.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Authorization in Action ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Authorization in Action ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Authorization in Action ebook for free