Authorization Control Inventory
Inventory where authorization decisions are actually made in your stack so you know which layer to test and which to trust
Use when: requests pass through gateways, frameworks and handlers, and you need to know which one enforces access rules
Avoid when: a single application layer makes every decision and its behaviour is already covered by tests
Procedure
- Trace one request from client to storage, noting every component that could evaluate access: gateway, middleware, service, query builder.
- For each component record what it knows: identity, role, tenant and object ownership.
- Identify components that trust an upstream decision without re-checking, which is where gaps become exploitable.
- Map configuration sources, since a rule in a gateway config and a rule in code evolve differently.
- Mark the single layer you consider authoritative for tests, and test that layer directly where possible.
- Record the inventory next to the matrix so every expectation names the layer expected to enforce it.
Signals
- Two layers both enforce access with different rule sets, which guarantees eventual inconsistency.
- An internal service trusts a header from the gateway with no verification of its own.
- Authorization rules live only in configuration that ships separately from code review.
- A handler reaches storage with a query that has no ownership predicate, relying entirely on earlier layers.
Patterns
1. Layer table
component | knows | enforces | trusts-upstream
gateway | identity,role| yes | no
service | identity | partial | yes (header)
handler | identity | query | yes
2. Trust note
service trusts X-Tenant header -> only safe if gateway sets and client cannot
3. Test target
test the layer with the authoritative rule; test the others for bypass
Pitfalls
- Assuming the gateway covers every backend path, when direct backend routes often exist for internal tools.
- Testing only the outermost layer and never checking what the data layer actually filters.
- Ignoring configuration drift between environments, where a rule can exist in staging and be absent in production.
Done when
- Every layer that could make an access decision is recorded with what it knows and what it trusts.
- One authoritative layer is named, and trust relationships between layers are written down with the bypass risk each carries.