# 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

- Skill: `wsh7ash/authorization-control-inventory` (Agent Skill)
- Install (CLI): `npx get-skill add wsh7ash/authorization-control-inventory`
- Raw SKILL.md: https://api.skillmd.com/api/skills/wsh7ash/authorization-control-inventory/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Wsh7Ash (https://skillmd.com/u/wsh7ash)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/wsh7ash/authorization-control-inventory

---


# 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

1. Trace one request from client to storage, noting every component that could evaluate access: gateway, middleware, service, query builder.
2. For each component record what it knows: identity, role, tenant and object ownership.
3. Identify components that trust an upstream decision without re-checking, which is where gaps become exploitable.
4. Map configuration sources, since a rule in a gateway config and a rule in code evolve differently.
5. Mark the single layer you consider authoritative for tests, and test that layer directly where possible.
6. 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**

```text
component   | knows        | enforces | trusts-upstream
gateway      | identity,role| yes      | no
service      | identity     | partial  | yes (header)
handler      | identity     | query    | yes
```

**2. Trust note**

```text
service trusts X-Tenant header -> only safe if gateway sets and client cannot
```

**3. Test target**

```text
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.

## References

- [OWASP API Security Top 10](https://owasp.org/www-project-api-security/)
- [OWASP - authorization guidance](https://owasp.org/)

