Subscribe to the Non-Human & AI Identity Journal

What breaks when CI/CD pipelines can list tables with long-lived credentials?

When CI/CD pipelines can list tables with long-lived credentials, table discovery stops being a bounded task and becomes recurring standing access. The same identity can be reused across jobs, environments, and time, which makes revocation difficult and audit trails harder to trust. That pattern also widens the blast radius if the pipeline is compromised.

Why This Matters for Security Teams

When a CI/CD pipeline can list tables with long-lived credentials, the pipeline is no longer performing a bounded build or deploy action. It becomes a standing, reusable identity with discovery power that can outlive the job, the branch, and sometimes the environment. That shifts the risk from “what did this pipeline need today?” to “what can this credential still do tomorrow?”

This is exactly where secrets sprawl and over-entitlement collide. NHIMG research on the Guide to the Secret Sprawl Challenge shows why unmanaged secret growth becomes an operational security problem, not just a hygiene issue. The broader industry guidance in the OWASP Non-Human Identity Top 10 also makes clear that long-lived non-human credentials are a recurring source of privilege persistence.

The practical consequence is that table discovery becomes a durable capability instead of a task-scoped permission. Once that happens, audit trails lose meaning because the same credential can be reused across jobs, rerun after failure, or copied into another workflow. In practice, many security teams only notice this pattern after a pipeline secret is reused outside its intended job boundary, rather than through deliberate identity design.

How It Works in Practice

The right mental model is not “can the pipeline authenticate,” but “what should this workload be able to prove, for how long, and for which action.” For CI/CD, current guidance suggests moving away from static database credentials and toward short-lived workload identity plus runtime authorization. That means the pipeline presents cryptographic proof of what it is, then receives narrowly scoped access only for the task it is executing.

In practice, teams often combine a workload identity system such as SPIFFE with ephemeral tokens, policy-as-code, and just-in-time secret issuance. The pipeline might receive a short-lived credential only after the build stage starts, and that credential may be constrained to metadata-only actions rather than broad table enumeration. If listing tables is required, it should be explicit, time-bound, and tied to the environment and job context. This aligns with the identity principles in NIST SP 800-63 Digital Identity Guidelines, even though CI/CD workloads are not human users.

  • Use workload identity as the primary trust anchor, not shared pipeline secrets.
  • Issue short-lived credentials per job or per stage, then revoke them automatically.
  • Separate discovery permissions from data access so table listing is not a proxy for broad read rights.
  • Evaluate access at request time using context such as repo, branch, environment, and deployment target.

NHIMG’s CI/CD pipeline exploitation case study shows why this matters: a compromised pipeline can turn harmless-looking automation into a credential replay path. These controls tend to break down when shared runners, self-hosted agents, and manually injected secrets all coexist, because the trust boundary becomes too broad to enforce consistently.

Common Variations and Edge Cases

Tighter pipeline access often increases operational overhead, requiring organisations to balance reduced blast radius against slower builds, more policy complexity, and more moving parts in the release process. There is no universal standard for this yet, but best practice is evolving toward ephemeral access and contextual authorization rather than permanent credentials.

Some environments still need table listing for migration scripts, schema validation, or test harnesses. In those cases, the safer pattern is to grant the minimum discovery scope to a dedicated non-production identity and bound it to a single stage or ephemeral environment. Static “one secret for every job” setups are especially risky when the same pipeline spans dev, test, and prod, because a benign read path in lower environments can become a privilege escalation path in production.

The issue is not only secrecy, but persistence. The Ultimate Guide to NHIs — Static vs Dynamic Secrets highlights why dynamic secrets are better aligned to machine workloads: the credential should expire with the job, not merely sit in a vault waiting to be reused. That model is also consistent with the OWASP NHI guidance, which treats long-lived access as an anti-pattern for non-human identities. In highly regulated environments, the design challenge is often not technical feasibility but governance approval for short TTLs and tightly scoped entitlements.

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

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-03 Long-lived pipeline credentials create persistent non-human access.
NIST CSF 2.0 PR.AC-4 Pipeline table listing should be least privilege, not standing access.
NIST AI RMF Context-aware runtime authorization reduces persistent access risk for automated workloads.

Replace shared pipeline secrets with short-lived NHI credentials and revoke them at job completion.