Lion Cipher Lab

Write and test authorization policies with Cedar

Why it matters

Most authorization — deciding who is allowed to do what — gets written as if-statements sprinkled through application code: `if user.role == 'admin' or (doc.owner == user.id and not doc.locked): ...`. That works until it doesn't. The rules end up duplicated across services, no one can answer 'who can actually access this?' without reading code, and you can never PROVE the rules are consistent, because arbitrary code is not analyzable. Cedar is an answer to exactly this. It is an open-source authorization policy language created by AWS (and the engine behind Amazon Verified Permissions) that…

What you'll learn

Steps in this lab

  1. What Cedar is, and what 'policy-as-authorization' means
  2. Install the Cedar CLI (`cedar`)
  3. Write a schema: the shape of your world
  4. Write the policies: permit, forbid, and a `when` condition
  5. Author entities and run `cedar authorize` — see ALLOW and DENY
  6. Forbid-wins in one sentence, then let `cedar validate` catch a bug
  7. The judgment: RBAC vs ABAC vs ReBAC, and when NOT to use a policy language
  8. What you did — and the reflex to keep

Open the full interactive lab →