# Access Control Models
> The data an authorization decision reasons over: an ACL on the object, a role on the subject (RBAC), attributes of subject, resource and environment (ABAC), or the relationship graph between them (ReBAC/Zanzibar). Choosing the wrong one produces the gaps attackers exploit.
## How it works
| Model | Decision input | Breaks down when | Security-relevant failure |
|---|---|---|---|
| **ACL** | per-object list of principals | many objects, sharing, inheritance | orphaned entries after re-org/offboarding |
| **RBAC** | role → permissions | ownership, per-tenant scope, exceptions | **role explosion**; coarse roles answer "may edit invoices" but not "*this* invoice". Exactly the gap BOLA lives in |
| **ABAC** (NIST SP 800-162) | attributes of subject, object, action, environment | attribute provenance unclear | attacker-influenced attributes; business and security attributes mixed without an owner |
| **ReBAC** | graph of relations (owner, member, parent) | data must be kept in sync with app DB | stale tuples, the "new enemy" problem |
| **PBAC** | policy evaluated by a central engine | n/a. This is *architecture*, not a model | see [[Authorization Policy Engines]] |
The IDPro taxonomy argues that "RBAC/ABAC/PBAC" conflate different questions. Describe a system as a tuple over six axes: **administration** (who writes rules), **model** (what data drives the decision), **policy** (rule format), **information** (where decision data comes from), **decision** (where it's computed; PBAC lives here), and **enforcement** (where it's applied: gateway, middleware, DB). When reviewing a design, the *information* and *enforcement* axes are where most exploitable bugs sit.
### RBAC to ABAC in practice
AWS IAM condition keys are ABAC bolted onto RBAC. One policy replaces a role per department:
```json
{"Effect":"Allow","Action":["ec2:StartInstances","ec2:StopInstances"],"Resource":"*",
"Condition":{"StringEquals":{"ec2:ResourceTag/Department":"${aws:PrincipalTag/Department}"}}}
```
The security of this rests entirely on who can set `Department` tags. Attribute write access is privilege.
### ReBAC and Zanzibar
Google Zanzibar (behind Drive and hundreds of other Google services) stores relation tuples `<object>#<relation>@<user>`, e.g. `file123#owner@alice`, and computes permissions by graph traversal. It serves >2 trillion ACLs, with 95% of checks under 10 ms and 99.999% availability. API: read, write, watch, check, expand. Open implementations: SpiceDB, OpenFGA, Permify.
**New enemy problem**: Alice removes Bob from a folder, then adds a sensitive doc. If the check runs on a replica that hasn't seen the removal, Bob reads the new doc. Zanzibar fixes this with **zookies**, opaque tokens encoding the write timestamp, stored with content versions and passed on later checks so evaluation uses data "no older than" that snapshot.
**Dual-write consistency**: relationships live in both the app DB and the authz store. SpiceDB patterns: 2PC-like (DB commit only if the SpiceDB write succeeds), CQRS streaming through Kafka, or async updates where staleness is acceptable. Every async path is a window where revoked access still checks `true`.
OpenFGA positions ReBAC as a superset of RBAC (roles are just relations) and adds **conditions** and **contextual tuples** to cover ABAC-style cases. OWASP's Authorization Cheat Sheet explicitly recommends ABAC/ReBAC over RBAC for object-level decisions.
## Defenses / design guidance
- Use RBAC for coarse function gates ([[Function Level Authorization]]) and ReBAC/ABAC for object and tenant scope ([[Insecure Direct Object Reference]], [[Multi-Tenant Isolation]]).
- Avoid the all-powerful admin role; it becomes the single point of compromise.
- Give every attribute and relation an owner and a source of truth. Make explainability ("why does X have access?") a requirement.
- Wire revocation into lifecycle events (offboarding, re-org, role change) and propagate it synchronously, or carry consistency tokens.
- Measure P95 authz-check latency. Slow checks get cached, and caches go stale.
## Related
- [[Authorization Security]]
- [[Authorization Policy Engines]]
- [[Broken Access Control]]
- [[Privilege Escalation]]
- [[Multi-Tenant Isolation]]
- [[AI Agent Authorization]]
## Sources
- [[raw/dev.to/rbac-vs-abac-vs-rebac-how-to-choose-access-control-models-4313|RBAC vs ABAC vs ReBAC: How to Choose Access Control Models]]
- [[raw/osohq.com/rebac-authorization-academy-oso-3956|ReBAC Authorization Academy - Oso]]
- [[raw/osohq.com/rbac-vs-abac-vs-pbac-oso-3957|RBAC vs ABAC vs PBAC - Oso]]
- [[raw/osohq.com/rbac-vs-abac-vs-rebac-oso-3958|RBAC vs ABAC vs ReBAC - Oso]]
- [[raw/system-design.space/rights-management-approaches-acl-rbac-abac-rebac-4896|Rights Management Approaches: ACL, RBAC, ABAC, ReBAC]]
- [[raw/openfga.dev/authorization-concepts-openfga-3964|Authorization Concepts - OpenFGA]]
- [[raw/csrc.nist.gov/nist-sp-800-162-guide-to-abac-3974|NIST SP 800-162: Guide to ABAC]]
- [[raw/idpro.org/authorization-terminology-is-a-mess-let-s-fix-it-11955|Authorization terminology is a mess: Let's fix it]]
- [[raw/authzed.com/introduction-to-google-zanzibar-3961|Introduction to Google Zanzibar]]
- [[raw/workos.com/what-is-google-zanzibar-4905|What is Google Zanzibar?]]
- [[raw/aserto.com/how-google-drive-models-authorization-a-look-into-zanzibar-4901|How Google Drive Models Authorization: A Look into Zanzibar]]
- [[raw/permify.co/implementing-google-zanzibar-a-demonstration-of-its-basics-4899|Implementing Google Zanzibar: A Demonstration of Its Basics]]
- [[raw/authzed.com/relationship-based-permissions-in-spicedb-3960|Relationship-Based Permissions in SpiceDB]]
- [[raw/cheatsheetseries.owasp.org/authorization-cheat-sheet-owasp-3977|Authorization Cheat Sheet - OWASP]]