Lion Cipher Lab

Reimplement Azure RBAC evaluation from scratch: Actions, NotActions, DataActions, deny assignments and scope inheritance (offline)

Why it matters

Ask 'who can read the payments data?' about an Azure storage account and most people open the storage account's Access control (IAM) page and read the list. That list is the input to a decision, not the decision. Azure Resource Manager walks up from the storage account through the resource group, the subscription and every management group above it, collects every role assignment that reaches down, checks deny assignments first, subtracts NotActions from Actions role by role, and only then evaluates conditions. Three misunderstandings live in that pipeline and every one of them shows up in…

What you'll learn

Steps in this lab

  1. The question this engine answers, and the words you need first
  2. Set up: one folder, two files, no installs
  3. Role definitions are data: copy seven real built-in roles
  4. Matching an operation, and the subtraction that happens per role
  5. Scope inheritance: walk from a resource up to the root
  6. Deny assignments: the only real 'deny', and you cannot write one by hand
  7. Conditions: a small evaluator that refuses what it does not understand
  8. The tenant: eleven principals, fourteen role assignment attempts, one rejection
  9. The full engine: create azure_rbac_eval.py and run it
  10. Read the matrix: 28 requests, 28 correct, and three naive models that are not
  11. Watch three decisions step by step
  12. The audit: who can write role assignments at each scope
  13. Measure the fix: data reach before and after allowSharedKeyAccess=false
  14. What this engine ignores, and why you must not ship it
  15. Azure versus AWS versus Google Cloud: the one-paragraph difference

Open the full interactive lab →