A newly hired contractor leaves the team, but the CI pipeline they helped build still runs with a service account that holds full admin rights on the internal PostgreSQL cluster. Because the pipeline uses a static token, the organization fails to apply least privilege to that non‑human identity, and nothing in the pipeline logs shows which statements ran during each execution.
Non‑human identities, service accounts, automation bots, CI jobs, and scheduled scripts, must hold credentials to talk to databases, Kubernetes clusters, or remote hosts. Teams often grant these accounts broad scopes and store long‑lived secrets in vaults, config files, or CI variables.
Applying the principle of least privilege to these identities sounds simple – give each automation only the permissions it truly needs. In practice the gap between intent and reality widens quickly. Teams copy tokens between repositories, rotate them on ad‑hoc schedules, and reuse the same secret across unrelated workloads. Without a central point that observes every request, teams cannot verify that a bot stays within its intended boundary.
Most organizations address the first half of the problem by configuring an identity provider (OIDC, SAML) and issuing short‑lived tokens to service accounts. This setup decides who the request is and whether it may start, but it does not stop the request from reaching the target directly. The connection bypasses any enforcement layer, so teams lack an audit trail, inline data masking, and just‑in‑time approval. The token itself cannot block a dangerous command or hide a credit‑card number that a query might return.
Why least privilege matters for non‑human identities
Attackers prize non‑human identities because they often operate with elevated rights and rarely trigger alerts. A compromised CI token can spin up new instances, exfiltrate data, or modify production configurations without human oversight. Enforcing least privilege at the point where the request is made prevents the blast radius from expanding beyond the narrow set of actions the automation was designed to perform.
The missing enforcement layer
When a gateway does not sit in the data path, the following gaps remain:
- Teams lack a record of which commands a bot issued, making forensic analysis difficult.
- Sensitive fields returned by a query reach downstream logs unfiltered.
- Dangerous commands (for example, DROP DATABASE) execute without human review.
- Access persists for the lifetime of the token, not just for the moment the job needs it.
These gaps do not disappear by tightening IAM policies alone because the policies enforce on the target side, outside the control of the automation runner.
