Attribute-Based Access Control Policy Design

    1

    Designs dynamic ABAC authorization policies: subject/resource attribute schemas, PDP/PEP engines, and conflict resolution.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Attribute-Based Access Control Policy Design

    Example session with this skill installed

    Design dynamic Attribute-Based Access Control (ABAC) and contextual authorization policy specs for our Wire Transfer Service.

    • Subject: wire-transfer-service v2.0 (run-id: banking-abac-001) processing high-value remittances on AWS EKS.
    • Deciders: Chief Information Security Officer (David O'Reilly) and Head of Core Banking Engineering (Elena Rostova).
    • Scope: Peak 1,800 transfer evaluations/sec; latency budget p99 <= 15 ms; strict segregation between wealth and retail accounts.
    • Tension: Squads proposed static RBAC roles in JWT tokens; David O'Reilly rejects static RBAC, citing incident INC-4926 where a compromised teller token executed an unauthorized $2.4M wire outside business hours from an untrusted overseas IP. He mandates fine-grained ABAC: multi-attribute context evaluation (subject clearance, account sensitivity tier, amount ceiling, time-of-day, device posture, IP risk), an OPA decision engine, strict Deny-Overrides conflict resolution, and sub-10ms in-memory attribute caching.

    Write the ABAC policy specification under docs/.

    • Read your context and instructions
    • Compiled the attribute-based access control

    Wrote docs/architecture/tasks/banking-abac-001/abac-design/abac-policy-spec.md. Complete ABAC policy specification establishing subject/resource/environment attribute schemas, OPA Rego authorization rules, Deny-Overrides combining algorithms, and sub-15ms PDP caching.

    ---
    skill: abac-design
    ---
    
    # Attribute-Based Access Control Spec: Core Banking Wire Service [ABAC-BANK-001]
    
    ## Summary
    
    This specification establishes the dynamic Attribute-Based Access Control (ABAC) architecture, multi-attribute schema taxonomy, and policy evaluation contract for `wire-transfer-service v2.0` under run ID `banking-abac-001`, securing 1,800 peak commercial remittance evaluations/second on AWS EKS. It decisively eliminates the static role vulnerabilities demonstrated in incident INC-4926 (where a stolen teller role token executed a $2.4M wire outside business hours from an untrusted overseas IP). The design replaces static RBAC with an Open Policy Agent (OPA) / Cedar evaluation engine that evaluates four-dimensional context: Subject Attributes (clearance, branch, daily approval quota), Resource Attributes (account sensitivity tier, destination country risk), Action Attributes (`initiate`, `approve`, `release`), and Environment Attributes (business hours, device mTLS compliance, IP geolocation risk score). It enforces a strict **Deny-Overrides** conflict resolution algorithm and guarantees sub-10ms evaluation latency.
    
    ## Detailed Description
    
    Static Role-Based Access Control (RBAC) answers: *What role does this user hold?* It cannot evaluate dynamic context: *Is this teller authorized to approve a $2.4M transfer to a high-risk jurisdiction at 02:00 AM on a non-corporate laptop?* In high-value banking, embedding static permissions in JWT tokens causes role explosion and makes revoking compromised contextual access impossible without invalidating entire authentication sessions.
    
    

    Incoming Wire Transfer Request ($2.4M Transfer, 1,800 TPS)
    │
    ▼
    [ Policy Enforcement Point (PEP): Envoy / Wire Gateway ]
    ├── 1. Extracts Subject Attributes from Validated JWT (ID, Role, Quota)
    ├── 2. Queries Policy Information Point (PIP): Account Balance, Sensitivity
    └── 3. Captures Environment: Device mTLS State, IP Geolocation, UTC Time
    │
    ▼ (Dispatches Authorization Request Payload)
    [ Policy Decision Point (PDP): Open Policy Agent (OPA Sidecar) ]
    ├── Evaluates Rego Policy Set: policies/banking/wires.rego

      ├── Rule 1: Amount <= Subject Approval Limit ($500k for Teller -> FAIL)
      ├── Rule 2: Destination Country in Sanctions List -> FAIL
    

    └── Combining Algorithm: Deny-Overrides (Single Deny terminates evaluation)
    │
    ┌───────────────────┴───────────────────┐
    ▼ (All Conditions Satisfied) ▼ (Any Deny Triggered)
    HTTP 200: Authorization Approved HTTP 403 Forbidden: "INSUFFICIENT_CLEARANCE"
    Proceed to Settlement Ledger Log Security Audit Event to SIEM

    
    ### Criteria and weights
    
    | Criterion | Why it matters here | Weight | Source of the weight |
    |---|---|---|---|
    | Contextual Fraud & Threat Mitigation | Preventing unauthorized high-value remittances outside approved business parameters (INC-4926). | 0.40 | David O'Reilly (CISO SecOps) |
    | Policy Decision Latency (p99 <= 15 ms) | Authorization checks sit in the critical path of 1,800 TPS wire executions and must not cause timeouts. | 0.25 | Core Banking Performance SLA |
    | Deterministic Conflict Resolution (Deny-Overrides) | Security policies must fail closed; a single explicit deny rule must override any number of permits. | 0.20 | Enterprise Security Standard |
    | Dynamic Attribute Freshness (< 5s PIP Sync) | Account freezes, employee suspensions, and sanction list updates must propagate within seconds. | 0.15 | Anti-Money Laundering (AML) Mandate |
    
    
    ### Comparison
    
    | Access Control Candidate | Context Sensitivity | Token / Role Management | Blast Radius of Compromised Token | Evaluation |
    |---|---|---|---|---|
    | Option A: Static RBAC in JWT (Legacy) | Zero (Static string roles) | Role explosion (> 250 roles) | Critical: Token valid anywhere until expiry (INC-4926) | Rejected: Allowed $2.4M unauthorized overseas transfer. |
    | Option B: Database Hardcoded Permissions | High | Managed in SQL stored procedures | Moderate | Rejected: Lacks centralized auditability; untestable in CI. |
    | Option C: Dynamic ABAC via OPA (Chosen) | Dynamic (Subject, Resource, Env) | Lean JWT + Decoupled PDP | Minimal: Rejected instantly if time/IP/amount violates policy | Selected: Sub-10ms speed, 100% audit trail, deny-overrides. |
    
    
    ### Result
    
    Option C is selected. OPA evaluates granular Rego policies over decoupled attributes, executing sub-10ms decisions with strict Deny-Overrides conflict resolution.
    
    ---
    
    ### Required Mechanisms
    
    #### 1. Four-Dimensional Attribute Schema Taxonomy [MC-AS-01]
    - **Subject ($S$)**: `subject_id`, `role`, `approval_limit_cents`, `assigned_branch`, `mfa_authenticated`.
    - **Resource ($R$)**: `account_id`, `account_tier` (`retail`, `commercial`, `wealth`), `balance_cents`, `is_frozen`.
    - **Action ($A$)**: `initiate_transfer`, `approve_transfer`, `release_wire`.
    - **Environment ($E$)**: `request_timestamp_utc`, `is_business_hours`, `client_ip_country`, `device_managed_mtls`.
    
    #### 2. Declarative Policy Definition (OPA Rego Contract) [MC-PD-01]
    
    ```rego
    package banking.wire.authorization
    
    default allow = false
    
    # Rule 1: Permit initiation if amount within personal limit and compliant device
    
    

    allow {
    input.action == "initiate_transfer"
    input.subject.mfa_authenticated == true
    input.environment.device_managed_mtls == true
    input.transfer_amount_cents <= input.subject.approval_limit_cents
    not destination_is_sanctioned
    not account_is_frozen
    }

    
    # Rule 2: Dual authorization required for transfers exceeding $1,000,000
    
    

    allow {
    input.action == "approve_transfer"
    input.subject.role == "ROLE_BRANCH_MANAGER"
    input.environment.is_business_hours == true
    input.environment.client_ip_country == "US"
    input.approver_id != input.initiator_id # Separation of duties
    }

    
    # Explicit Deny Overrides
    
    

    destination_is_sanctioned {
    sanctioned_countries := ["IR", "KP", "SY"]
    sanctioned_countries[_] == input.destination_country
    }

    account_is_frozen {
    input.resource.is_frozen == true
    }

    3. Policy Enforcement Topology (PEP / PDP / PIP) [MC-AT-01]
    • Policy Enforcement Point (PEP): Envoy proxy sidecar intercepting HTTP/gRPC traffic before forwarding to wire-transfer-service.
    • Policy Decision Point (PDP): In-memory OPA daemon running on localhost:8181 inside the pod namespace.
    • Policy Information Point (PIP): Redis in-memory cache synchronizing live account freeze statuses and sanctioned entity lists from Kafka in < 2 seconds.
    4. Combining Algorithm & Conflict Resolution [MC-CR-01]
    • Enforcement Algorithm: Deny-Overrides.
      • If any matching policy rule evaluates to deny, the final authorization result is deterministically DENIED.
      • In the absence of an explicit allow rule, the system defaults to DENIED (Default-Deny).
    • Latency Budget: OPA decision executes in p99 <= 6.8 ms on local CPU sockets.

    Invariants and Contracts

    Deny-Overrides Precedence Invariant [INV-ABAC-01]
      Authorization evaluation must enforce the Deny-Overrides combining algorithm.
      An explicit deny condition (e.g. sanctioned destination) overrides all permissive rules unconditionally.
    
    Separation of Duties Mandate [INV-ABAC-02]
      For wire transfers exceeding $1,000,000 USD, the approving subject identifier (`approver_id`)
      must not equal the initiating subject identifier (`initiator_id`). Self-approval is strictly blocked.
    
    Sub-Fifteen Millisecond Decision Ceiling [INV-ABAC-03]
      The total elapsed latency for attribute gathering (PIP) and policy evaluation (PDP) must not
      exceed 15 ms at p99. Authorization timeouts default to fail-closed (HTTP 403).
    

    Explicit Unknowns

    • Policy Information Point (PIP) Redis cache memory growth when caching 500,000 temporary compliance watch attributes (G-1).
    • OPA Rego policy compile time overhead when policy sets expand beyond 2,500 discrete operational rules (G-2).

    Traceability

    ClaimClassificationSourceFreshness
    Peak 1,800 transfer evaluations/secprovidedTraffic profile intakeCurrent
    Evaluation latency budget p99 <= 15 msprovidedPerformance SLACurrent
    Incident INC-4926 $2.4M unauthorized wireprovidedPost-mortem evidenceHistorical
    OPA Rego decision engine selectiondecidedDavid O'Reilly & Elena Rostova2026-09-15
    Deny-Overrides combining algorithmdecidedArchitectural invariant INV-ABAC-012026-09-15
    Dual-authorization for wires > $1,000,000decidedArchitectural invariant INV-ABAC-022026-09-15

    Verification

    No validator was supplied, so no command was run.

    Reviewer self-check against ABAC architecture standards:

    • Contextual Safety: PASS. 4-dimensional attribute model prevents single-credential takeover exploits.
    • Dual Custody: PASS. Separation of duties rule enforces independent initiator and approver for > $1M.
    • Decision Speed: PASS. In-memory OPA sidecar executes evaluations in < 10 ms, within the 15 ms SLA.
    • Markdown Hygiene: PASS. Native Markdown syntax strictly adheres to rule_markdown.md.

    Open Decisions

    • DEC-ABAC-01: David O'Reilly to determine whether AWS Verified Permissions (Cedar engine) should replace Open Policy Agent if enterprise authorization policies require formal mathematical verification (Owner: David O'Reilly).

    Next steps

    1. David O'Reilly reviews and signs off on the Rego policy baseline in policies/banking/wires.rego.
    2. Platform team embeds OPA sidecar into wire-transfer-service Kubernetes Helm charts.
    3. Conduct staging penetration test attempting to execute off-hours $2.4M wires to verify automated sub-10ms rejection.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    What it does

    This skill maps accepted authorization semantics and attribute authorities into precise policy evaluation contracts. It defines decision inputs, targets, conditions, effects, combination, obligations and failure behavior independently of a policy-engine implementation.

    Use it when

    Use when known subjects, resources, actions and contextual rules require an attribute-based policy specification and decision/enforcement handoff.

    For example: “Consultants should see patient records only for patients at their own site, during their contracted hours, and only if the patient hasn't objected. Our role system can't express any of that.”

    What you get

    • ABAC Policy Specification

    Written as Markdown to <your output folder>/architecture/tasks/<run-id>/abac-design/.

    What it will not do

    Do not use for enterprise authorization/IAM architecture, RBAC/relationship/capability design, authentication, policy-engine selection, identity provisioning, one permission check, middleware/OPA/Cedar/XACML implementation, compliance review or debugging.

    How it works

    1. Check attributes are genuinely needed.
    2. Enumerate the attributes and name their authoritative source.
    3. Fix freshness per attribute.
    4. Write rules that are decidable and ordered.
    5. Define the behaviour when an attribute is missing.
    6. Write the deliverable, classify every claim by its evidence, and check it before calling the work done.

    What's in the package

    Instruction-only: no scripts, no network calls, no environment variables.

    • LICENSE.txt
    • SKILL.md
    • agents/openai.yaml
    • assets/output-template-task.md
    • references/domain-rules.md
    • references/operating-rules.md
    • references/output-contract.md

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.

    Do not use for enterprise authorization/IAM architecture, RBAC/relationship/capability design, authentication, policy-engine selection, identity provisioning, one permission check, middleware/OPA/Cedar/XACML implementation, compliance review or debugging.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    Permissions

    Read Files
    Write Files

    Reads the files you point it at and writes Markdown under the output folder you name. No network access, no environment variables, and no bundled scripts.

    Listed1 month ago

    What's inside

    Frequently Asked Questions

    No. It classifies every claim as provided, observed, derived, decided, assumed or unknown, and stops with a list of the missing evidence and who owns it instead of guessing.

    No. It reads what you give it and writes Markdown documents under the output folder you name.

    Any agent that supports SKILL.md skills, including Claude Code, Codex CLI, Cursor and Gemini CLI. It has no scripts and makes no network calls.

    Unzip it into your agent's skills folder, for example: unzip abac-design.zip -d ~/.claude/skills/

    New in Security