Zero-Secret DevOps: Managed Identities and OIDC

Updated

7 min read

Flat illustration of a keycard-shaped token resting on a blue cloud, with a dotted trail, representing short-lived access in OIDC federation
In this article
  1. What Zero-Secret DevOps means in practice
  2. The four options compared
  3. How OIDC federation works in a pipeline
  4. Managed identities for Azure workloads
  5. Workload Identity Federation on Google Cloud
  6. AWS: creating the OIDC identity provider
  7. Trust conditions decide whether the setup is safe
  8. Where stored secrets still remain
  9. What to check before you migrate
  10. Which one to pick
  11. FAQ
  12. Is OIDC federation the same as a managed identity?
  13. Does the id-token permission give access to my cloud account?
  14. Why is a trust condition required?
  15. Are managed identities free?

Zero-Secret DevOps describes a delivery pipeline that holds no long-lived cloud keys. Two mechanisms make it practical today. OpenID Connect (OIDC) federation lets a CI/CD job exchange a short-lived identity token for cloud access, and managed identities let an Azure workload get its own identity without a stored password. This article explains how each one works, where each one applies, and which trust rules decide whether the setup is safe.

No standard or vendor defines the term. This article uses it as a label for pipelines and workloads that avoid stored secrets for cloud access. The sources are listed at the end.

What Zero-Secret DevOps means in practice

Most cloud credentials used by pipelines are static: an access key, a service account JSON file or a client secret stored in the CI system. Static credentials stay valid until someone rotates them, and rotation is a manual task. A zero-secret design replaces the stored value with a trust relationship. The cloud provider accepts a token from a known identity provider, checks its claims against a policy, and issues access that expires within minutes or hours.

The four options compared

The table below lists the mechanisms covered by the vendor documentation. They solve related problems, but each one fits a different place in the stack.

MechanismWhere it appliesWhat is trustedStored secret needed?
GitHub Actions OIDCJobs that deploy to AWS, Azure or Google CloudA token issued by GitHub for one jobNo, if the cloud trust policy is set
Azure managed identityAzure compute such as VMs, scale sets and app hostsThe identity in Microsoft Entra ID assigned to the resourceNo
Google Cloud Workload Identity FederationWorkloads outside Google Cloud, including AWS, Azure and GitHubA token from an external OIDC or SAML 2.0 providerNo service account key
AWS IAM OIDC identity providerRoles that trust an external OIDC issuer, such as a CI platform or a clusterThe issuer URL and audience registered in IAMNo

How OIDC federation works in a pipeline

In GitHub Actions the flow has four steps. The workflow requests a token from GitHub. GitHub issues a token that describes the run: the repository, the branch or environment, and the workflow. The cloud provider checks the token signature and the claims against a trust policy. If the policy matches, the provider returns short-lived cloud credentials for that job only.

The GitHub documentation says the token is valid for a single job and then expires. The job needs the id-token: write permission. That permission only lets the workflow fetch the OIDC token; it does not grant write access to any cloud resource. Access still depends on the role or identity the cloud side attaches to the token.

Managed identities for Azure workloads

Microsoft Learn describes managed identities as an identity in Microsoft Entra ID given to an Azure compute resource, so the resource can request tokens for services that accept Entra authentication. The application code never handles a password. Microsoft states that managed identities carry no extra charge.

  • System-assigned. Created with one resource and deleted with it. Simple, but the identity cannot be shared.
  • User-assigned. A standalone resource that several compute resources can use. Microsoft recommends this type for Microsoft services.

Microsoft also states that no one, including people with privileged roles, can read the credentials behind a managed identity. The practical result is that a leaked repository does not expose a password, because there is none to copy.

Workload Identity Federation on Google Cloud

Google Cloud’s Workload Identity Federation lets workloads outside Google Cloud reach Google Cloud resources without service account keys. The external token goes to Google’s Security Token Service, which verifies it and returns a federated token. The docs describe this as an OAuth 2.0 token exchange. The federated identity can be granted access directly, or it can impersonate a service account.

Google’s best-practice page recommends one provider per pool, to avoid subject collisions, and attribute conditions when the external IdP is shared by many tenants, as GitHub is. Google describes attribute conditions as the way to limit which identities from a public IdP can use a pool.

AWS: creating the OIDC identity provider

On AWS, the trust starts with an IAM OIDC identity provider. The AWS documentation requires an https provider URL, a discovery document at the standard well-known path, and at least one audience, which is the client ID registered with the external provider. Each URL can be registered only once per account. Thumbprints are optional, and up to five can be listed. IAM can retrieve the thumbprint itself when none is given.

Google, Facebook and Amazon Cognito are built in and need no separate IAM provider. For any other issuer, the provider has to be created first, then a role is written whose trust policy checks the token’s audience and subject. The GitHub guide for AWS also notes that custom OIDC claims are not supported there.

Trust conditions decide whether the setup is safe

A federated trust is only as narrow as its conditions. Three checks matter most.

  1. Bind the trust to the repository and the branch or environment. GitHub’s documentation says the cloud trust policy needs at least one condition so that untrusted repositories cannot obtain tokens. Environment protection rules, such as branch restrictions, are recommended when environments are part of the policy.
  2. Keep the role small. A token that is correctly issued still grants whatever the attached role allows. A deploy job rarely needs administrator rights.
  3. Do not trust by location. NIST’s zero trust work, SP 800-207, states that trust is not granted from network position. Federation fits that model: the token carries identity and context, not an address.

Where stored secrets still remain

Zero-secret does not mean zero secrets in the company. Three cases usually keep a stored credential. The first is a third-party service that accepts only API keys and has no OIDC option. The second is the bootstrap step that creates the trust itself, which needs an administrator to run once. The third is an older system that cannot call the token endpoint. For these cases the practical goal is to narrow the secret: a scoped key, a vault, a short rotation period and a log of use.

What to check before you migrate

  • List every pipeline and workload that holds a cloud key, and the systems each key can reach.
  • Create the identity provider or pool first, and test the trust policy with one non-production job.
  • Write the subject or repository condition before the role grants any permission.
  • Remove the old key only after the new path works, and record the removal date.
  • If a regulation sets access-control or audit duties for the systems involved, check with counsel before changing who can deploy.

Which one to pick

For a GitHub pipeline that deploys to one cloud, use the OIDC option of that cloud. For Azure workloads that run on Azure compute, a managed identity is the simpler choice, and a user-assigned identity is the better fit when several resources need the same permissions. For a multicloud estate or workloads outside Google Cloud, Workload Identity Federation gives one model for many external issuers. The shared rule is the same in each case: bind the trust to a precise claim and grant the smallest role that works.

FAQ

Is OIDC federation the same as a managed identity?

No. OIDC federation trusts a token from an external issuer, such as a CI platform. A managed identity is an identity that Azure gives to a compute resource. Both avoid stored passwords, but they start from different places.

Does the id-token permission give access to my cloud account?

No. GitHub documents that id-token: write only lets the workflow request the OIDC token. The cloud role attached to that token decides what the job can do.

Why is a trust condition required?

Without a condition, a token from a shared issuer could match a role that was meant for one repository. GitHub’s documentation requires at least one condition in the cloud trust policy for this reason.

Are managed identities free?

Microsoft states that managed identities can be used at no extra cost. Charges for the services the identity reaches are separate.

About the author

Equipe Gui Tech

68 articles published

The Gui Tech team researches, verifies and updates every guide with verifiable sources. Enterprise tech, AI and security explained.

All articles

Keep reading