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

Subsequent "eyaml encrypt -s test" calls return different signatures #324

Closed
christian-2 opened this issue Aug 20, 2021 · 2 comments
Closed

Comments

@christian-2
Copy link

I have a tool that operates on a Hiera file. For instance, it checks whether contained certificates are still valid and inserts renewed ones when necessary. When switching to hiera-eyaml it would seem necessary to decrypt/encrypt the Hiera file before/after the tool does its job. Since the Hiera file lives in Git, its YAML fields (also encrypted ones) should remain unmodified if they were not touched by the tool.

I have noticed that eyaml encrypt -s test returns a new signature value each time around, even when keys remain unchanged. This is presumably due to "salt" that is being added. At first sight, this prevents the use of my tool in simple combination with hiera-eyaml, when it serves for encrypting certificate keys.

Is it possible to re-obtain the same signature value each time around, or what would you suggest for dealing with a situation like this.

@christian-2 christian-2 changed the title Subsequent "eyam crypt -s test" return different signatures Subsequent "eyam encrypt -s test" calls return different signatures Aug 20, 2021
@christian-2 christian-2 changed the title Subsequent "eyam encrypt -s test" calls return different signatures Subsequent "eyaml encrypt -s test" calls return different signatures Aug 20, 2021
@kenyon
Copy link
Member

kenyon commented Aug 20, 2021

Probably you should decrypt the encrypted values for your checks. I'm thinking that changing the encryption behavior would be bad crypto practice.

@christian-2
Copy link
Author

I have now refactored my code such that there is no longer a simple eyaml decrypt/encrypt bracket around my tool, but that the closing bracket is smart about which keys actually changed opposite the opening bracket. With that, it can avoid repeat encryptions (that lead to unwanted new "salt", etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants