liveBook · Manning

Attribute-based access control

As explained in Secure APIs

Attribute-based access control is an authorization model that determines permissions from attributes of users, resources, and contextual conditions.

Attribute-based access control (ABAC) determines API permissions from a user's attributes, the requested resource, and the surrounding business context. The API takes the user ID from the access token's sub claim, retrieves attributes from a database, and evaluates the combination before allowing access. section 7.7

ABAC is more flexible than putting permissions directly in an access token because authorization data can change without updating the authorization server. That flexibility creates risk: rules become complex, implicit assumptions accumulate, and testing and validation become difficult. section 7.7 section 7.8

A project-management API might evaluate access using:

  • Job title, geographical location, and project affiliation. section 7.7
  • Management scope, such as global, national, regional, state, county, or local access. section 7.7
  • Business function and operation type, including separate read and write permissions. section 7.7

Testing an attribute condition

A payments application may permit a user to make payments only after the user's bank account has been verified. An ABAC test should attempt the operation before verification and confirm that the condition is enforced. section 12.4

Figure 7.18 When we apply ABAC, the API determines whether a user has access to the requested resource by checking their combination of attributes in the database.
figure

Use the figure to trace how the API combines a user's stored attributes with the requested resource when deciding access. section 7.7

How Secure APIs covers it

How deep it goes
Explains token-derived identity, database lookups, hierarchical scopes, and business rules, while warning that complexity makes validation difficult.
Examples
Uses project-management scopes, geographical attributes, read/write functions, and bank-account verification tests.
What it assumes
Assumes access tokens, user identifiers, databases, API endpoints, and basic authentication concepts.
What you can do after
Diagnose authorization failures by testing whether required user attributes and state conditions are enforced.
How it connects
Connects authorization to access tokens, databases, contextual attributes, and role-based access control.

Also explained in

Compare how 4 books explain attribute-based access control →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Secure APIs. The section links point to the parts of the book it draws on.