Cloud OIDC Federation Guide: Replace Long-Lived CI/CD Credentials Across AWS, Azure, and Google Cloud
Cloud SecurityOIDCWorkload IdentityCI/CDAWSAzureGoogle Cloud

Cloud OIDC Federation Guide: Replace Long-Lived CI/CD Credentials Across AWS, Azure, and Google Cloud

CCloud Life Editorial Team
2026-11-21
7 min read

Learn how OIDC federation replaces long-lived CI/CD keys across AWS, Azure, and Google Cloud, with rollout and recurring review steps.

OIDC federation lets a CI/CD platform exchange a short-lived identity token for temporary cloud permissions, so deployments can access AWS, Azure, or Google Cloud without storing long-lived access keys. This guide explains how the trust relationship works, what to monitor, how to roll it out safely, and when to review it as repositories, branches, and cloud accounts change.

Overview

Traditional CI/CD authentication often depends on a cloud access key saved as a repository, organization, or pipeline secret. That approach creates an enduring credential that may remain valid until someone rotates or revokes it. OIDC cloud authentication replaces that pattern with a trust exchange between the CI/CD provider and the cloud provider.

During a workflow run, the CI/CD system issues a signed OIDC token describing the workload. The cloud provider validates the token through a configured identity provider and checks whether its claims match an approved trust policy. If the conditions pass, the cloud platform issues temporary credentials or an access token for the requested role or workload identity.

The important security control is not OIDC alone. It is the combination of:

  • A trusted identity provider configured in the cloud account or tenant.
  • Conditions that restrict which organization, repository, project, branch, tag, or environment may authenticate.
  • A narrowly scoped deployment role or service account.
  • Short-lived credentials that are not permanently stored in the CI/CD system.
  • Audit records that connect a cloud action to a workflow identity.

OIDC is therefore a workload identity pattern, not a replacement for authorization design. A broadly privileged role remains dangerous even when it is accessed through a short-lived token.

Provider comparison

AreaAWSAzureGoogle Cloud
Trust modelAn external OIDC identity provider is trusted by an IAM role.A federated credential connects an application or managed identity to an external token issuer.A workload identity provider is connected to a service account or another permitted identity.
Primary conditionsUse token claims such as issuer, audience, repository, branch, tag, or environment where supported.Use issuer, subject, audience, and other claims exposed by the CI/CD token.Map token claims to attributes and apply an attribute condition to restrict access.
Token behaviorThe workflow exchanges its OIDC token for temporary role credentials.The workload exchanges its token through the configured federated identity flow.The workload exchanges its token for short-lived credentials through workload identity federation.
Audit focusReview role-assumption events and identify the workflow or subject that initiated them.Review sign-in, token exchange, and resource activity records available in the tenant.Review token exchange and service-account activity, including the principal or mapped subject.
Permission boundaryAttach a least-privilege role policy and consider additional session or organizational controls.Assign only the required role or resource permissions to the federated identity.Grant only the required service-account permissions and restrict which principals may impersonate it.

Names, claim support, token audiences, and configuration screens can change. Treat the table as a design comparison, then verify the exact claims and limits in the documentation for the CI/CD platform and cloud provider you use.

What to track

A federation setup is a collection of relationships that can become stale. Track the relationships, not just whether the latest deployment succeeded.

1. Trust-policy scope

Record which repositories, projects, branches, tags, and deployment environments can assume each identity. A policy that permits an entire organization may be convenient, but it gives every matching workflow a path to the role. Prefer a specific repository and an explicit release branch or protected environment when the deployment model allows it.

Keep a simple inventory with these fields:

  • CI/CD platform and organization.
  • Repository or project name.
  • Cloud provider, account, subscription, project, and region if relevant.
  • Federated identity name and owner.
  • Permitted branch, tag, pull-request, or environment subject.
  • Cloud permissions and intended deployment purpose.
  • Last successful test and last review date.

2. Claims and audiences

Do not assume that a claim has the same name or meaning across providers. Confirm which claim identifies the repository, branch, tag, workflow environment, or project. Confirm the expected audience as well. A trust policy should match the audience intended for that provider rather than accepting any valid token from the issuer.

When testing, inspect the token claims safely without publishing the token itself. OIDC tokens are credentials while valid, so do not paste them into tickets, logs, screenshots, or chat.

3. Permissions and credential lifetime

Track the permissions attached to each role, service account, or managed identity. Compare them with the actual deployment actions. Remove permissions that were needed only for an old migration, a discontinued service, or a one-time infrastructure change.

Also record the effective lifetime of exchanged credentials and any session-duration settings. Short-lived access reduces exposure, but it does not prevent a malicious workflow from using valid credentials during the session. Treat workflow security, protected branches, dependency controls, and environment approvals as part of the same control system.

4. Static credential residue

After federation works, search the relevant repositories, organization secrets, variable groups, runners, and deployment scripts for old cloud access keys. Do not delete an old credential before confirming that no active job still depends on it, but do create a dated removal plan. The target state is clear: routine CI/CD authentication uses federation, and any exception has an owner, purpose, expiry date, and monitoring.

5. Audit and failure signals

Monitor successful and failed role assumptions or token exchanges, unexpected repositories, unusual deployment times, and attempts against retired identities. A sudden increase in denied exchanges can indicate a branch rename, claim change, audience mismatch, or an unauthorized workflow. A successful exchange from an unexpected subject is more urgent and should trigger investigation.

Cadence and checkpoints

Use a monthly or quarterly review cadence, with additional checks after identity or repository changes. The right interval depends on the number of repositories, deployment frequency, and sensitivity of the target environments.

Monthly operational check

  1. Review successful and failed federation events.
  2. Look for subjects, repositories, branches, or environments that are not in the inventory.
  3. Confirm that failed deployments are explained by an approved change rather than a disabled control.
  4. Check whether temporary credentials are appearing in job output or artifacts.
  5. Confirm that new deployment workflows use the approved federated identity pattern.

Quarterly access review

  1. Compare each trust policy with the current repository and branch structure.
  2. Review every permission attached to the federated role, service account, or identity.
  3. Remove unused identities and narrow broad repository or organization conditions.
  4. Verify owners, incident contacts, and documentation.
  5. Search for remaining static keys and check their age, location, and planned removal.
  6. Run a controlled authentication test from an approved workflow and a negative test from an unapproved context where practical.

Change-triggered checkpoint

Repeat the review immediately when a repository is transferred, renamed, archived, or split; when branches or environments are renamed; when a cloud account or tenant changes; when a CI/CD provider changes its token claims; or when a deployment role gains new permissions. Infrastructure-as-Code changes should receive the same review as application workflow changes because a small trust-policy edit can expand the authentication boundary.

How to interpret changes

Not every change is an incident. The goal is to distinguish expected operational drift from a weakened trust boundary.

  • More denied exchanges after a branch rename: likely a synchronization problem. Update the condition only after confirming the new branch is protected and intended to deploy.
  • A new repository appears in audit events: verify ownership and approval. Do not broaden a policy simply to make the deployment pass.
  • A role has accumulated permissions: compare the additions with deployment requirements and remove temporary or unrelated access.
  • Authentication succeeds but deployment fails: federation may be working correctly while authorization is incomplete. Separate token exchange troubleshooting from cloud permission troubleshooting.
  • A static key remains after migration: identify its consumer, replace the workflow path, revoke the key, and confirm that later runs do not recreate it.
  • Audit records lack useful workload context: improve subject conditions, session naming, mapped attributes, or log retention so responders can connect an action to a repository and run.

Keep trust configuration and permission configuration separate in review. A valid token proves that a workflow met the federation conditions; it does not prove that the workflow should be allowed to modify every resource in the account.

When to revisit

Revisit this guide on a quarterly schedule and whenever recurring identity data changes. The most useful trigger is not a calendar date alone; it is a change to the path between a repository and a production account.

Use this practical review sequence:

  1. Export or inspect the current list of federated identities and trust relationships.
  2. Compare each relationship with the repository, branch, tag, and environment inventory.
  3. Review recent audit events for unexpected subjects, denied attempts, and unused identities.
  4. Run a successful test from an approved workflow and, where safe, a denied test from an unapproved context.
  5. Check role, service-account, and managed-identity permissions against the deployment's real requirements.
  6. Remove stale trust relationships and revoke obsolete static keys only after dependencies are confirmed.
  7. Record the reviewer, date, changes, test results, and next review date.

Maintain the configuration in code where possible, require peer review for trust-policy changes, and protect the branches or environments that can request production credentials. For related operational controls, review the secrets management comparison, the cloud log retention policy guide, and the Terraform state backup and recovery runbook. A recurring audit that confirms scope, permissions, auditability, and the absence of stale keys turns OIDC federation from a one-time migration into a maintainable cloud security control.

Related Topics

#Cloud Security#OIDC#Workload Identity#CI/CD#AWS#Azure#Google Cloud
C

Cloud Life Editorial Team

Cloud Security Editors

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.