-
Notifications
You must be signed in to change notification settings - Fork 202
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 MFA #447
Comments
Current workaround:
|
That seems like a painful workaround, but prompting for it would not work in automated/headless situations. What about expecting it in an environment variable? |
I would imagine automated/headless situations would not be configured to use IAM users that require MFA. The AWS-recommended approach would be to use an IAM instance profile, for example. The documented process for setting the needed environment variables documented here is not much less painful. It still requires the |
@ncalteen We use a tool called Gossamer to setup sessions where we create a "session" for this and then you specify that "profile" in your .kitchen.yml to use that on your behalf. https://github.com/GESkunkworks/gossamer3 Works for CLI and Chef and anything else that needs MFA auth that will map to an AWS role that you have permissions for. |
Version:
1.4.0
Environment:
OS: macOS 10.14
Ruby: 2.3.0p0
ChefDK: 3.8.14
Test Kitchen: 1.24.0
Scenario:
Due to compliance/regulatory requirements, some organizations enforce the requirement that programmatic access to AWS APIs use Multi-Factor Authentication (MFA). With the AWS Command Line Interface (AWS CLI), users are automatically prompted to provide their MFA token when making API calls. New session credentials are generated by AWS Security Token Service (AWS STS) and cached locally. The user is then prompted again when the credentials have expired. Currently,
kitchen-ec2
does not "bubble up" this token request, instead failing with the following (having specified theshared_credentials_profile
in.kitchen.yml
.Steps to Reproduce:
~/.aws/config
.source_profile
..kitchen.yml
.kitchen create
.The AWS credentials configuration file should information similar to the following:
The
.kitchen.yml
should be similar to the following.Expected Result:
On the final step, the user should be prompted for their MFA token. This is in line with the result of running a similar AWS CLI command.
$ aws ec2 describe-instances --profile roleprofile Enter MFA code for arn:aws:iam::123456789012:mfa/mfauser:
Actual Result:
See below output:
The text was updated successfully, but these errors were encountered: