Skip to content

Instantly share code, notes, and snippets.

@vishalnayak
Last active December 11, 2018 16:15
Show Gist options
  • Save vishalnayak/b01c476d0c28f17d04fb4e733554ae57 to your computer and use it in GitHub Desktop.
Save vishalnayak/b01c476d0c28f17d04fb4e733554ae57 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -aex
vault auth enable approle
vault write auth/approle/role/role1 bind_secret_id=true period=60
secretID=$(vault write -format json -f auth/approle/role/role1/secret-id | jq -r '.data.secret_id')
roleID=$(vault read -format json auth/approle/role/role1/role-id | jq -r '.data.role_id')
vault write auth/approle/login role_id=$roleID secret_id=$secretID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment