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

[KNIFE-464] Support EC2 STS, i.e. AWS Federation tokens for authentication #289

Closed
wants to merge 1 commit into from

Conversation

chuckg
Copy link
Contributor

@chuckg chuckg commented Apr 30, 2015

KNIFE-464: Add support for the AWS session token to knife ec2 commands.

Effectively, this is a revert of a revert due to contributor license issues. I've rebased and fixed the tests. My opscode contributor user is cgg.

Related issue:
#276

Original merge (which was subsequently reverted):
https://github.com/chef/knife-ec2/pull/211/files

There were 3 tests failures, but those same 3 failures currently exist on master:

rspec ./spec/unit/ec2_server_create_spec.rb:436 # Chef::Knife::Ec2ServerCreate when configuring the bootstrap process configures the bootstrap to use prerelease versions of chef if specified
rspec ./spec/unit/ec2_server_create_spec.rb:1009 # Chef::Knife::Ec2ServerCreate tcp_test_ssh should return false if we do not get an ssh header
rspec ./spec/unit/ec2_server_create_spec.rb:1016 # Chef::Knife::Ec2ServerCreate tcp_test_ssh should return false if the socket isn't ready

This reverts commit 1e666b5.

Conflicts:
	CHANGELOG.md
	DOC_CHANGES.md
	lib/chef/knife/ec2_base.rb
	spec/unit/ec2_server_create_spec.rb
@siddheshwar-more
Copy link
Contributor

@chuckg @adamedx

To verify this we created IAM user with MFA enable option and used virtual device.
Tried - knife azure server list --aws-session-token <MFA-Code> . We are getting this ""' from device (i.e smart-phone in our case).
The generated MFA code is working with AWS portal. But not working with knife CLI.

Could you please send us steps/commands that you tried to test this changes?

@adamedx
Copy link

adamedx commented Jul 6, 2015

@siddheshwar-more, I think you want to pass the resulting sessiontoken value that you get from this aws cli comman

aws sts get-federation-token --name mystuff

rather than the MFA code.

@siddheshwar-more
Copy link
Contributor

@adamedx @chuckg
I've retrieved session token with help of below command and tested this changes. Its working fine.

aws sts get-federation-token --name mystuff

@NimishaS We can merge this changes!

@NimishaS
Copy link

Cherry-picked these changes in #332 and merged

@NimishaS NimishaS closed this Jul 14, 2015
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

Successfully merging this pull request may close these issues.

None yet

5 participants