All posts

How to Implement RBAC for Non-Human Identities

Many teams assume that giving a service account a single static key is enough to satisfy RBAC. In practice, that key is often copied across dozens of CI pipelines, shared between multiple micro‑services, and stored in plain‑text configuration files. The result is a world where a compromised credential instantly grants unrestricted access to every downstream resource, and no one can tell which automated job performed which operation. Because the credential is baked into the connection, the reque

Free White Paper

Non-Human Identity Management + Right to Erasure Implementation: The Complete Guide

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

Free. No spam. Unsubscribe anytime.

Many teams assume that giving a service account a single static key is enough to satisfy RBAC. In practice, that key is often copied across dozens of CI pipelines, shared between multiple micro‑services, and stored in plain‑text configuration files. The result is a world where a compromised credential instantly grants unrestricted access to every downstream resource, and no one can tell which automated job performed which operation.

Because the credential is baked into the connection, the request bypasses any central policy engine. The service account talks directly to the database, the Kubernetes API, or the SSH daemon, and the target sees only the service identity – not the originating pipeline, the user who triggered it, or the business purpose behind the call. Auditors cannot answer who ran a destructive query, and security teams have no lever to block a dangerous command before it reaches the server.

RBAC for non‑human identities therefore needs two things: a way to express fine‑grained roles for bots and service accounts, and a place to enforce those roles on every request. The first piece – defining roles, groups, and least‑privilege permissions – lives in the identity provider and the provisioning system. That setup decides *who* the service identity is and *what* it may request, but it does not stop the request from flowing straight to the target without oversight.

Even with a well‑scoped role, the request still reaches the backend directly, without a checkpoint that could log the exact query, mask sensitive columns, or require an on‑demand approval for high‑risk actions. Without a control point in the data path, the organization cannot guarantee that every automated action is visible, reversible, or aligned with internal policies.

hoop.dev inserts the enforcement point exactly where it is needed – between the non‑human identity and the infrastructure resource. By acting as a Layer 7 gateway, hoop.dev receives the connection, validates the OIDC or SAML token, and then applies the RBAC policy before any traffic reaches the target.

Setup: provisioning non‑human identities

The first step is to create service accounts, CI tokens, or automation users in your identity provider (Okta, Azure AD, Google Workspace, etc.). Assign each identity to a group that reflects its intended role – for example, ci‑deploy‑read or batch‑processor‑write. These groups become the source of truth for RBAC decisions.

Because the identity provider is only the source of truth, you must ensure that the groups are kept up to date and that any new service account is placed in the correct group before it can be used. This is a classic “setup” responsibility: it decides who the request is and whether it may start, but it does not enforce anything on its own.

The data path: hoop.dev as the enforcement gateway

hoop.dev sits in the network close to the protected resource. When a non‑human identity initiates a connection, hoop.dev validates the presented token, extracts the group membership, and looks up the corresponding RBAC policy. Only after the policy check passes does hoop.dev forward the request to the backend.

hoop.dev records each session, capturing the exact commands or queries that were executed. This creates a replayable audit trail that can be examined later for compliance or forensic analysis.

Continue reading? Get the full guide.

Non-Human Identity Management + Right to Erasure Implementation: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

hoop.dev masks sensitive fields in responses, such as credit‑card numbers or personal identifiers, according to policy rules attached to the role. The backend never sees the raw data, and the client only receives the filtered view.

hoop.dev enforces just‑in‑time approval for high‑risk actions. If a role attempts a destructive command – for example, dropping a production database table – hoop.dev pauses the request and routes it to an approver. Only after an authorized human clicks approve does the command continue.

Enforcement outcomes you can rely on

  • hoop.dev records every interaction, providing a complete log of who did what and when.
  • hoop.dev masks sensitive response data in real time, preventing accidental leakage.
  • hoop.dev blocks disallowed commands before they reach the target, reducing blast radius.
  • hoop.dev requires just‑in‑time approval for privileged actions, adding a human checkpoint without sacrificing automation.
  • hoop.dev isolates the credential from the client, so the service account never sees the secret it uses to connect.

Putting it together: a practical workflow

1. Define a role in your identity provider, e.g., report‑generator‑readonly, and assign the appropriate service account.

2. In the hoop.dev console, map that role to a policy that permits SELECT queries on the analytics schema but denies any DML statements.

3. Deploy the hoop.dev gateway and its agent near the database. The agent holds the database credential; the service account never touches it.

4. When the CI job runs, it authenticates to the identity provider, receives a JWT, and connects through hoop.dev. hoop.dev validates the token, checks the policy, records the session, and forwards the allowed queries.

5. If the job accidentally issues a DROP TABLE, hoop.dev intercepts the command, pauses execution, and notifies an on‑call engineer. The engineer can approve, reject, or investigate before any damage occurs.

Getting started

Follow the getting‑started guide to spin up the gateway, register a non‑human identity, and create your first RBAC policy. The documentation walks you through the high‑level concepts without exposing any configuration details.

For deeper insight into policy definition, masking rules, and approval workflows, explore the learn section. It explains how to model roles, how to compose policies, and how to tune the gateway for your security posture.

FAQ

Do I still need to rotate service account credentials?

Yes. hoop.dev stores the credential and rotates it according to your secret‑management process, but regular rotation remains a best practice to limit exposure if a secret is ever leaked.

Can I apply different RBAC policies per environment?

Absolutely. Because policies are defined in the gateway, you can have separate instances for dev, staging, and prod, each with its own role‑to‑policy mapping.

What happens if the gateway itself becomes unavailable?

hoop.dev is designed for high availability. You can run multiple gateway replicas behind a load balancer, ensuring that the enforcement point remains reachable even if one instance fails.

Next steps

Explore the source code, contribute improvements, or file an issue on the GitHub repository. The community welcomes contributions that make RBAC for non‑human identities even more effective.

Open source

Save the open-source gateway for agent data access

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.

Star and save the repo →More posts