Because the build job often runs with delegated access to repositories, secrets, and cloud services. If the workflow can authenticate and then inherit broader permissions than it truly needs, an attacker can use that session to move from code execution to credential misuse and downstream tampering.
Why build-job actions become identity risk
Malicious activity inside a build job is not just code tampering, it is credentialed action. The job often has a real runtime identity, and that identity may already be trusted to reach source repositories, secret stores, signing systems, artifact registries, and cloud APIs. Once an attacker can execute in that context, the concern shifts from “can they run code?” to “what can they do with the permissions the job was allowed to inherit?”
A build pipeline is therefore a high-value identity boundary. If the workflow identity is broader than the build actually needs, the session becomes a bridge into systems the attacker should never touch directly. That is why build security, secret handling, and access governance cannot be separated in practice.
How delegated permissions expand the blast radius
Build jobs are commonly granted short-lived tokens, cloud roles, repository access, package publish rights, and the ability to read environment secrets. Those permissions are often delegated for automation, not for broad human review, so they can become invisible until something goes wrong. When the workflow can authenticate and then inherit more capability than the task requires, compromise of the job becomes compromise of the delegated authority.
This risk grows when the same job identity can move between environments, reuse the same credentials across pipelines, or reach shared secret material. Good practice is to treat each build identity as a bounded workload identity, not as a convenience account with general-purpose access. A useful control lens is the lifecycle of the identity itself, provisioning, rotation, scope, and offboarding all matter. NHI Lifecycle Management Guide is a strong fit for that governance problem, because the issue is not only creation of access but also whether access is still appropriate over time.
For teams that want the broader pattern, Ultimate Guide to NHIs, What are Non-Human Identities helps frame the build job as one identity among many machine-usable identities that must be governed deliberately. In cloud environments, the same thinking is reinforced by Ultimate Guide to NHIs, Standards, which ties workload identity and zero trust style controls to practical identity security outcomes.
What malicious code can do once it is inside the pipeline
Once malicious logic runs in a build job, it can do more than alter the build output. It can harvest environment variables, read mounted secrets, exfiltrate tokens, poison dependencies, publish a tampered artifact, or impersonate the pipeline to downstream services. In identity terms, that is a shift from execution risk to session misuse, privilege abuse, and trust-chain compromise.
The identity problem is especially sharp when the build job can act on behalf of a human, a service, or both. If a job can sign artifacts, approve deployments, or call privileged cloud APIs, then abuse of that job can create a trusted but hostile action trail. Top 10 NHI Issues and Identity Security Posture Management (ISPM) Guide both align with this exposure because they focus on excessive permissions, stale access, and posture gaps that make abuse easier to miss.
At the external framework level, OWASP Non-Human Identity Top 10 is directly relevant because long-lived secrets, overprivilege, and insecure authentication are common failure modes in build automation. SPIFFE workload identity specification is also useful when the team wants a clearer separation between workload identity, attestation, and downstream service access. For general identity assurance, NIST SP 800-63 Digital Identity Guidelines supports the principle that authenticators and assurance levels should match the trust needed by the transaction.
What practitioners should verify before trusting a build identity
Build jobs should be able to authenticate, but only into the narrowest permissions needed for the specific task. The first thing to verify is whether the pipeline identity can reach secrets or services that are not required for compilation, test, packaging, or attestation. The second is whether credentials are ephemeral, environment-bound, and rotated on a schedule that matches pipeline risk.
What to verify: confirm that each pipeline has a distinct identity, that secrets are scoped to the minimum job stage, and that deployment or signing privileges are separated from ordinary build execution. If a build identity can publish, approve, or promote without an additional control point, treat that as a privilege design issue rather than a tooling quirk. Third-Party, B2B and Contractor Access Guide is relevant here because the same sponsorship, least privilege, and offboarding discipline applies to non-human and external execution paths that are trusted to act inside the environment.
What good looks like: the build identity is unique per system or environment, secrets are injected just in time, and a compromised job can reach only the current pipeline step, not the wider estate. The strongest control pattern is a narrow trust boundary, not a powerful shared token hidden inside automation.
Practitioner takeaway: treat the build job as an actor with authority, not as a passive script, and verify that every permission it holds can be justified by the one thing that job must do.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 addresses the attack and risk surface, while NIST SP 800-53 Rev 5 and SLSA set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-05 — Overprivileged NHI | Build jobs often inherit excessive delegated access. |
| NHI-07 — Long-Lived Secrets | Persistent pipeline secrets make identity abuse easier after code execution. | |
| NHI-04 — Insecure Authentication | The risk hinges on how the build job proves its identity to repositories and cloud services. | |
| Recommendation — Reduce build-job permissions to the minimum required for each pipeline step. Replace durable pipeline secrets with short-lived, environment-scoped credentials. Use strong, workload-bound authentication for every build identity. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | Build pipelines depend on secret and token lifecycle control. |
| AC-6 — Least Privilege | Delegated build access should be narrowly scoped to the task. | |
| Recommendation — Manage build credentials with expiration, rotation, and revocation controls. Restrict pipeline permissions to the least privilege needed for each job. | ||
| SLSA | Supply-chain Levels for Software Artifacts | Tampered build jobs can alter artifact integrity and provenance. |
| Recommendation — Harden the build pipeline so artifact provenance remains trustworthy. | ||