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

MultiFactorAuthentication failed when using specific profile (--profile) #3974

Open
HieronyM opened this issue May 8, 2019 · 2 comments
Open

Comments

@HieronyM
Copy link

HieronyM commented May 8, 2019

I tried to use different profile when running custodian command.

Command:
custodian run -s output -r all --cache-period 0 -p policy-name -d rds/rds-postgres.yml --profile="profile-name"

It always return ClientError: An error occurred (AccessDenied) when calling the AssumeRole operation: MultiFactorAuthentication failed with invalid MFA one time pass code.

I have put my AWS config both in ~/.aws/config & ~/.aws/credentials that contain the profile.
Is this a known bug or I missing something?

Currently I have workaround by using awsudo to use specific profile
awsudo -u profile-name custodian run -s output -r all --cache-period 0 -p policy-name -d rds/rds-postgres.yml

Thank you.

@HieronyM HieronyM changed the title MultiFactorAuthentication when using specific profile (--profile) MultiFactorAuthentication failed when using specific profile (--profile) May 8, 2019
@kapilt
Copy link
Collaborator

kapilt commented May 8, 2019

if you have an mfa setup, authenticate to your account before running custodian, and if its in a profile set AWS_DEFAULT_PROFILE env or --profile, custodian is just using the sdk in that regard.

@HieronyM
Copy link
Author

HieronyM commented May 9, 2019

@kapilt ,

Yeah, It will try to authenticate first because It's asking the MFA passcode,
What I didn't know is why --profile option in custodian command always fail to accept the passcode, even if I put right passcode.

Regards.

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

No branches or pull requests

2 participants