Join our Newsletter — 33% off our NHI Course
Home› FAQ› Authentication, Authorisation & Trust› Should teams use OIDC federation or stored cloud…
Authentication, Authorisation & Trust

Should teams use OIDC federation or stored cloud keys for CI/CD access?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated October 7, 2026 Domain: Authentication, Authorisation & Trust

Use OIDC federation when the pipeline only needs cloud access for a specific run, because it removes the long-lived key problem entirely. Stored keys should be reserved for edge cases that cannot support federated issuance, and even then they need strict scoping and aggressive rotation.

Why the authentication model matters more than the transport

The choice is really about whether CI/CD gets cloud access through a short-lived trust exchange or through a reusable secret. oidc federation lets the pipeline prove who it is for that one run, then receive scoped credentials without keeping a standing key. That changes the blast radius, the rotation burden, and the number of places a compromise can be reused.

When teams default to stored keys, they are usually optimising for convenience at the expense of credential lifecycle risk. A long-lived key turns every build environment, log trail, and developer workstation that can see it into a possible reuse path. OIDC reduces that exposure by binding access to a specific workload, issuer, and audience rather than to a static secret.

For the underlying protocol model, OpenID Connect Core 1.0 is the relevant trust layer because it defines how OIDC extends OAuth 2.0 with identity assertions. In CI/CD, that matters when the pipeline needs a cloud role only while a job is running, not an always-on credential that survives the job.

Where stored keys still show up in practice

Stored cloud keys are not automatically wrong, but they are usually a fallback for legacy tooling, third-party products, or deployment paths that cannot accept federated tokens. In those cases, the key should be treated as a high-value credential with narrow permissions, explicit ownership, and a rotation plan that is measured in days or weeks, not quarters.

The most common failure mode is convenience drift. A key is created to solve one integration, then copied into additional repositories, runners, or secret stores until nobody can confidently state which systems can still use it. That is how a single access path becomes a shared secret with hidden dependency chains.

The practical guardrail is to prefer federated issuance whenever the cloud provider and pipeline platform both support it. If a stored key remains necessary, limit it to the smallest target account or role, scope the permissions to the exact deployment action, and remove it as soon as the replacement path is available.

NHIMG’s CI/CD Pipeline Identity Security Guide is a direct fit here because it focuses on keyless OIDC federation, token permissions, and trusted publishing patterns for pipelines. The related Cloud Workload Identity Guide is useful when teams need the broader cloud-side model for roles, managed identities, and workload identity federation.

What to verify before you standardise on one approach

Teams should verify three things before they declare federation the default. First, the cloud role trust policy must be constrained to the intended issuer, subject, and audience. Second, the pipeline platform must issue tokens only from the expected repository, environment, or job context. Third, the build system must not silently fall back to a stored key when federation fails.

That last point matters because a fallback path can quietly defeat the security value of the preferred design. If a job can still authenticate with an old secret when federation is unavailable, the organisation has not removed static credential risk, it has only hidden it behind a backup path.

The best operational signal is whether a pipeline can be recreated after a secret purge. If the answer is no, the system is still dependent on hidden credentials. If the answer is yes, and access is still working through short-lived tokens, the team has a much cleaner control boundary for audit and incident response.

For access-scoped implementation detail, RFC 6749: The OAuth 2.0 Authorization Framework supports the machine-to-machine grant model, while RFC 8707: Resource Indicators for OAuth 2.0 helps narrow tokens to the intended resource audience. Where stronger client binding is needed, RFC 8705: OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens adds a tighter proof-of-possession model.

Risk and Threat Considerations

Stored cloud keys create durable compromise potential because any disclosure can remain exploitable until rotation, revocation, and cleanup are complete. That makes them attractive to attackers who target build systems, secret stores, logs, and developer environments for reusable credentials.

Failure mechanism: A long-lived key can be copied from a runner, repository, artifact, or secret manager and then reused outside the original job context, often with no strong signal that the access is abnormal.

Impact: The attacker can move from one compromised pipeline to cloud control plane access, expand privilege, exfiltrate deployment artefacts, or plant persistent access that survives the original incident response window.

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 addresses the attack surface, NIST SP 800-53 Rev 5 and CIS Controls v8 set the technical controls, and ISO/IEC 27001:2022 defines the regulatory obligations.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-07 — Long-Lived SecretsStored cloud keys create the long-lived secret risk the question contrasts with OIDC.
NHI-04 — Insecure AuthenticationOIDC federation versus stored keys is an authentication design choice for CI/CD access.
NHI-05 — Overprivileged NHICI/CD cloud access often fails by granting excessive permissions to pipeline credentials.
Recommendation — Prefer ephemeral federation and rotate any unavoidable static credential aggressively. Use federated, proofed authentication instead of reusable static secrets where possible. Scope pipeline credentials to the minimum role and resource set required for the run.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementThe question centers on lifecycle handling of reusable keys versus federated authenticators.
IA-9 — Identification and Authentication (Non-Organizational Users)CI/CD workloads are non-organizational actors authenticating to cloud services.
AC-6 — Least PrivilegeThe access decision depends on scoping CI/CD credentials to only the required cloud actions.
Recommendation — Minimise authenticator lifetime and enforce rotation or replacement for standing secrets. Authenticate workload identities with bounded credentials instead of shared static keys. Restrict pipeline permissions to the minimum role, resource, and action set.
ISO/IEC 27001:2022A.5.15 — Access controlThe question is about choosing the safer access path for CI/CD cloud authentication.
A.8.5 — Secure authenticationOIDC federation and stored keys are alternative authentication mechanisms for pipelines.
Recommendation — Define a default federated-access pattern and limit exceptions to approved cases. Prefer short-lived federated authentication over reusable stored credentials.
CIS Controls v8CIS-5 — Account ManagementPipeline keys are accounts and secrets that must be governed, rotated, and removed.
Recommendation — Inventory pipeline credentials and remove standing keys that are no longer needed.

Practitioner Guidance

What to prioritise: Make federation the default for any pipeline that can obtain cloud access per run, then inventory every remaining static key by account, scope, and owner. The exception list should be short enough to review manually.

What to verify: Confirm that every remaining stored key has a documented business reason, a narrow trust boundary, and a tested rotation path. If a key cannot be rotated without breaking production, that is a redesign problem, not a credential-management one.

Common mistake: Treating “stored in a secret manager” as equivalent to secure. Storage location reduces exposure, but it does not remove long-lived credential risk or limit replay once the secret is stolen.

Practitioner takeaway: Use OIDC federation whenever the access is job-scoped and replace stored keys only where the environment genuinely cannot federate, because the real decision is how much standing privilege you are willing to carry between runs.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

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