You find AWS access keys stored as repo secrets in 25 repos. Plan the migration.
IntermediateScenarioSecrets, OIDC & Environments
Answer
Situation read → Long-lived keys, unknown blast radius.
What I'd do →
- Create the GitHub OIDC provider in each AWS account (Terraform).
- Per repo and environment, create roles with trust pinned to
repo:ORG/REPO:environment:ENVand least-privilege policies. - Replace
aws-access-key-idinputs withrole-to-assume, addid-token: write. - After a green deploy, deactivate then delete the IAM user keys; check CloudTrail for any remaining usage first.
- Add an SCP or IAM policy alarm for new access keys on CI users.
Why → OIDC removes rotation burden and leaked-key risk; credentials live about an hour.
Interview tip → Mention checking CloudTrail before deleting keys; something always still uses them.
More on Secrets, OIDC & Environments
A developer asks to print a secret in the log "just once" to debug. What do you do instead?BeginnerStaging and prod need different database URLs and different AWS roles, using one workflow. How?BeginnerSecurity requires two people for prod deploys: the author cannot approve. Configure it.BeginnerWrite the AWS trust policy for a role used only by the prod deploy job of one repo.IntermediatePR workflows need read-only AWS access for `terraform plan`, including from same-repo branches. How do you set trust?AdvancedA team stores a 200 KB kubeconfig and certificates as secrets and hits the size limit. What do you recommend?Intermediate