Interview Prep/GitHub Actions/Secrets, OIDC & Environments

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 →

  1. Create the GitHub OIDC provider in each AWS account (Terraform).
  2. Per repo and environment, create roles with trust pinned to repo:ORG/REPO:environment:ENV and least-privilege policies.
  3. Replace aws-access-key-id inputs with role-to-assume, add id-token: write.
  4. After a green deploy, deactivate then delete the IAM user keys; check CloudTrail for any remaining usage first.
  5. 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.

All GitHub Actions questions Roadmap: GitHub Actions

More on Secrets, OIDC & Environments