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

BUG: Beware of safe export and import function. It can corrupt your data. #235

Open
herrbpl opened this issue Sep 29, 2023 · 2 comments
Open

Comments

@herrbpl
Copy link

herrbpl commented Sep 29, 2023

safe exports json structures as escaped strings. When you import exported structures, previously structured data will be converted to string representation of json, this will cause your applications that do not expect vault secrets structure to change, to fail.

@umutkacar
Copy link

@herrbpl Can you please provide an example showing on which conditions the data structure gets corrupted?

@herrbpl
Copy link
Author

herrbpl commented Nov 18, 2023

Hi

For a long time Vault API allows to store arbitrary json structures in data field, not just key-values of a string type.

So when you had in vault key stored anything as json structure, this structure gets converted to string representation of structure and when it is reimported, it is imported as string, as result, applications that expect json structure under vault key, receive string instead. And complain because they cannot unserialise this to internal data objects.

Please see associated PR for exact differences.

PR adds additional behaviour which prevents this automatic conversion if directed by command line flag. Without specifying additional flags application behaviour stays as it was.
Siim

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

2 participants