Are you worried about data exfiltration in your CI/CD pipelines?
Modern CI/CD systems often spin up short‑lived workers that run build scripts, test suites, and deployment commands. When those workers need to interact with downstream services, databases, Kubernetes clusters, or internal APIs, they frequently do so through a secondary process that forwards credentials or tokens. That secondary process is called a nested agent. The primary pipeline job hands a credential to the nested agent, which then opens a connection on its behalf. From the perspective of the pipeline, the nested agent looks like a convenient abstraction; from a security viewpoint, it adds an extra hop where secrets travel unprotected.
Why nested agents create a data exfiltration vector
Because the nested agent runs inside the same execution environment as the build job, it inherits the job’s permissions. If an attacker compromises the build container, through a malicious pull request, a vulnerable dependency, or a mis‑configured secret scan, they gain the ability to instruct the nested agent to reach any target the pipeline is allowed to contact. The attacker can then pipe database query results, configuration files, or source code back through the agent and out of the network. Since the agent forwards traffic using the original credential, the exfiltrated data appears as legitimate traffic to downstream services, making detection difficult.
Two practical patterns illustrate the risk:
- Credential leakage. The build script often writes a temporary token to disk for the nested agent. A compromised job can read that file and reuse the token later, extending the attack window.
- Command injection. If the build step builds a command string for the nested agent without strict sanitisation, an attacker can inject arbitrary commands that the agent will execute against the target, pulling out tables, logs, or secret blobs.
Server‑side enforcement is the only reliable control
Protecting against data exfiltration therefore requires a control point that sits between the nested agent and the target resource. Controls that live inside the build container, environment variables, file‑system permissions, or runtime policies, cannot stop a compromised agent from sending data out, because the agent already holds a valid credential. The enforcement must happen where the data actually flows, on the network edge that the agent uses to reach the downstream service.
This is where a Layer 7 gateway becomes essential. By placing a gateway in the data path, every request from a nested agent passes through a single, immutable inspection point. The gateway can apply policy decisions that are independent of the compromised build environment, ensuring that no request leaves the pipeline without explicit validation.
How hoop.dev blocks exfiltration at the gateway
hoop.dev records each session. Every command that a nested agent issues is captured, timestamped, and stored for replay. If an incident occurs, auditors can reconstruct the exact sequence of actions and verify whether data left the system.
hoop.dev masks sensitive fields in responses. When a database query returns rows that contain credit‑card numbers or personal identifiers, the gateway can replace those fields with placeholder values before the data reaches the agent. This prevents the agent from ever seeing the raw secret, even if it is compromised.
hoop.dev blocks dangerous commands before execution. The gateway can recognise patterns such as a request to select all rows from a users table or a request to read system password files and reject the request outright, returning an error to the agent. Because the block occurs at the gateway, the nested agent never gets a chance to forward the command to the target.
hoop.dev routes high‑risk operations through a human approval workflow. If a request matches a policy that requires justification, such as exporting an entire database dump, the gateway pauses the request and notifies a designated approver. Only after explicit approval does the request proceed.
All of these enforcement outcomes exist solely because hoop.dev sits in the data path. The nested agent, even if fully compromised, cannot bypass the gateway without presenting a valid credential that the gateway itself validates against the user’s identity.
Getting started with a gateway for your pipelines
Deploying a server‑side gateway is straightforward. The official getting‑started guide walks you through a Docker Compose deployment that runs the gateway alongside an agent inside your network. Once the gateway is up, you register your CI/CD resources, databases, Kubernetes clusters, and internal HTTP services, through the learn portal. From that point, every nested‑agent connection is automatically inspected, recorded, and governed by the policies you define.
FAQ
- Can I rely on container‑level secret scanning alone? Secret scanning helps prevent accidental leakage, but it does not stop a malicious or compromised nested agent from using a secret that is already present. Enforcement must happen where the secret is used, i.e., at the gateway.
- Does hoop.dev store credentials? The gateway holds the credential needed to reach the target, but it never exposes that credential to the nested agent or the build container. Access is granted only after the user’s identity is verified via OIDC or SAML.
- What happens if a legitimate request is blocked? Policies can be tuned to require just‑in‑time approval for high‑risk actions. Approvers receive a notification, can review the request, and either approve or deny it, ensuring business continuity while maintaining security.
Explore the source code, contribute improvements, and see how the gateway fits into your security stack on GitHub.