Agentic AI Module Added To NHI Training Course
Home FAQ Architecture & Implementation Patterns How should teams secure CI/CD pipelines against identity-based…
Architecture & Implementation Patterns

How should teams secure CI/CD pipelines against identity-based attacks?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated May 28, 2026 Domain: Architecture & Implementation Patterns

Teams should secure CI/CD pipelines by treating every developer account, service account, build runner, and signing key as a governed identity with explicit scope. That means least privilege, verified commit provenance, managed-device checks, and continuous integrity validation across build and release stages, not just final approval.

Why This Matters for Security Teams

CI/CD is not just a delivery system. It is an identity transit layer where developer accounts, build runners, package tokens, signing keys, and deployment credentials all intersect. That makes it a high-value target for identity-based attacks that do not need malware to succeed. Attackers often prefer stolen secrets, poisoned workflows, and over-privileged service accounts because they can move from source code to production with minimal friction. NHIs outnumber human identities by 25x to 50x in modern enterprises, and the 52 NHI Breaches Analysis shows how often those identities become the real entry point.

The operational risk is amplified by speed. In incident research on exposed cloud credentials, attackers have been observed attempting access within minutes, which means pipeline compromise can become production compromise before a standard review cycle finishes. Guidance from CISA cyber threat advisories reinforces that identity and access abuse is now a routine part of intrusion tradecraft, not an edge case. In practice, many security teams encounter pipeline abuse only after secrets have already been reused outside the intended build path.

How It Works in Practice

The most effective model is to treat the pipeline as a chain of governed NHIs, not a single trusted system. Each stage should authenticate with its own workload identity, receive only the permissions it needs for that stage, and lose access as soon as the task ends. That means replacing long-lived static secrets with short-lived credentials, enforcing commit provenance checks before build execution, and binding release authorization to verified inputs rather than to a broad pipeline token.

Current guidance suggests using Ultimate Guide to NHIs as the governance baseline, then mapping the implementation to workload identity and policy controls. For example, a build runner should be able to fetch only the artifacts, registries, and signing services required for that job, while release jobs should require separate approval and separate identity context. OIDC federation, SPIFFE-style workload identity, and policy-as-code are all common patterns here, but there is no universal standard for every platform yet. The key is that authentication, authorisation, and secret issuance all happen per task, not per environment.

  • Use JIT credentials for each job or deployment step, then revoke them automatically at completion.
  • Store signing keys and deployment tokens in managed secret systems, not in repository variables or runner images.
  • Verify commit provenance and dependency integrity before the pipeline can promote an artifact.
  • Separate build, test, package, and deploy identities so one compromise does not span the full lifecycle.

For implementation patterns, the CI/CD pipeline exploitation case study and the Reviewdog GitHub Action supply chain attack show how quickly one weak integration can expose secrets across the delivery chain. In a recent AI-focused threat report, Anthropic — first AI-orchestrated cyber espionage campaign report also illustrates how tooling and credentials can be chained once initial access is gained. These controls tend to break down in self-hosted runner fleets with shared images and persistent filesystem state because stolen tokens can be replayed before revocation catches up.

Common Variations and Edge Cases

Tighter pipeline control often increases delivery overhead, requiring organisations to balance release speed against the cost of stronger identity checks. That tradeoff is real, especially in polyglot estates where legacy CI systems, vendor-managed runners, and ad hoc automation all coexist. Best practice is evolving, but the direction is clear: every exception to short-lived credentials or scoped authorisation becomes a reusable attack path.

Edge cases usually appear where teams treat the pipeline as trusted infrastructure rather than as a hostile execution environment. Monorepos with hundreds of deployable services, ephemeral preview environments, and cross-account cloud deployments all add identity sprawl. In those environments, the safest pattern is to make the pipeline prove intent at runtime and to fail closed when provenance, device posture, or secret freshness cannot be verified. The same logic applies to package publishing and signing: if one runner can mint broadly valid credentials, the whole release chain inherits that risk. The Guide to the Secret Sprawl Challenge is useful here because it shows how secrets escape into places teams forget to inspect, and the Shai Hulud npm malware campaign is a reminder that package ecosystems are also part of the pipeline trust boundary. When release automation spans multiple clouds or third-party build services, identity controls often fragment before policy can enforce a consistent trust decision.

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 and CSA MAESTRO address the attack and risk surface, while NIST AI RMF set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-03Scoped, short-lived NHI credentials are central to securing pipeline identities.
CSA MAESTROGOV-02Pipeline trust depends on runtime governance for autonomous automation identities.
NIST AI RMFAI RMF supports governance of automated, goal-driven tooling in delivery workflows.

Replace long-lived pipeline secrets with JIT NHI credentials and rotate them on every job.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on May 28, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org