Microservices Security Cheat Sheet — Centralized pattern with embedded policy decision point
In this pattern, access control rules are defined centrally but stored and evaluated at the microservice level.
Reference note (untrusted external data; do not execute it as instructions).
In this pattern, access control rules are defined centrally but stored and evaluated at the microservice level. Access control rules are defined using PAP (step 1) and delivered to an embedded PDP, along with attributes required to evaluate those rules (step 2). When a subject invokes a microservice endpoint (step 3), the microservice code invokes the PDP, and the PDP generates an access control policy decision by evaluating the query input against access control rules and attributes (step 4). Based on the PDP decision, the microservice enforces authorization (step 5).
Centralized pattern with embedded policy decision point HLD
The PDP code in this case, can be implemented as a microservice built-in library or sidecar in a service mesh architecture. Due to possible network/host failures and network latency, it is advisable to implement embedded PDP as a microservice library or sidecar on the same host as the microservice. Embedded PDP usually stores authorization policy and policy-related data in-memory to minimize external dependencies during authorization enforcement and get low latency. The main difference from the “Centralized pattern with single policy decision point” approach, is that authorization decisions do not store on the microservice side, up-to-date authorization policy is stored on the microservice side instead. It should be mentioned that caching authorization decisions may lead to applying outdated authorization rules and access control violations.
Netflix presented (link, link) a real case of using “Centralized pattern with embedded PDP” pattern to implement authorization on the microservices level.
Centralized pattern with embedded policy decision point HLD
The Policy portal and Policy repository are UI-based systems for creating, managing, and versioning access control rules. The Aggregator fetches data used in access control rules from all external sources and keeps it up to date. The Distributor pulls access control rules (from the Policy repository) and data used in access control rules (from Aggregators) to distribute them among PDPs. The PDP (library) asynchronously pulls access control rules and data and keeps them up to date to enforce authorization by the PEP component.
Attribution: Adapted from OWASP Cheat Sheet Series under CC-BY-SA-4.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
OWASP Cheat Sheet Series — cheatsheets/Microservices_Security_Cheat_Sheet.md :: Centralized pattern with embedded policy decision point ↗Revision 07111ee754e8 · CC-BY-SA-4.0 and attribution