Per-hop Authorization

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up per hop authorization by checking permissions at every single step in a request chain. Each service verifies the caller identity and user context before it runs any task. Most teams start by checking user roles only at the outer network edge. Once a request passes that first door, inner services often trust it by default. This broad trust lets one compromised app read or change data across your whole system. If a role has too much power, lateral movement becomes easy for an attacker.

Dynamic Authorization + Per-App VPN: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up per hop authorization by checking permissions at every single step in a request chain. Each service verifies the caller identity and user context before it runs any task. Most teams start by checking user roles only at the outer network edge. Once a request passes that first door, inner services often trust it by default. This broad trust lets one compromised app read or change data across your whole system. If a role has too much power, lateral movement becomes easy for an attacker.

How per hop authorization works in practice

In a distributed system, one user click can trigger five different backend apps. With per hop authorization, the first app checks the user token and runs its part. Before it calls the second app, it attaches the caller identity and the user context. The second app does not assume the first app is safe just because it lives inside the same network. Instead, the second app reads both identities and checks its own local rules. It confirms that this specific app can ask for this action on behalf of this user. If the check passes, the app processes the request and logs the event. If therequest needs a third step, the chain repeats the exact same check. Teams often use workload certificates and signed tokens to pass these facts between apps. Each service keeps a small rule list that says which upstream apps can call it. This stops an analytics service from calling a billing service when no rule allows it.

Why edge checks and network trust fall short

Checking roles at every service step fixes the problem of flat internal networks. It stops unverified services from talking to each other behind the firewall. It also preserves the user identity from the browser all the way to the backend. Still, native service checks still leave a major gap during daily work. Service rules decide which app or engineer can log in and open a session. They do not inspect what individual database queries or shell commands do in flight. Once an engineer or service passes the hop check, the database trusts the session. A valid role can still run a broad query that pulls thousands of phone numbers or emails. It can also drop a table or change a critical record by mistake. Native token checks also struggle when human engineers need direct access to fix a bug. Engineers do not carry service certificates on their laptops in the same way apps do. Teams end up creating shared admin roles to get work done fast. Those shared roles bypass the careful hop rules you built for your apps. To stay safe, you need control over the actual commands and data results in flight. For instance, data masking can rewrite matched fields like card numbers or national IDs in query results.

Steps to keep service chains tight and auditable

Start by mapping every service call that touches sensitive records like emails or card numbers. Give each app its own distinct identity instead of sharing one key across a team. Next, pass the original user context alongside the machine identity on every internal call. Set up each receiving service to deny calls that lack both valid identities. Keep your permission rules small and tied to specific actions, such as read or write. Review your logs each week to spot apps that hold roles they never use. Remove those extra permissions right away so old services cannot become easy attack paths. Finally, separate how apps talk to each other from how humans run live fixes.

Dynamic Authorization + Per-App VPN: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

What is the difference between edge checks and per hop checks?

Edge checks verify the user once at the front door of your network. Per hop checks verify both the user and the calling app at every internal service step.

Does checking every hop slow down app responses?

Local token and certificate checks use fast math in memory on each server. They add only a few milliseconds per call when you avoid calling an external server each time.

How do you handle human access in a multi-hop system?

Do not give humans static service keys or broad network access to backend hosts. Route human sessions through a central control point that checks every single command and query.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.