Last active
November 25, 2020 10:43
-
-
Save anakaiti/7f8ce083ea12c135b27a58e183fd9640 to your computer and use it in GitHub Desktop.
fish shell hashicorp vault helpers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function vault-edit --argument key | |
set file (mktemp --suffix=.json) | |
vault read -format=json $key | jq '.data' > $file | |
$EDITOR $file | |
vault write $key @$file | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function vdb --argument role | |
set res (vault read -format=json database/creds/$role) | |
echo $res | jq '.data' | |
read --prompt-str='[Enter] to end session' null | |
vault lease revoke (echo $res | jq -r '.lease_id') | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function vsh | |
vault ssh -role=sre -mode ca $argv; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment