-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OIDC: Can't assume role containing "github" #1093
Comments
Mine doesn't seem to work even without Github action: https://github.com/gyfchong/rumblr/blob/f66285185f64529004668a8d14878bcbac4d16a6/.github/workflows/deployment.yml#L28 Failed action: |
Had the same issue. Issue being - if the assumed role name is (in our case, it was exact match) GitHub, it fails as originally reported. Renaming the role (for example, changing to gh-oidc-role) with no other changes works. A couple of interesting things,
For reference, action is invoked as follows,
|
I had the same issue:
It was fixed by changing to role name to:
|
For anyone still facing this issue. I have used GitHubActions literally in the role name and it is working for me. The problem I was having was that I didn't add the This is my role ARN:
And this is the trust policy of that role: {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Federated": "arn:aws:iam::[redacted]:oidc-provider/token.actions.githubusercontent.com"
},
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition": {
"StringEquals": {
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
},
"ForAnyValue:StringLike": {
"token.actions.githubusercontent.com:sub": [
"repo:{organization}/{repository-a}:*",
"repo:{organization}/{repository-b}:*"
]
}
}
}
]
} Hope this helps. |
Describe the bug
Just like #953, OIDC seems to break down when the IAM role contains "GitHub." The runner couldn't assume the role of "github-action-deploy-to-staging" or "test-github-cicd," but assumed the role of "deploy-to-staging" without a hic, with the only difference between these roles being their name. After finding the aforementioned issue, I gave the solution a try and it worked.
Expected Behavior
I expect it to work even if the role contains "github".
Current Behavior
In GH action logs:
Reproduction Steps
As I said, the role must contains "github" to fail. Here's the failing step in question; (Also, permissions.id-token = write)
Possible Solution
#954 suggested to "either highlighting this restricted role name in the documentation, or fixing the issue preventing use of this role name." I'd like to vote for the second option this time around ;)
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: