Unable to obtain credentials for a profile that requires a double role assumption #6681
Closed
4 tasks done
Labels
bug
This issue is a bug.
p2
This is a standard priority issue
potential-regression
Marking this issue as a potential regression to be checked by team member
response-requested
Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Checkboxes for prior research
Describe the bug
When using a profile that requires 2 role assumption,
sts.getCallerIdentity
fails.Regression Issue
SDK version number
@aws-sdk/client-sts@3.632.0, @aws-sdk/credential-providers@3.632.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v18.20.4
Reproduction Steps
Consider the following
~/.aws/credentials
file:All cross account trust policies and IAM policies have been setup properly to allow:
role0
can assumerole1
role0
can assumerole2
role1
can assumerole2
Now run the following program:
Observed Behavior
AccessDenied: User: arn:aws:sts::ACCOUNT_B:assumed-role/TestIssue32195-2/aws-sdk-js-1732101456622 is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::ACCOUNT_B:role/TestIssue32195-2
Expected Behavior
The call should succeed and return the ARN of
role2
.Possible Solution
No response
Additional Information/Context
role2
is trying to assume itself. For some reason there seem to be an extra role assumption happening.aws sts get-caller-identity --profile role2
(tested both aws cli v1 and v2).The text was updated successfully, but these errors were encountered: