Skip to content
1Claw Academy
Curriculum/Security Foundations2 minBeginner · Lesson 10 of 19

Access control models and policy engines

Compare RBAC, ABAC, and policy-as-code, and understand why deny-by-default is the only safe starting point.

Once identity is settled, something has to decide what that identity may do. Three models dominate, and they layer rather than compete.

  • ACL: a list attached to a resource saying who may touch it. Simple, and it sprawls badly.
  • RBAC: permissions attach to roles, identities get roles. Scales with people; struggles with context.
  • ABAC: decisions consider attributes of the principal, the resource, the action, and the environment. Expressive enough for 'only during business hours, from this network, on non-production data'.

Policy-as-code is the natural end point: rules live in a declarative language, are version-controlled, reviewed, and tested like any other code. Cedar and Rego are two widely used examples.

Watch out

Deny-by-default is the single most important choice in this lesson. An allowlist fails closed: a rule you forgot means access is refused. A denylist fails open: a case you did not anticipate means access is granted. Only one of those failure modes is survivable.

Real engines need a conflict rule, because policies overlap. Two common designs:

  • Deny always wins: simple and predictable, but you cannot carve an exception out of a deny.
  • Explicit priority: each rule carries a number and the highest wins, which is more flexible and demands more care.
Tip

Know which model your system uses before you write a deny rule. Assuming deny always wins, in a system that resolves by priority, produces a rule that silently does nothing.

Finally, separate the decision from the enforcement. A policy decision point evaluates the rules; a policy enforcement point sits in the request path and applies the answer. Keeping them apart is what lets you test policy in isolation, and run it in shadow mode before it can break anything.

Check your understanding

3 questions
1

Why is deny-by-default safer than deny-by-exception?

2

In an engine that resolves conflicts by priority, what happens to a deny rule with a lower priority than an overlapping allow?

3

What is the point of separating the decision point from the enforcement point?