Skip to content
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

use MFA config of SourceProfile #1250

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liutao-samsung
Copy link

My profile file:

[profile root]
mfa_serial=arn:aws-cn:iam::xxxxxxxxxxxx:mfa/mfa
region=cn-north-1
credential_process=aws-vault export --prompt=osascript --format=json root

[profile work]
role_arn = arn:aws-cn:iam::xxxxxxxxxxxx:role/to-assume
region=cn-north-1
source_profile = root

then I run:

av login work -s --debug

I got error:

2024/07/24 15:24:30 profile root: skipping GetSessionToken because profile 'work' has no MFA serial defined
...
2024/07/24 15:24:30 [keyring] Found item "aws-vault (root)"
aws-vault: error: login: operation error STS: AssumeRole, https response error StatusCode: 403, RequestID: 392da53b-2cc1-43dc-ac66-e8e0bed4ed84, api error AccessDenied: User: arn:aws-cn:iam::xxxxxxxxxx:user/mfa is not authorized to perform: sts:AssumeRole on resource: arn:aws-cn:iam::xxxxxxxxxx:role/to-assume

I think profile 'work' should use MFA config of profile 'root' . just like awscli.

➜ aws sts get-caller-identity --profile work --no-cli-pager
Enter MFA code for arn:aws-cn:iam::xxxxxxxxxx:mfa/mfa:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant