A developer's GitHub Actions workflow deploys an application to AWS. The workflow authenticates with an IAM user's access key that is stored as a repository secret. A security review requires the team to remove every long-term AWS credential from the CI system while the workflow keeps deploying. What should the developer do?
Choose one.
External workloads that can present an OIDC token can obtain temporary AWS credentials through web identity federation.
The requirement is no long-term credentials in CI. GitHub Actions can request an OIDC token for each job. With an IAM OIDC identity provider for token.actions.githubusercontent.com and a role that trusts it, the workflow calls AssumeRoleWithWebIdentity (for example through the aws-actions/configure-aws-credentials action) and receives short-lived credentials. Moving or rotating the access key keeps a long-term credential, and GitHub does not issue SAML assertions to workflows.
- Identify that the requirement is to eliminate long-term keys, not to protect them better.
- Recall that GitHub Actions can issue an OIDC token to each job.
- Trust that token with an IAM OIDC identity provider and a role.
- Use AssumeRoleWithWebIdentity to get temporary credentials.
Exam tip: CI systems that issue OIDC tokens should assume a role with web identity federation instead of storing access keys.
DVA-C03 Authentication and Authorization: IAM, Cognito, STS and Signed URLs — the lesson that teaches this.