That is the kind of failure Attribute-Based Access Control (ABAC) with Open Policy Agent (OPA) is built to prevent. Rules hardcoded in application code or scattered across services create blind spots. ABAC centralizes access decisions based on real data—user attributes, resource attributes, and context—while OPA enforces those policies consistently in every system that matters.
ABAC is not about “roles” alone. A role is static. Attributes are dynamic—team, project, clearance level, department, device security state, time of request. With ABAC, you define clear policies like:
- If a user is in department X and the resource is classified Y and the request comes from a secure network, allow.
- If the project tag on the resource mismatches the user’s assigned project, deny.
These rules don’t live in code branches scattered across repos. They live in policies. OPA reads them, evaluates them, and responds. The code that asks for authorization never changes when policies change.
Open Policy Agent is a CNCF project made for this. It runs as a sidecar, daemon, or library inside your stack. It takes a request context as JSON, compares it with your policies written in Rego, and returns a yes or no (and why). The separation of policy from code means you can update rules without redeploying applications. It also means you gain a single source of truth for access control.
When ABAC and OPA work together, you gain: