What are the common mistakes in OIDC trust policies for CI?
AdvancedProductionIdentity, Least Privilege & OIDC for CI
Answer
- Missing
subcondition entirely (any GitHub repo in the world can assume the role). - Wildcards like
repo:acme/*:*on privileged roles. - Trusting
ref:refs/heads/*instead of a protected branch or environment. - Using
pull_requestworkflows for roles that can deploy. - One role shared by all repos with admin permissions.
- Forgetting that
subformats change if you customise them (GitHub lets orgs customise the OIDC subject template), breaking or widening matches.
Audit trust policies with IAM Access Analyzer and a periodic script that lists roles trusting the GitHub OIDC provider.
More on Identity, Least Privilege & OIDC for CI
How do you design AWS OIDC trust for GitHub Actions so only production deploys can assume the prod role?IntermediateHow do you configure OIDC for GitLab CI to AWS?IntermediateHow do you get from "everyone has AdministratorAccess" to least privilege without breaking things?AdvancedWhat SCP guardrails do you apply across an AWS organisation?IntermediateHow do you implement just-in-time (JIT) privileged access for production?IntermediateHow do you design IAM for a multi-account AWS landing zone?Beginner