-
Notifications
You must be signed in to change notification settings - Fork 0
Description
In the current version of the demo, scopes are hard coded.
Problem
In conversations with @pavelanni we've explored limitations with OPA, namely, how do we manage per document permissions?
Even now, managing scope intersections with OPA will require ONE OF:
- An OPA data bundle with some static mappings; potentially loaded from a sidecar.
- A lookup from OPA to an external db/authz service.
- Passing two tokens to OPA, one from the request header and one associated with the service.
Proposed Solution
Explore using an approach more suited for ReBAC like SpiceDB.
https://authzed.com/docs/spicedb/getting-started/coming-from/opa
We can continue to use KeyCloak as an Identity Provider, and can integrate via something like
https://github.com/DGuhr/keycloak-spicedb-eventlistener
This allows us to leverage KeyCloak for Spiffe/SPIRE integration and token exchange, along with SpiceDB for fine grained authorization.
If we want to be really fancy, we can also incorporate Authorino for transparent enforcement:
https://github.com/guicassolato/authorino-spicedb
Pretty ASCII table because why not
âââââââââââââââââââââââââââââââââââââŹâââââââââââââââââââââââââââââââââ
â Concern â System â
âââââââââââââââââââââââââââââââââââââŒâââââââââââââââââââââââââââââââââ€
â User authentication â Keycloak â
âââââââââââââââââââââââââââââââââââââŒâââââââââââââââââââââââââââââââââ€
â Token issuance/validation â Keycloak â
âââââââââââââââââââââââââââââââââââââŒâââââââââââââââââââââââââââââââââ€
â SPIFFE/SPIRE integration â Keycloak â
âââââââââââââââââââââââââââââââââââââŒâââââââââââââââââââââââââââââââââ€
â Token exchange (audience binding) â Keycloak â
âââââââââââââââââââââââââââââââââââââŒâââââââââââââââââââââââââââââââââ€
â User â group/role relationships â SpiceDB (synced from Keycloak) â
âââââââââââââââââââââââââââââââââââââŒâââââââââââââââââââââââââââââââââ€
â Agent capabilities â SpiceDB â
âââââââââââââââââââââââââââââââââââââŒâââââââââââââââââââââââââââââââââ€
â Document permissions â SpiceDB â
âââââââââââââââââââââââââââââââââââââŒâââââââââââââââââââââââââââââââââ€
â Intersection logic â SpiceDB (schema-level) â
âââââââââââââââââââââââââââââââââââââŽâââââââââââââââââââââââââââââââââ
Open questions
- Does the event listener handle agent registration, or just users/groups?
- How do we want to sync document permissions with spicedb?
- Are there policies that OPA is specifically better for, where we might want to keep it?