wallix / awless

A Mighty CLI for AWS
http://awless.io/
Apache License 2.0
4.98k stars 263 forks source link

Support for AWS profile with MFA (multifactor authentication) #60

Closed deinspanjer closed 7 years ago

deinspanjer commented 7 years ago

I was trying to use the new aws.profile config setting, but I'm suspecting that awless doesn't yet support using a profile that requires the user to enter a MFA token?

fxaguessy commented 7 years ago

This should be possible in the last version of awless. Could you please test with awless config set aws.profile mfaprofile in which mfaprofile is the profile that has been configured with MFA in ~/.aws/config ?

deinspanjer commented 7 years ago

Thank you very much for looking into this!

I was able to get it to prompt and the command returned successfully after entering the MFA token code.

However, it doesn't appear to be caching/updating the credentials, unlike the normal aws cli, I have to enter a new token on every request which means I have to wait 30 seconds between each request as it is not allowed to reuse the same token.

fxaguessy commented 7 years ago

As far as I know, caching credentials on disk is not yet possible in aws-go-sdk. That's why the credentials are not persisted across awless commands. We will investigate how we make this more usable.

fxaguessy commented 7 years ago

See separated issue: #109 for the caching of STS credentials.