Vault: Cannot write & in secrets

Created on 14 Jul 2016  路  3Comments  路  Source: hashicorp/vault

Hi All,

I'm not very active on Github so please pardon me if I'm posting this incorrectly in any way.

When typing an & into any key/value pair the command prompt see characters after the & as a new command and throws an error. Vault writes the characters before the ampersand into the key/value pair and drops the text after the & - see the screenshot below.

vaultampersand

This is just something I came across in testing. Looking at all my _real_ apikeys and random generated passwords I can't see any that contain an & so maybe this is all 'known' already.

Thanks,

Adam

Most helpful comment

Hi Adam,

You need to quote the value -- I don't know much about quoting semantics on
Windows, but I would guess that either " or ' would work -- try both! If
that still gives you trouble, maybe try escaping the ampersand with a
backslash (although being Windows this may require 1, 2, 4, or 8
backslashes...I always forget).

All 3 comments

Hi Adam,

You need to quote the value -- I don't know much about quoting semantics on
Windows, but I would guess that either " or ' would work -- try both! If
that still gives you trouble, maybe try escaping the ampersand with a
backslash (although being Windows this may require 1, 2, 4, or 8
backslashes...I always forget).

Thanks Jeff,

Rookie mistake sorry. Shows how often I work in cmd.

as alternative you can use the UI to validate and to load the json

Was this page helpful?
0 / 5 - 0 ratings