Loading tutorials
Intermediate · Mid: 15 chapters · 32 min read. States assumed prerequisites
Start readingaud claim does and why a trust policy should check it.sub claim, which is the value your trust policy matches against.sub claim, and understand how a role is assumed with sts:AssumeRoleWithWebIdentity. Here you will learn how the condition operator you pick decides how much trust the role grants.main branch of one repository assume an AWS role. It assumes you know GitHub Actions workflow YAML, AWS IAM roles, and what a JSON Web Token (JWT) is. It also assumes the GitHub OIDC provider is already registered in your AWS accountoken.actions.githubusercontent.com in your AWS account.sub claim in the OIDC token identifies the job that requested access. The previous chapter showed how to write a trust policy that matches environment:production. That policsub claim and write a trust policy with StringEquals and StringLike. Branch and environment subjects are covered earlier. Pull requests and tags have their own subject formats, and they are easy to trust by accident.sub and aud conditions. The sub claim tells you which repository and ref or environment asked for access. It does not tell you which workflow file ran. Other claims insub formats, such as repo:example-org/example-repo:ref:refs/heads/main and `repo:example-org/example-repo:envsub claim names the repository and context, and have written a policy that pins a branch or environment. Here we look at the mistakes that quietly widen who can assume a role, and how to fix each one.