iac.htora.dev · security templates

Home/Refreshers/Cloud access for pipelines and pods without stored keys: refresher

Cloud access for pipelines and pods without stored keys

Pipelines and pods prove who they are with short-lived tokens, so there is no cloud key to leak.

Remember

  1. The pipeline or pod asks for a token: from GitHub or its cluster.
  2. The cloud checks the trust policy: which repository, which branch, which service account.
  3. It gets short-lived credentials: valid for this run only.
  4. The audit log names the workload: the repository and branch, or the pod.
PlatformUsesThe part that catches people
AWSIAM OIDC provider for GitHub Actions, and EKS Pod IdentityA trust policy that checks only the audience lets every repository on GitHub assume the role, because every workflow gets tokens from the same issuer.
Google CloudWorkload Identity Federation for GitHub, and GKE Workload IdentityThe attribute condition is the control.
AzureMicrosoft Entra workload identity federation on a managed identity, and AKS workload identityEntra accepts a wrong subject at creation and refuses the exchange later, with no error on the credential itself.
Oracle CloudIdentity domain token exchange for GitHub Actions, and OKE workload identityOne secret remains in GitHub: the exchange application's client secret, because Oracle's token endpoint requires a confidential client to authenticate.

Run the quick start

Download providersterraform init
Previewterraform plan
Applyterraform apply

Watch out

  • GitHub's token subject names the branch, tag, pull request, or deployment environment the workflow ran in.
  • AWS records every federated sign-in in CloudTrail with the token's subject.
  • Repositories created on GitHub after 15 July 2026 carry IDs in the token subject, repo:org@123456/repo@456789:ref:refs/heads/main, and older repositories can opt in.
Check it worked

Run the pipeline with no cloud secrets stored anywhere. It still deploys, and the cloud audit log shows a federated identity naming the repository and branch.

Read the full pageDownload PDF

Registry 0.23.0. Built 2026-11-17.

Made by Habibullah Tora. Source on GitHub. Code under the MIT licence, writing under CC BY 4.0.