By NHI Mgmt Group Editorial TeamBased on Infisical: “How to manage secrets in CI/CD pipelines?” (July 17, 2025)

TL;DR: CI/CD pipelines need secrets for testing, deployment, and infrastructure updates, but platform-native storage centralises exposure and limits rotation, auditability, and access control, according to Infisical's guide. The governance problem is not automation itself but the assumption that pipeline credentials can stay static, broad, and reviewable without increasing blast radius.


At a glance

What this is: This guide explains how secrets flow through CI/CD pipelines and why platform-native storage creates a wider exposure and governance problem than many teams expect.

Why it matters: It matters because CI/CD credentials sit at the boundary between automation and production access, so IAM and security teams need controls that preserve speed without turning pipeline secrets into a standing blast-radius risk.


Context

CI/CD secrets management is the discipline of controlling the credentials, tokens and keys that automated build and deployment systems need to run. The issue is not whether pipelines need access, but how to scope that access so tests, deployments and infrastructure changes do not inherit unnecessary privilege.

The article argues that platform-native storage makes secrets easier to use but harder to govern. In practice, that creates duplication, weak audit trails, and broader blast radius when a pipeline platform is breached or a secret is copied into logs, code or configuration.


Key questions

Q: What breaks when CI/CD pipelines rely on static secrets?

A: Static secrets create a reusable attack path into production infrastructure. Once they are copied into workflow files, logs, runner images, or environment variables, a single compromise can expose broad access long after the original job finishes. That is why pipeline secrets should be treated as production identity, not temporary configuration.

Q: Why do static credentials create more risk in CI/CD and Kubernetes environments?

A: Static credentials are copied into many places, reused by many systems, and difficult to revoke cleanly once they spread. In CI/CD and Kubernetes, that persistence increases blast radius because one exposed secret can unlock multiple workloads, environments, or cloud resources.

Q: How do security teams know whether secrets in CI/CD are actually controlled?

A: Look for three signals: how many secrets a workflow can reach, how long those secrets remain valid, and whether any of them can publish or sign artefacts. If a build job can touch long-lived credentials or production systems, the environment is not controlled. The objective is to reduce reachable secrets and shorten exposure windows.

Q: What is the difference between platform-native secrets and external secrets managers?

A: Platform-native secrets live inside the CI/CD system and are simpler to start with, but they usually offer weaker rotation, access control and auditability. External secrets managers decouple secret storage from the pipeline, which improves isolation, supports runtime retrieval and reduces the blast radius of a platform breach.


Technical breakdown

Why CI and CD need different secret boundaries

CI and CD are not the same trust domain. CI systems need limited test credentials to validate code against staging data, third-party sandboxes and disposable infrastructure, while CD systems need deployment credentials to publish artifacts and update environments. If those boundaries collapse, the same pipeline identity can reach both validation and production paths, which expands the impact of compromise. The core technical mistake is assuming that one set of credentials can safely serve every stage of automation. In reality, each stage has different data, different privilege and different exposure duration.

Practical implication: Define separate secret scopes for build, test and deployment paths instead of reusing one credential set across the pipeline.

Platform-native secret storage and blast radius

Platform-native secrets stay inside the CI/CD system, which simplifies setup but concentrates trust. That model works only as long as the platform itself remains uncompromised and the platform’s built-in permission model is sufficient for audit and least privilege. The problem is that many CI/CD platforms expose secrets broadly to jobs and environment variables, then provide limited lifecycle controls. When the platform is breached, or when logs and variables are copied, the attacker gets a dense cluster of secrets rather than a single credential. This is a classic blast-radius problem created by centralisation without lifecycle governance.

Practical implication: Treat platform-native secret stores as convenience layers, not as the long-term control plane for high-value pipeline credentials.

Short-lived credentials reduce pipeline exposure windows

Short-lived credentials change the risk model because the credential is valid only for a narrow operational window. Dynamic secrets are issued on demand and expire quickly, while rotated static secrets reduce the time an exposed value remains useful. That matters in CI/CD because pipelines are ephemeral by design: jobs start, complete and terminate quickly. The security objective is therefore not merely secrecy, but reducing the time during which a leaked token can be replayed. This is where lifecycle controls become more important than where the secret is stored.

Practical implication: Use short-lived or automatically rotated credentials for pipeline tasks that do not require persistent access.


Threat narrative

Attacker objective: The objective is to turn one exposed pipeline credential into broader access across build, deployment and downstream application environments.

  1. Entry occurs when attackers reach CI/CD secrets through platform compromise, exposed code, logs or mismanaged secret stores.
  2. Credential access follows when pipeline secrets, deployment tokens or API keys are copied from the system that was meant to automate delivery.
  3. Impact occurs when the attacker reuses those secrets to access downstream services, modify deployments or exfiltrate additional data.
  • Hugging Face Spaces breach 2024: Unauthorised access to Hugging Face Spaces may have exposed secrets users stored for AI apps; tokens were revoked and org tokens removed.
  • Dropbox Sign breach 2024: A compromised back-end service account gave attackers Dropbox Sign customer data, including API keys, OAuth tokens and MFA information.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Pipeline secrets are identity controls, not just developer convenience. CI/CD credentials govern which automated process can test, publish or modify production assets, so they belong in the identity programme rather than only in DevOps tooling. When teams treat them as implementation detail, they underweight lifecycle, audit and revocation. The practical consequence is that pipeline access should be governed as a distinct non-human identity boundary.

Platform-native secret storage creates an identity blast radius problem. Centralising credentials inside a CI/CD platform improves usability, but it also concentrates failure if the platform or its logs are compromised. The result is not merely leakage of a single token, but the exposure of every workflow that reuses that store. Practitioners should read this as a design choice that trades convenience for larger compromise scope.

Static pipeline credentials are misaligned with ephemeral automation. CI/CD jobs are temporary, yet many secret models assume credentials can remain stable long enough to be reviewed later. That assumption weakens as automation scales and release cadence increases. Identity blast radius: the useful measure is no longer how many secrets exist, but how far one compromised secret can move across the delivery chain.

Secrets governance now sits at the junction of IAM, PAM and software delivery. Pipeline access is not a narrow DevOps issue because it controls privileged actions across test, build and deployment stages. That means lifecycle ownership, access review scope and exception handling all need to cover machine-to-machine access patterns as first-class governance objects. Practitioners should align delivery controls with identity controls rather than leaving them in separate operational silos.

Compliance pressure is pushing CI/CD secrets toward governed lifecycle controls. The article’s reference to SOC 2 and PCI DSS reflects a broader market reality: organisations now need evidence that pipeline secrets are scoped, auditable and revocable. That does not mean every team needs the same toolchain, but it does mean every team needs the same governance outcome. Security leaders should treat runtime access, auditability and rotation as baseline expectations for delivery credentials.

From our research library:

What this signals

Identity blast radius is the governing concept for CI/CD secrets. The security question is not whether a pipeline can access credentials, but how far compromise can travel if one job, one platform or one log stream leaks them. That shifts the control focus from simple storage to issuance, scope and revocation.

CI/CD secrets management now belongs in the same governance conversation as IAM and PAM. Delivery credentials are machine identities with production consequence, which means review cadence, ownership and offboarding matter just as much as in human access programmes. Teams that separate DevOps from identity governance will keep missing the same control gap.


For practitioners

  • Separate CI and CD secret scopes Give build, test and deployment stages only the credentials they need, and keep production runtime secrets out of the pipeline entirely.
  • Move high-value credentials out of platform-native storage Use an external secrets manager when you need stronger audit trails, finer-grained access control and a smaller breach blast radius.
  • Replace static pipeline secrets with short-lived credentials Prefer dynamic secrets or tightly scheduled rotation for jobs that can authenticate at runtime, especially for ephemeral pipeline steps.
  • Scan repositories and logs for leaked secrets Add pre-commit and repository scanning so secrets do not persist in git history, build logs or other broadly accessible pipeline artefacts.
  • Test secret compromise response before a real incident Document who revokes pipeline credentials, how downstream systems are notified and how access is validated after suspected exposure.

Key takeaways

  • CI/CD secrets are non-human identities in practice because they control automated access to testing, deployment and infrastructure. When those credentials are broad or long-lived, the compromise impact extends well beyond the pipeline job itself.
  • The strongest evidence in the article is the contrast between platform-native convenience and external-manager governance, because that is where auditability, rotation and blast radius diverge most sharply.
  • Teams should govern pipeline credentials as a lifecycle problem, not a storage problem, and make short-lived access, scoped permissions and revocation ownership explicit.

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 MITRE ATT&CK address the attack and risk surface, while NIST SP 800-53 Rev 5, NIST CSF 2.0 and CSA Cloud Controls Matrix set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageCI/CD pipelines expose secrets through logs, code and platform stores, which is the article's core risk.
NHI-07 — Long-Lived SecretsThe article contrasts static pipeline credentials with short-lived and rotated alternatives.
Recommendation — Scan pipeline paths for leaked secrets and remove exposed values from logs, code and variable stores. Replace long-lived pipeline secrets with dynamic or rotated credentials wherever runtime access allows.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementCredential lifecycle and rotation are central to governing CI/CD secrets safely.
Recommendation — Enforce credential issuance, rotation and revocation controls for pipeline authenticators under IA-5.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe article centers on scoping pipeline access to only the permissions each stage needs.
Recommendation — Limit pipeline entitlements to the minimum access needed for each automation stage and environment.
CSA Cloud Controls MatrixIAM — Identity and Access ManagementCloud delivery secrets are governed through identity, access scope and lifecycle controls.
Recommendation — Apply IAM governance to pipeline identities, including ownership, access review and revocation.
MITRE ATT&CKTA0006;TA0010 — Credential Access; ExfiltrationThe breach path involves stealing pipeline secrets and using them to reach downstream systems.
Recommendation — Map CI/CD secret exposure to credential-access and exfiltration techniques in your detection and response plans.

Key terms

  • CI/CD secret: A CI/CD secret is a credential used by build or deployment automation to reach source control, cloud services, registries, or internal systems. In practice it is a non-human identity artifact, so its scope, lifetime, storage location, and revocation path must be governed like any other privileged access token.
  • Platform-native secrets storage: Secret storage built into a CI/CD platform and used by jobs through environment variables or platform permissions. It is operationally convenient, but it tends to concentrate trust, weaken lifecycle controls and expand compromise impact when the platform itself is breached.
  • External Secret Manager: An external secret manager is any third party or platform-specific system that stores and serves secrets outside the primary governance layer. Teams may still use these stores for applications and cloud services, but they need a unifying control model to prevent drift in access rules, logging, and lifecycle management.
  • Blast Radius: The potential scope of damage if a specific credential or identity is compromised. Identities with broad permissions have a larger blast radius and represent a higher priority for least-privilege enforcement and security controls.

Deepen your knowledge

NHI governance, machine identity security, and secrets management are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM programme, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on July 8, 2026.
Updated on October 11, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org