Loading tutorials
Intermediate · Mid: 15 chapters · 36 min read. States assumed prerequisites
Start readingsub (subject) claim is the field a cloud provider most often uses to decide whether a workflow may assume a role.permissions setting that lets a workflow request an OIDC token. It assumes you can read GitHub Actions workflow syntax, know what GITHUB_TOKEN is, and have a general idea of cloud IAM roles. Token claims and trust policies come in later chapters.id-token: write permission is what allows a job to ask for a token. Here you will see what happens when a step actually makes that request, and how the audience value shapeiss, aud, and sub mean, and how a workflow gets a token with id-token: write. Here you will see what a cloud provider checks before it hands out credentials.iss, aud, and sub. It also assumes you have a general idea of IAM roles and policies. Here you will see how a cloud provider decides whether to accept a token.sub, aud, and iss claims in a GitHub OIDC token. Here you will learn how to narrow a trust policy so only the workflows you intend can assume a role.id-token: write permission, the aud and sub claims, and how an AWS IAM trust policy uses conditions. Most OIDC failures come from three places: the workflow cannot get a token, the token has the wrong audience, or theid-token: write permission does, how the aud and sub claims work, and how a trust policy checks them. Here you will see that Azure, Google Cloud, and HashiCorp Vault accept the same GitHub token. Only the names ofworkflow_call, and the sub claim work. It also assumes you can read an IAM trust policy. The goal is to restrict cloud access by which workflow file runs the job, not only by which repository runs it.sub formats from the subject claim chapter and can write an AWS trust policy with StringEquals conditions. You also need admin rights on the repository or organization you want to change.