Skip to content
Back to CurriculumLesson 22 of 30
authz-rbacAdvanced

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).

Interactive Visual Concept ExplainerStep-by-Step Educational Simulation
Visual Step-by-Step Concept Explainerauthz-rbac
Attribute-Based Access Control (ABAC): Policy Decision Points (PDP) & Contextual Rules
Steps:
Policy Decision Point (PDP) 4D EvaluationPERMIT (200 OK)
Subject: Doctor (Dept: Cardiology)
Resource: Medical Record (Confidential)
Environment Time: 14:30 (Shift Hours)
Client IP: intranet
Time:
Network:
Step 1 of 6
Auto-stepping (1x)

Step 1: Client initiates an action on a target resource via API request.

Security Guarantee: ABAC provides fine-grained, dynamic access control based on Subject, Resource, Action, and Environment.
Why This Architectural Concept Exists

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.

Intuitive Mental Model

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.

Architectural System TopologyProtocol Diagram
[ 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 Production Milestone

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-by-Step Execution Sequence
01

Step 1: Client initiates an action on a target resource via API request.

02

Step 2: Policy Enforcement Point (PEP) intercepts the request and gathers contextual attributes.

03

Step 3: PEP collects Subject attributes (claims), Resource metadata (database), and Environment context (IP, headers, time).

04

Step 4: PEP passes the authorization request context to the Policy Decision Point (PDP).

05

Step 5: PDP evaluates active declarative policies (e.g. written in Rego/OPA or JSON policies).

06

Step 6: PDP returns an explicit Permit or Deny; PEP enforces the decision.

Production Architecture Blueprint
// 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;
}
Common Architectural Misconceptions
  • ✕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.
Common Architectural Pitfall

Scattering complex attribute conditional logic across dozens of controller functions and database queries.

Production Best Practice Fix

Consolidate authorization policies into a dedicated Policy Decision Point (PDP) or policy evaluation service.

Interactive Knowledge Check

What are the four core categories of attributes evaluated by an Attribute-Based Access Control (ABAC) policy engine?