Skip to main content

Attribute-Based Access Control (ABAC)

ABAC evaluates attributes of the subject (the user), the resource, the action, and the environment (time, IP, device) against declarative policies. Unlike RBAC — which answers "does the user have role X?" — ABAC answers "do the facts about this request satisfy policy Y?". That lets you express rules like "engineering users can write to internal documents during business hours from trusted IPs" without baking role combinations into code.

Use ABAC when decisions depend on dynamic context. It pairs well with RBAC: role membership gates the capability, ABAC narrows it down with conditions.


How ABAC Works

An ABAC policy evaluates four attribute categories:

CategoryExamples
Subject (who)User role, department, clearance level, group membership
Resource (what)Document classification, owner, creation date
Action (how)Read, write, delete, approve
Environment (context)Time of day, IP address, device type, location

Example Policy

"Allow users in the engineering group to write to internal documents during business hours (9 AM – 6 PM) from trusted IP ranges."

Subject: group = "engineering"
Resource: classification = "internal"
Action: write
Environment: time between 09:00-18:00 AND ip in trusted_ranges
Decision: ALLOW

Managing ABAC Policies

Create a Policy

  1. Go to /orgs/{orgId}/portal/access-management/abac.
  2. Click Create Policy.
  3. Define the policy:
FieldDescription
NameHuman-readable policy name
DescriptionWhat this policy controls
Subject ConditionsAttribute conditions on the user
Resource ConditionsAttribute conditions on the target resource
ActionThe action being controlled
Environment ConditionsContextual conditions
DecisionAllow or Deny
PriorityEvaluation order (higher priority evaluated first)

Policy Evaluation

LumoAuth combines policies using the deny-overrides algorithm:

  1. Collect every policy whose action and resourceType match the request.
  2. Evaluate each matching policy's conditions against the request attributes.
  3. If any policy with decision: DENY matches, the final decision is Deny.
  4. Otherwise, if at least one policy with decision: ALLOW matches, the final decision is Allow.
  5. If no policy matches, the default is Deny (closed-world assumption).

Priority controls the order in which policies are considered, which is especially useful for ensuring restrictive deny policies are evaluated before broader allows.


Subject Attributes

Built-in user attributes available to conditions:

AttributeDescriptionExample
user.emailUser's email addressalice@acme.com
user.rolesAssigned roles["editor", "auditor"]
user.groupsGroup memberships["engineering"]
user.departmentDepartment field"engineering"
user.created_atAccount creation date2025-01-15
user.mfa_enabledWhether MFA is activetrue
user.email_verifiedEmail verification statustrue

Environment Attributes

Contextual attributes evaluated at request time:

AttributeDescriptionExample
env.timeCurrent time14:30
env.day_of_weekCurrent daymonday
env.ip_addressRequest source IP192.168.1.100
env.countryGeoIP countryUS
env.device_typeDevice classificationdesktop
env.auth_methodHow the user authenticatedpasskey
env.risk_scoreAdaptive auth risk score25

Example Policies

Require MFA for Sensitive Actions

Name: Require MFA for sensitive actions
Subject: user.mfa_enabled = false
Action: delete, approve
Decision: DENY

Geographic Restriction

Name: Allow access only from US
Environment: env.country != "US"
Decision: DENY

Business Hours Only

Name: Allow write access during business hours
Action: write
Environment: env.time >= 09:00 AND env.time <= 18:00
AND env.day_of_week in ["monday","tuesday","wednesday","thursday","friday"]
Decision: ALLOW

Block High-Risk Sessions

Name: Block high-risk sessions
Environment: env.risk_score >= 80
Decision: DENY

Combining ABAC with RBAC

ABAC complements RBAC. A common pattern:

  1. RBAC decides what a user can do based on their roles.
  2. ABAC decides when and where they can do it based on context.

Example: the editor role grants documents:write, and an ABAC policy limits documents:write to business hours from trusted IPs.


Testing Policies

Use the Permission Tester at /orgs/{orgId}/portal/access-management/permission-tester:

  1. Select a user.
  2. Specify the resource and action.
  3. Set environment context (time, IP, etc.).
  4. Review which policies match and the resulting decision.
  5. Debug policy conflicts.