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

Support for Credential files using Cross Account and MFA's #104

Closed
jrudge-kcom opened this issue Jun 2, 2017 · 4 comments
Closed

Support for Credential files using Cross Account and MFA's #104

jrudge-kcom opened this issue Jun 2, 2017 · 4 comments

Comments

@jrudge-kcom
Copy link

Hi,

I access a lot of accounts and have my credentials files set up to assume roles and use an MFA device, however you don't appear to support MFA.

Assume Role MFA token code: Error: Your AWS credentials seem undefined! AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY need to be exported in your CLI environment
Installation documentation is at https://github.com/wallix/awless/wiki/Installation

My credentials file looks like this:

[default]
aws_access_key_id = xxxxxxxxxxxxxxxxxxxxx
aws_secret_access_key = xxxxxxxxxxxxxxxxxxxxxxxxxx
[testaccount]
role_arn = arn:aws:iam::12345678910:role/xxxxxxx
source_profile = default
mfa_serial = arn:aws:iam::12345678910:mfa/jrudge

@simcap
Copy link
Contributor

simcap commented Jun 2, 2017

@jrudge-kcom we support MFA (see issue #60 ) and we use it ourselves.

If I am not mistaken the profile (here with MFA) should be picked up correctly if it is defined in the AWS config file (i.e. ~/.aws/config). Not sure if this works when it is in the shared credentials file (i.e. ~/.aws/credentials).

(Note that when defining extra profiles in the AWS config file you create a new section by prefixing with profile: ex: [profile my-mfa-profile])

@fxaguessy
Copy link
Contributor

@jrudge-kcom did you succeed to connect to AWS using MFA ?
FYI, for now, there is no caching of STS credentials (cf. #109), so the CLI will ask you a MFA token for each command.

@captind
Copy link

captind commented Jun 9, 2017

@fxaguessy I haven't had another chance to look yet. I am aware it won't cache the MFA. I am fine with that it just doesn't seem to recognise the fact I have loaded a profile. It works fine for all the other tools I use (including the AWS CLI).

@fxaguessy
Copy link
Contributor

OK, did you try with the -v verbose flag, which displays the profile used to launch the session (given with, for example -p my-profile-name) ?

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

No branches or pull requests

4 participants