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

KMS lookups give values $VAL wrapped as "b'$VAL'" when using python 3 #755

Closed
hauntingEcho opened this issue Mar 31, 2020 · 8 comments
Closed

Comments

@hauntingEcho
Copy link
Contributor

hauntingEcho commented Mar 31, 2020

While attempting to encrypt a password 'hello!' per the directions here:

  1. the command given for encryption fails entirely
  2. after getting encryption working, Stacker populated incorrect values

using the suggested encryption command aws kms encrypt --key-id alias/DbConnectionKey --plaintext 'hello!' --output text --query CiphertextBlob results in:

Invalid base64: "hello!"

From there, I attempted to use aws kms encrypt --key-id alias/DbConnectionKey --plaintext fileb://<(echo -n 'hello!') --output text --query CiphertextBlob and used the result to create a secret via Stacker. In this secret, I see:

image

Does this need a different configuration than the one from the docs, or is there another way I should be doing this? I'm currently using Stacker 1.7.0 on python 3.5.3. I've also tried dropping the '!' off the end and received the same behavior with just "hello".

@hauntingEcho hauntingEcho changed the title KMS lookups do not work if password is not valid base64 KMS lookups give values $VAL wrapped as "b'$VAL'" Mar 31, 2020
@hauntingEcho hauntingEcho changed the title KMS lookups give values $VAL wrapped as "b'$VAL'" KMS lookups give values $VAL wrapped as "b'$VAL'" when using python 3 Mar 31, 2020
@hauntingEcho
Copy link
Contributor Author

after uninstalling via pip3 and reinstalling via pip2, the issue only affects Python 3. For what it's worth, aws --version gives me aws-cli/2.0.0 Python/3.7.3 Linux/4.4.0-17763-Microsoft botocore/2.0.0dev4

@hauntingEcho

This comment has been minimized.

@baryal1299
Copy link

baryal1299 commented Sep 8, 2020

This has been resolved with 1.7.1

Still seeing the same issue, is this fixed for python 3?

$ aws --version aws-cli/1.16.199 Python/3.6.7 Darwin/18.7.0 botocore/1.15.39
$ stacker --version stacker 1.7.1

I went ahead and opened a pull request: #762

@hauntingEcho
Copy link
Contributor Author

you're right, I hadn't cleaned out my python2 installation and am seeing this issue again

@hauntingEcho hauntingEcho reopened this Sep 8, 2020
@bmcoelho
Copy link
Contributor

bmcoelho commented Oct 29, 2020

Hi guys,

Any chance to fix this in the next release? All the secrets are now showing as b'secret'

Thanks

@hauntingEcho
Copy link
Contributor Author

It looks like this should be fixed by your PR #765 , pending release ( #766 )

@phobologic
Copy link
Member

I'll go ahead and get a dot release out by this weekend.

@phobologic
Copy link
Member

https://github.com/cloudtools/stacker/releases/tag/1.7.2 - released, sorry for the delay!

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

No branches or pull requests

4 participants