CTL-094 · human
Short-Lived Cloud Credentials for CI
Replace static cloud keys in CI with OIDC federation scoped to repo, branch and environment.
TechnicalEffort MediumEffectiveness High
Static keys in pipeline secrets can be printed and reused anywhere. OIDC federation lets a job get short-lived credentials only when it runs from an approved repo and branch. A stolen token expires in minutes and cannot be used from a laptop without the job context.
This also limits what an insider can harvest from a runner. Even if they print the token, it only works for a short time and only with the trust conditions set on the role. Rotate any remaining static keys on a short schedule until they can be removed.
Put it in place
- 01Configure GitHub Actions or GitLab OIDC as an identity provider in AWS, Azure and GCP.
- 02Scope role trust to `repo:<org>/<repo>:environment:production` or a protected branch ref.
- 03Remove all long-lived cloud keys from CI secrets and rotate any that were exposed.
- 04Alert on use of CI roles from IPs outside runner ranges.