diff --git a/bin/unwrap.sh b/bin/unwrap.sh new file mode 100755 index 0000000..9bc4bd2 --- /dev/null +++ b/bin/unwrap.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +# Usage: ./unwrap.sh +# This script unwraps a wrapped secret in HashiCorp Vault using the provided token. + +curl -s -X PUT \ + -H "X-Vault-Token: $1" \ + -H "X-Vault-Request: true" \ + -d 'null' \ + https://vault.koszewscy.waw.pl/v1/sys/wrapping/unwrap | jq '.data' diff --git a/bin/wrap.sh b/bin/wrap.sh new file mode 100755 index 0000000..1a602ba --- /dev/null +++ b/bin/wrap.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +DEFAULT_TTL="60" + +curl \ + --header "X-Vault-Token: $VAULT_TOKEN" \ + --header "X-Vault-Wrap-TTL: $DEFAULT_TTL" \ + --request POST \ + --data "$1" \ + $VAULT_ADDR/v1/sys/wrapping/wrap | jq \ No newline at end of file