-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
When using MFA enabled IAM users, eksctl is not caching MFA token and is requesting for a new token for every command execution. #4052
Comments
Thanks for asking @skkumsi, we will look into this. Eksctl does not do any authentication itself, it simply delegates to whatever is happening in your local environment. So there is a chance that we can fix this with some changes to your env. We will also try to reproduce and rule out eksctl as the issue. |
I think the "problem" is due to ekstctl didn't do any caching of the token[1]. It would requires some effort to implement it. [2][3]. [1] aws/aws-sdk-go#1329 |
Verified that nothing I do to set in aws environment (i.e. session tokens, assumed role creds, session values) can make eksctl not ask for the mfa token over and over again. Going to look into caching next. |
Hmm, according to #57 this should already work. |
Ah, no, that just fixes the AWS_PROFILE thing. Here is the relevant comment from Richard:
Ok, so it's apparent that caching is not going to happen. Just wanted to make sure, I'm not missing something. And yet, the pr description is super confusing:
This would suggest that the session should be forwarded, but isn't. |
Looking at the code, this actually should already work. Interesting. |
Nope, I understand now what needs to be done. |
@skkumsi thank you for the detailed issue links, it really helped in finding and putting this together. |
Once released, please test and feel free to re-open this in any case there is a question or issue with the cache. |
What happened?
When AWS CLI is configured with MFA enabled IAM users, for every eksctl command execution a prompt for MFA token is being given out. The 'eksctl' client is not caching the token unlike AWS CLI where the MFA token credentials are cached under ~/.aws/cli/cache directory.
How to reproduce it?
file: ~/.aws/config
In the above CLI config the MFA enabled IAM user 'tester' is assuming an IAM Role 'awsqs-eks-cluster'
when 'aws sts get-caller-identity' is executed for the first time, the MFA token prompt is being requested. Upon providing a valid MFA token, the command returns the following output.
For all consecutive AWS CLI commands, the cached credentials are used and users needs not enter MFA token again. If the above mentioned credentials.json file is deleted, AWS CLI also prompts for a MFA token again.
But in case of 'eksctl' client for every execution MFA token prompt is being given out. The 'eksctl' client is not using the cached credentials in ~/.aws/cli/cache/ , neither storing them after first execution elsewhere.
Are you using a downloaded binary or did you compile eksctl?
Downloaded binary
What type of AWS credentials are you using (i.e. default/named profile, MFA)? -
MFA.
Versions
The text was updated successfully, but these errors were encountered: