What 1Password field type to store a json formatted secret?
I have a lengthy json formatted secret I want to store in 1Password and access for use in terraform (using the provider or otherwise), but I can't figure out how to store a json file in 1Password without it stripping the whitespace/formatting.
I tried adding it to a Password and that doesn't allow multi-line. It looks like Text would do it, but I'd prefer it not be immediately visible in the 1Password client.
I tried a txt file attachment to a record, but there is not "copy secret reference" for that field type (though maybe it is still accessible in that way?).
Thanks,
Mike
1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Browser: Not Provided
Comments
-
For this situation, I typically remove the line breaks so that it can be stored in a field of type Password.
jq -c
can do the needed removals.Makes the secret cumbersome for a human to work with, but it works.
Otherwise, pasting the pretty-printed value into a field of type Text works but the value is not obscured in the client.
Another option is to create a template. Usually, only one or two values in a large JSON document are the actual sensitive secrets. Replace those with references to simpler Password or Login vault items and use
op inject
to render a file with the secret values filled in.Terraform may also have native templating features that can generate the JSON without the need for a file to live on disk.
0