How to call Vault secrets in Bash script

4,087 views
Skip to first unread message

deking

unread,
Feb 27, 2019, 3:34:11 AM2/27/19
to Vault
Hi,
How can we use HashiCorp Vault secrets in bash scripts, is there examples that i am not aware of? If not, can someone please share ?
What we are trying to accomplish :

• Run a script to grab the existing token from creds file

• Revoke it in vault

• Generate a new token with the same policy

• Write it to a credentials file

• Push new credentials file to S3

Becca Petrin

unread,
Feb 27, 2019, 11:07:12 AM2/27/19
to Vault
Hi Deking,

One way to do it would be to use the Vault CLI within the script. To do that, you'd need to make sure you have the Vault binary in the environment where you're running the script, but you could do something like automating pulling it at the start of the script.

Another option would be to use the raw Vault API for those steps, which wouldn't require a binary.

Warmly,
Becca
Reply all
Reply to author
Forward
0 new messages