Subscribe to the Non-Human & AI Identity Journal

How should security teams govern identities used in IaC pipelines?

Security teams should treat IaC pipeline identities as privileged execution accounts, not generic automation. Define which repositories, environments, and change types each identity can touch, then require approval, logging, and drift review for sensitive actions. The goal is to make every infrastructure change traceable to a named identity and an approved path.

Why This Matters for Security Teams

IaC pipelines are not just delivery tooling; they are privileged execution paths that can create, modify, or destroy production infrastructure at machine speed. When the pipeline identity is overbroad, a single token, key, or service account can turn a routine merge into a broad environment change. NHI Mgmt Group research shows that 97% of NHIs carry excessive privileges, which is exactly the pattern that makes pipeline identities hard to contain.

Security teams often misclassify these identities as harmless automation and then miss the fact that they hold standing access to cloud control planes, secrets stores, and deployment APIs. That creates a direct path from source code to infrastructure compromise, as seen in cases like the CI/CD pipeline exploitation case study and the Reviewdog GitHub Action supply chain attack. The control problem is not just authentication; it is making sure every identity can only execute the changes it was explicitly meant to make.

Current guidance from the NIST Cybersecurity Framework 2.0 supports this by tying identity, logging, and change control together rather than treating them as separate programs. In practice, many security teams encounter pipeline abuse only after an unsafe merge has already reached a live environment, rather than through intentional identity governance.

How It Works in Practice

Govern IaC pipeline identities as workload identities with tightly scoped authority, not as reusable admin principals. Start by mapping each identity to a named repository, environment, and change class. A pipeline that deploys a dev network stack should not be able to touch production IAM, rotate secrets, or apply changes outside its declared boundary. Where possible, use short-lived credentials issued per job, and prefer federated identity over long-lived static keys.

Operationally, the strongest pattern is to combine policy-as-code with runtime approval gates. The pipeline can authenticate, but authorization should still depend on what it is attempting to change, which account or subscription is targeted, and whether the request matches the approved path. That means approval for sensitive changes, immutable logs for each execution, and drift review after deployment. The Ultimate Guide to NHIs — Lifecycle Processes for Managing NHIs emphasizes that lifecycle control matters as much as initial issuance, because identities that are never rotated or revoked become permanent risk.

For traceability, tag every pipeline run to the commit, actor, and environment target, then require a clear separation between read, plan, and apply stages. Sensitive actions should be protected by change windows, dual approval where appropriate, and secret retrieval only at the point of use. This approach aligns with the operational lessons highlighted in the Guide to the Secret Sprawl Challenge, where uncontrolled secret distribution becomes the real failure mode.

These controls tend to break down when teams share one pipeline identity across multiple repositories and environments because the resulting privilege overlap makes meaningful authorization impossible.

Common Variations and Edge Cases

Tighter pipeline identity controls often increase deployment overhead, requiring organisations to balance release velocity against change assurance. That tradeoff is real in multi-account cloud estates, ephemeral preview environments, and platform engineering setups where many teams depend on shared templates.

Current guidance suggests treating shared runners, self-hosted build agents, and cross-account deployment roles as separate risk categories. A shared runner may only need read access to fetch modules, while a deploy role may need write access to one environment and nothing else. Best practice is evolving around just-in-time elevation for sensitive applies, but there is no universal standard for this yet, so teams should document their own approval thresholds and revocation timing.

Edge cases also matter. Break-glass identities for incident response should be isolated from normal IaC paths. Drift correction jobs need extra scrutiny because they can silently overwrite manual emergency changes. Third-party actions, modules, and plug-ins should be reviewed as part of the trust boundary, not treated as neutral dependencies. The Ultimate Guide to NHIs — Regulatory and Audit Perspectives is useful here because auditors will ask who approved access, how long it lasted, and whether revocation was provable.

Security teams should also assume that pipeline identities may be targeted through upstream supply chain compromise, as shown by the JetBrains GitHub plugin token exposure. In environments with frequent cross-org collaboration and reusable templates, static trust assumptions collapse quickly because the same identity can be reused in places the original design never anticipated.

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 OWASP Agentic AI Top 10 address the attack and risk surface, while 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 keys and tokens need rotation and tight lifecycle control.
OWASP Agentic AI Top 10 A-04 Runtime authorization and tool-use limits parallel autonomous execution risk.
NIST CSF 2.0 PR.AC-4 Least-privilege access for machine identities fits access control governance.

Replace long-lived IaC credentials with short-lived, rotated identities and revoke them after each job.