Treat build systems as privileged identity infrastructure, not just delivery tooling. Pin dependencies to immutable references, separate build from publish rights, and rotate every secret reachable from the affected pipeline. Then add runtime monitoring for runner behaviour and repository creation so compromise is detected as an identity event, not only as a malware alert.
Why This Matters for Security Teams
CI/CD compromise is not just a build problem. It is an identity problem because pipelines often hold signing rights, deploy permissions, and long-lived secrets that can be reused across systems. Once an attacker reaches a runner or source repository, they can turn trusted automation into a distribution channel. NHI Management Group’s research on CI/CD pipeline exploitation case study shows why this matters: a single compromised pipeline can expose many downstream credentials at once.
That risk is reinforced by broader supply chain reporting. The OWASP Non-Human Identity Top 10 treats over-privileged machine identities, weak secret hygiene, and missing lifecycle controls as core failure modes, not edge cases. For security teams, the practical lesson is that runners, build tokens, package signing keys, and release automation need the same scrutiny as human privileged access. In practice, many security teams discover this only after a runner has already been used to mint trusted artifacts or exfiltrate secrets, rather than through intentional review.
How It Works in Practice
The defensive model starts by treating the pipeline as privileged identity infrastructure. That means isolating build, test, and publish roles so no single workflow can both modify code and release artifacts. Security teams should pin dependencies to immutable references, prefer short-lived credentials, and issue access just in time for the task at hand. Where possible, use workload identity rather than static secrets so the pipeline proves what it is at request time, instead of relying on reusable tokens.
Current guidance also favors policy checks at runtime. A request to publish an artifact, assume a role, or create a new repository should be evaluated against context such as branch provenance, runner trust level, artifact source, and whether the action matches the expected build stage. The NIST SP 800-53 Rev 5 Security and Privacy Controls supports this kind of access separation and monitoring discipline, while NHI-focused guidance from 52 NHI Breaches Analysis shows how quickly machine credentials become reusable attack paths when rotation and scope are weak.
- Separate build, sign, and publish permissions so compromise in one stage cannot directly release software.
- Use ephemeral secrets with tight TTLs and automated revocation after each job or deployment.
- Rotate every secret reachable from the pipeline, including package registry tokens, cloud roles, and signing keys.
- Monitor runner behaviour, repository creation, and unusual token minting as identity events, not only as malware alerts.
These controls tend to break down in self-hosted runner fleets with broad network reach because attackers can chain tool access, lateral movement, and secret discovery faster than static reviews can respond.
Common Variations and Edge Cases
Tighter pipeline controls often increase release friction, so teams must balance delivery speed against blast-radius reduction. That tradeoff becomes sharper in polyglot environments, multi-account cloud estates, and organisations that still use shared service accounts for legacy builds. Best practice is evolving, but there is no universal standard for how much autonomy a CI runner should have before it becomes a standing privilege risk.
Edge cases matter. For example, immutable dependency pinning reduces tampering risk, but it does not stop a compromised maintainer account from publishing a malicious version that is already trusted by automation. Likewise, secret scanning is valuable, but it is not enough if leaked credentials remain valid for days. The Guide to the Secret Sprawl Challenge is useful here because it highlights how fragmented secret inventories make revocation slow, and how quickly exposed tokens spread across repos, tickets, and build logs. The Shai Hulud npm malware campaign also illustrates a common failure pattern: once automation is trusted too broadly, the attacker only needs one weak link to turn CI/CD into a credential harvesting system.
The practical answer is to assume that compromise will occur, then design the pipeline so the attacker cannot easily reuse what they find.
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, OWASP Agentic AI Top 10 and CSA MAESTRO address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-03 | Pipeline secrets must be short-lived and rotated after compromise. |
| OWASP Agentic AI Top 10 | A-06 | Automated pipelines act like non-human actors with tool access and autonomy. |
| CSA MAESTRO | MSTG-06 | MAESTRO addresses identity, trust, and policy for autonomous workloads. |
| NIST AI RMF | AI RMF supports governance for autonomous or semi-autonomous execution paths. | |
| NIST CSF 2.0 | PR.AA-01 | Identity proofing and access enforcement apply to privileged pipeline actors. |
Inventory CI/CD machine secrets, then rotate or revoke every exposed credential immediately.
Related resources from NHI Mgmt Group
- How should security teams reduce the risk of cloud privilege abuse after a supply chain compromise?
- How do attackers turn a supply-chain incident into wider NHI compromise?
- How should security teams reduce the risk of secret theft from npm supply chain attacks?
- How should security teams reduce supply chain risk in GitHub-based development pipelines?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on August 1, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org