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

#get_password_data | Still can't receive a decrypted password #1003

Closed
Freaklin opened this issue Nov 17, 2015 · 4 comments
Closed

#get_password_data | Still can't receive a decrypted password #1003

Freaklin opened this issue Nov 17, 2015 · 4 comments
Assignees
Labels
feature-request A feature should be added or improved.

Comments

@Freaklin
Copy link

There's no option to get a decrypt windows password so people have to take a workaround using aws-cli through shell or base64 stuff...
Could you provide us a solution for this with an option like "[--priv-launch-key ]" available on "aws-cli get-data-password"

@awood45
Copy link
Member

awood45 commented Nov 17, 2015

Can you please explain a bit more about what you're trying to do?

@awood45 awood45 self-assigned this Nov 17, 2015
@awood45 awood45 added feature-request A feature should be added or improved. Version 2 labels Nov 17, 2015
@Freaklin
Copy link
Author

Quiet simple :)

I'm using aws-sdk for ruby and I'm trying to retrieve a password of a windows instance.

ec2 = Aws::EC2::Client.new( region: region_name )
ec2.get_password_data({ instance_id: "instance_id" })

then it returns me a encrypted password.

But using AWS-CLI I'm able to retrieve A already decrypted password, pointing a .pem file.

aws ec2 get-password-data --priv-launch-key file.pem --instance-id "instance_id"

I would like an option like "--priv-launch-key file.pem" on aws-sdk for ruby. well I guess not only me once I've found an issue on the aws-sdk-v1 with the same request.

#459

@awood45
Copy link
Member

awood45 commented Nov 18, 2015

Looking at the CLI source for this functionality, the ask appears to be for client-side decryption of EC2 passwords as a plugin.

I'll add this as a feature request, and would also be happy to take a pull request for this.

awood45 added a commit that referenced this issue Nov 18, 2015
Feature request to automatically decrypt passwords when the appropriate
.pem key is provided.

Related to GitHub issue #1003.
@awood45 awood45 closed this as completed Nov 18, 2015
awood45 added a commit that referenced this issue Nov 19, 2015
@cjyclaire
Copy link
Contributor

This feature is already supported in SDK now, you can decrypt windows instance password by:

# After you have an available running instance
ec2 = Aws::EC2::Resource.new(region: 'us-west-2')
key_path = "/path/to/your/private/key"

decrypted_password = ec2.instance('your-instance-id').decrypt_windows_password(key_path)

Cheers :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants