IAM interview questions · Fundamentals
RBAC or ABAC: when would you use each?
In plain wordsRBAC is a key card by job title. ABAC is a bouncer who also checks the time, the place and the guest list.
How it works
RBAC groups permissions into roles (Accountant, Teller) and assigns roles to people. It is easy to explain to auditors and to review: “who has the Approver role?” is a simple query. It struggles when access depends on details, and you end up creating one role per country per department per level: role explosion.
ABAC writes policies over attributes of the user (department, clearance), the resource (owner, classification) and the context (time, device, network). One rule can replace dozens of roles, but attributes must be accurate and policies must be readable and tested.
Most real systems are hybrid: roles give the baseline, attributes and relationships refine it. ReBAC (relationship based, as in Google Zanzibar) is a third option for “owner of”, “member of”, “shared with”.
A concrete example
A hospital: the Nurse role (RBAC) gives access to the patient records app. An ABAC rule then says a nurse can open a record only if the patient is in their ward, during their shift, from a hospital device. Without ABAC you would need a role for every ward and shift.
See it in action: one role, a set of permissions
Mistakes to avoid
- Choosing one model as “the best” without context.
- Building ABAC on HR attributes nobody maintains.
They may also ask you
- How would you detect and fix role explosion?
- Where do you store and evaluate ABAC policies (PDP/PEP)?