Attribute-Based Access Control (ABAC): Policy Decision Points (PDP) & Contextual Rules
Attribute-Based Access Control (ABAC, NIST SP 800-162) evaluates dynamic attributes across four dimensions: Subject (user clearance, department), Resource (classification, owner, tenant), Action (read, sign, export), and Environment (time of day, client IP, device health). Decisions are calculated dynamically at Policy Decision Points (PDP).
Step 1: Client initiates an action on a target resource via API request.
RBAC cannot express contextual rules such as: 'Employees can only edit financial spreadsheets from corporate VPNs during standard business hours (09:00–17:00), provided the document is not marked Classified'. Expressing this in RBAC would require creating thousands of combinatorial roles.
The Smart Security Gatekeeper: The gatekeeper doesn't just look at your badge title. They inspect whether your badge is active today, check the clock on the wall, verify that you are wearing a hard hat, and check whether the room you want to enter currently contains hazardous chemicals.
[ Subject Attributes ] [ Resource Attributes ]
• department: 'Finance' • classification: 'Confidential'
• clearance: Level 3 • owner_id: 'usr_99'
│ │
└──────────────┬────────────┘
▼
[ Policy Decision Point (PDP) ] ◄── [ Environment Attributes ]
Evaluates Policy: • time: 14:30 (Business Hours)
IF subject.dept == resource.dept • client_ip: corporate VPN range
AND environment.is_business_hours
│
├── Decision: PERMIT (200 OK)
└── Decision: DENY (403 Forbidden)CosmosApp enterprise clients configure compliance policies: 'Only users in the legal department can download contracts, and only if accessed from a corporate-managed laptop within the EU geolocation zone.' CosmosApp evaluates these dynamic rules in its central PDP before issuing download URLs.
Step 1: Client initiates an action on a target resource via API request.
Step 2: Policy Enforcement Point (PEP) intercepts the request and gathers contextual attributes.
Step 3: PEP collects Subject attributes (claims), Resource metadata (database), and Environment context (IP, headers, time).
Step 4: PEP passes the authorization request context to the Policy Decision Point (PDP).
Step 5: PDP evaluates active declarative policies (e.g. written in Rego/OPA or JSON policies).
Step 6: PDP returns an explicit Permit or Deny; PEP enforces the decision.
// CosmosApp ABAC Policy Decision Point (PDP):
interface AbacContext {
subject: { id: string; department: string; clearanceLevel: number };
resource: { id: string; department: string; minClearance: number; isLocked: boolean };
environment: { currentHourUtc: number; isCorporateVpn: boolean };
}
export function evaluateAbacPolicy(ctx: AbacContext): boolean {
// 1. Department match requirement
if (ctx.subject.department !== ctx.resource.department) return false;
// 2. Clearance level evaluation
if (ctx.subject.clearanceLevel < ctx.resource.minClearance) return false;
// 3. Resource state check
if (ctx.resource.isLocked) return false;
// 4. Environmental constraint: Corporate VPN required
if (!ctx.environment.isCorporateVpn) return false;
return true;
}- ✕ABAC completely replaces RBAC (In practice, modern systems use hybrid approaches where a user's role is simply one attribute evaluated by the ABAC engine).
- ✕ABAC is too slow for production APIs (With indexed in-memory policy engines like Open Policy Agent, decisions evaluate in under 1 millisecond).
Key Architectural Takeaways
- ✓ABAC provides fine-grained, dynamic access control based on Subject, Resource, Action, and Environment.
- ✓Decouple policy evaluation (Policy Decision Point) from policy execution (Policy Enforcement Point).
- ✓Use tools like Open Policy Agent (OPA / Rego) for standardized declarative enterprise policy evaluation.
Scattering complex attribute conditional logic across dozens of controller functions and database queries.
Consolidate authorization policies into a dedicated Policy Decision Point (PDP) or policy evaluation service.
What are the four core categories of attributes evaluated by an Attribute-Based Access Control (ABAC) policy engine?