Zero trust on AWS: No access keys.
No standing admin.
Every request proves who it is.
People sign in once through your identity provider and get a role for their job. GitHub Actions and Terraform prove who they are with OIDC and get short-lived credentials that expire on their own. Here is exactly how we build it in your AWS accounts.
- IAM Identity Center
- GitHub Actions OIDC
- HCP Terraform dynamic credentials
- AWS Organizations
Short answer: zero trust on AWS means no request is trusted because of where it comes from. People sign in through IAM Identity Center with SSO, MFA and a permission set for their job. GitHub Actions and HCP Terraform authenticate with OpenID Connect (OIDC) and get short-lived credentials for one IAM role. There are no access keys left to leak.
Where your keys are today
- An AWS access key in GitHub secrets, created by someone who left a year ago and never rotated.
- A shared admin login that half the team knows, and nobody can say who used it last.
- Terraform Cloud holding a key with full admin, for every workspace, in every run.
Each one works for anyone who gets hold of it, from anywhere, until someone notices.
What zero trust means on AWS: four rules
- Verify every requestNo network location or old login is trusted. Each sign-in and each pipeline run proves who it is, every time.
- Least privilegeA role per job, with only the actions that job needs. Read-only unless it has to write.
- Short-lived credentialsNothing long-lived to steal. Sessions expire on their own, and there are no access keys to rotate.
- Everything recordedCloudTrail shows who, or which pipeline, took which role, and what it did with it.
Three ways in. Each one proves who it is.
People, GitHub Actions and HCP Terraform each get into AWS a different way, and none of them holds a key.
People
- EngineerSigns in once
- Your identity providerSSO and MFA
- IAM Identity CenterChecks group membership
- Permission set: DeveloperFor this job only
- Dev accountShort session, read-only in prod
GitHub Actions
- Workflow runproduction environment
- OIDC tokenrepo:your-org/app:environment:production
- AWS STSChecks audience and subject
- Role: deploy-prodCredentials for this run
- ECS and ECRNothing else
HCP Terraform
- Terraform runPlan, then apply
- OIDC token…workspace:prod-network:run_phase:plan
- AWS STSChecks audience and subject
- tf-plan · tf-applyRead-only to plan, write to apply
- Your AWS accountsChanged only by an approved apply
Role-based access with IAM Identity Center: one sign-in, a role per job
Nobody has an IAM user. Everyone signs in through your identity provider with SSO and MFA, and IAM Identity Center gives them a permission set for the accounts their job needs. Leavers lose AWS access the moment they are removed from the identity provider.
| Permission set | Who | What it can do |
|---|---|---|
| Developer | Engineering | Build and change in development accounts. Read-only in production. |
| Platform | Platform engineers | Change shared infrastructure, through the pipeline in production. |
| Auditor | Security, finance, auditors | Read-only everywhere, including logs and billing. |
| Break-glass | Two named people | Full access for emergencies, behind MFA, and every use raises an alert. |
Guardrails sit above every account. A service control policy in AWS Organizations stops anyone creating IAM users or access keys, so the old way can’t creep back in.
{
"Version": "2012-10-17",
"Statement": [{
"Sid": "NoLongLivedCredentials",
"Effect": "Deny",
"Action": ["iam:CreateUser", "iam:CreateAccessKey"],
"Resource": "*"
}]
}GitHub Actions to AWS with OIDC: no secrets to leak
Each workflow run asks GitHub for a signed token that names the repository and the branch or environment. AWS checks it against the role’s trust policy and hands back credentials for that role only. There is nothing in GitHub secrets to leak.
"Principal": { "Federated": "arn:aws:iam::ACCOUNT_ID:oidc-provider/token.actions.githubusercontent.com" }, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": { "StringEquals": { "token.actions.githubusercontent.com:aud": "sts.amazonaws.com", "token.actions.githubusercontent.com:sub": "repo:your-org/app:environment:production" } }
permissions: id-token: write # lets the job request the OIDC token contents: read jobs: deploy: environment: production # can require a reviewer first steps: - uses: aws-actions/configure-aws-credentials@v6 with: role-to-assume: arn:aws:iam::ACCOUNT_ID:role/deploy-prod aws-region: ap-southeast-2
Only the production environment of that one repository can take the deploy role, never a pull request branch. The full walkthrough is in our guide: deploying to AWS from GitHub Actions without access keys.
HCP Terraform (Terraform Cloud) dynamic credentials: a read-only role to plan, another to apply
HCP Terraform’s dynamic provider credentials use the same idea. Each run gets an OIDC token naming the organisation, project, workspace and run phase. So the plan, which anyone can trigger from a pull request, only ever gets a read-only role. Only an apply, after the plan is approved, can change anything.
"Principal": { "Federated": "arn:aws:iam::ACCOUNT_ID:oidc-provider/app.terraform.io" }, "Action": "sts:AssumeRoleWithWebIdentity", "Condition": { "StringEquals": { "app.terraform.io:aud": "aws.workload.identity", "app.terraform.io:sub": "organization:your-org:project:platform:workspace:prod-network:run_phase:plan" } }
TFC_AWS_PROVIDER_AUTH = true TFC_AWS_PLAN_ROLE_ARN = arn:aws:iam::ACCOUNT_ID:role/tf-plan TFC_AWS_APPLY_ROLE_ARN = arn:aws:iam::ACCOUNT_ID:role/tf-apply # The tf-apply role trusts the same token, ending run_phase:apply
The trust policy always checks the audience and the full subject, including your organisation’s name, so no other HCP Terraform organisation can use the role.
What your auditor sees
| Before | After | |
|---|---|---|
| People | IAM users and a shared admin login | SSO and MFA, a permission set per job |
| GitHub Actions | Access keys in secrets | OIDC, one role per repository and environment |
| Terraform | One admin key for every run | Read-only to plan, a separate role to apply |
| Leavers | Keys keep working | Removed from the identity provider, access ends |
| Evidence | Screenshots, collected by hand | CloudTrail and code, generated as you work |
How we get you there
- AssessWe find every IAM user, access key and admin role, and what still uses each one. A written plan and a price. From $3,000 + GST.
- BuildIdentity Center, permission sets, OIDC for GitHub and HCP Terraform, and the guardrails, as code your team reviews.
- Hand overDocumentation and runbooks for your team, with ongoing support only if you want it.
Common questions
What is zero trust on AWS?
An approach where no person or pipeline is trusted because of its network or an old login. Every request proves its identity: people through IAM Identity Center with SSO and MFA, pipelines through OIDC, and each gets short-lived credentials for a role with only the permissions its job needs.
How does GitHub Actions authenticate to AWS without access keys?
With OIDC. You add token.actions.githubusercontent.com as an identity provider in IAM, with the audience sts.amazonaws.com, and create a role whose trust policy checks the token’s subject, such as repo:your-org/app:environment:production. The workflow needs the id-token: write permission and uses aws-actions/configure-aws-credentials to assume the role.
How do I give Terraform Cloud access to AWS without access keys?
Use HCP Terraform’s dynamic provider credentials. Add app.terraform.io as an OIDC identity provider in IAM with the audience aws.workload.identity, create roles whose trust policies check the workspace and run phase in the token’s subject, and set TFC_AWS_PROVIDER_AUTH to true in the workspace. TFC_AWS_PLAN_ROLE_ARN and TFC_AWS_APPLY_ROLE_ARN give plans and applies different roles.
What is a permission set in IAM Identity Center?
A template of IAM policies. When you assign a permission set to a user or group for an AWS account, IAM Identity Center creates a matching role in that account, and people sign in to it with their identity provider login.
What happens to our existing access keys?
They are removed. Your pipelines and Terraform run on OIDC instead, with no secrets anywhere that could be exposed.
We use GitLab or Bitbucket, not GitHub.
GitLab CI and Bitbucket Pipelines also issue OIDC tokens. The AWS side is the same: an identity provider, and a role whose trust policy checks the token.
What about emergencies?
A break-glass role for two named people, behind MFA. Every use raises an alert, so it stays for emergencies.
Which identity providers work with IAM Identity Center?
Microsoft Entra ID, Okta, Google Workspace and other SAML providers, or Identity Center’s own directory if you don’t have one.
Sources
- AWS: Permission sets in IAM Identity Center
- AWS: Creating OpenID Connect identity providers in IAM
- GitHub: Configuring OpenID Connect in Amazon Web Services
- aws-actions/configure-aws-credentials
- HashiCorp: Dynamic credentials with the AWS provider
- AWS: Service control policies
- AWS: IAM credential reports
- AWS: IAM Access Analyzer findings
Checked against these on 25 November 2026.
Still have access keys in your pipelines?
On a 30-minute call we’ll look at where they are and what replacing them would take.
Book my free call →




