Authorisation & Access Control Review
Checks that what each role is meant to be allowed to do is what the code actually allows, at every way in — not only at the ones somebody remembered to protect.
Deliverable
One Markdown document, access-control-review.md, in the structure set out under Output below. It tests the trust boundaries that Threat Modelling identifies, it goes deeper on access than Security Review of a Change can within one change, and it gives the system's owners a permission matrix they can correct and keep.
Required inputs
- The intended model — the roles, the resources and the actions each role may take on each, as their owner states it.
- The code and configuration that enforce it — access to the codebase and to the authorisation, identity and gateway configuration.
- The entry points — the routes, endpoints, jobs, consoles, exports and any direct access to data by which a resource can be reached.
- The identities that exist — the roles, groups and service accounts actually in use.
If the intended model, the code or the entry points are absent, stop and report it. If the model is stated only in part, continue, treat every cell the owner did not state as unknown — not as deny and not as allow — and list the unstated cells for the owner to settle.
Optional inputs
- Audit logs showing who did what
- The identity provider's configuration and the role mappings it applies
- A list of service accounts with their scopes and owners
- How data is classified, and which classes are regulated
- Existing tests of permissions
- Findings from an earlier review
Absent optional inputs do not stop the review. Each becomes a line saying what could not be checked and who holds the material that would check it.
Execution
1 — Write the intended matrix. Role against resource against action, exactly as the owner stated it. Cells the owner did not state are unknown. The matrix is the test; it is not edited to match the code.
2 — Enumerate every way to reach each resource. From the code, not from the documentation: public and authenticated routes, internal services, background jobs, administrative consoles, exports and reports, webhooks, file and object access, and direct database or storage access. An entry point found in the code and missing from the owner's list is undeclared and is reviewed like the rest.
3 — Locate the enforcement for each entry point. The check that decides access, where it runs, and what it actually tests: who the caller is, what role they hold, whether they own the object, which tenant they belong to. An entry point with no check is unenforced.
4 — Compare enforcement with the matrix. For each cell and each entry point: enforced as intended, missing, too permissive, too strict, or inconsistent with another entry point that reaches the same resource. Where enforcement depends on the client behaving, it is not enforcement.
5 — Test object-level access. For every resource fetched or changed by an identifier the caller supplies, trace whether the caller's right to that specific object is checked, not only their right to the kind of object.
6 — Look for accumulating privilege. Roles that combine into more than intended, inherited permissions, default roles that are broader than needed, accounts that were granted access for a task and kept it, and service accounts with wider reach than their function.
7 — Trace every finding to a reachable request. The file and line where enforcement is wrong or absent, and the request, made as which identity, that would show it. A suspicion that cannot be traced that far is reported as needs verification, never as a confirmed finding.
8 — Rank by exposure. What could be read or changed, by whom, and how easy it is to reach; ordered so the broadest, easiest exposure comes first.
9 — State the remedy and how to hold it. For each finding: where enforcement should live, preferably once and centrally, the check that would prove it fixed, and a test that would keep it fixed.
Output
access-control-review.md, in this order:
- 1. Scope — the system, its roles, its resources and what was reviewed
- 2. Intended matrix — role, resource and action, with
unknown cells marked
- 3. Entry points — each one, including any
undeclared
- 4. Enforcement — per entry point: the check, where it runs and what it tests, or
unenforced
- 5. Findings — each one: cell, entry point, kind, file and line, the request that shows it, or
needs verification
- 6. Object-level access — per identifier-addressed resource: checked or not
- 7. Accumulating privilege — roles, inheritance, default roles and service accounts
- 8. Remedies and tests — per finding: where enforcement belongs, the check that proves it, the test that holds it
- 9. What could not be checked — missing inputs and who holds them
Validation
The review is ready when all of these hold:
- Every cell of the matrix the owner stated appears in section 2 exactly as stated
- Every entry point found in the code appears in section 3, declared or
undeclared
- Every entry point has a line in section 4, an enforcement or
unenforced
- Every finding in section 5 names a file, a line and a request, or reads
needs verification
- Every resource addressed by an identifier has a line in section 6
- No finding is ranked that was not traced, and no role, permission or data class appears that no input supplied
Fail the run if the matrix is edited to fit the code, or if an unconfirmed suspicion is reported as a finding.
Failure handling
- No intended model supplied — stop. Report that enforcement cannot be judged against permissions nobody has stated, and list the roles, resources and actions the owner must state.
- The model is partial — review every stated cell, mark the others
unknown, and list the cells the owner must settle before the review can be called complete.
- No access to the code — build sections 1 to 3 from the documentation, mark every enforcement
not reviewed, and state that no claim about enforcement can be made.
- Enforcement sits in a system that was not supplied — record the dependency, for example a gateway or an identity provider, mark its checks
unverified, and list what to provide.
- Partial material — review what the material supports, mark the rest
NOT REVIEWED — pending <material>, and deliver.