Hand over a secret with response wrapping

Pass a secret as a single-use wrapping token; if unwrap fails, someone has already read it

T=$(vault kv get -wrap-ttl=60s -field=wrapping_token -mount=secret app); vault unwrap $T

tool
vault31 commands
tags
vaultsecretssecuritytroubleshooting

More vault commands

  • vault token capabilities database/creds/readonly

    Show what the current token can do on a path; a quick way to debug policies

  • vault lease revoke -prefix database/creds/readonly

    Revoke all leases under a prefix to kill leaked dynamic DB credentials right away

  • vault login <token>

    Log in to Vault with a token

  • vault write auth/approle/login role_id=<role> secret_id=<secret>

    Log in with the AppRole auth method

  • vault kv get -mount=secret path/to/secret

    Read a KV v2 secret; add -format=json for scripts

all 31 vault commands