Last active
January 17, 2023 21:15
-
-
Save konrness/382deee4b127290dfe94778654fd22ea to your computer and use it in GitHub Desktop.
Example of Querying the Thycotic Secret Server via Harness Custom Secret Manager script
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
access_token=$(curl -s --location --request POST 'https://<+secretManager.environmentVariables.hostname>/oauth2/token' \ | |
--header 'Content-Type: application/x-www-form-urlencoded' \ | |
--data-urlencode 'username=<+secrets.getValue("thycoticUsername")>' \ | |
--data-urlencode 'password=<+secrets.getValue("thycoticPassword")>' \ | |
--data-urlencode 'grant_type=password' | jq -r '.access_token') | |
secret=$(curl -s --location --request GET 'https://<+secretManager.environmentVariables.hostname>/api/v2/secrets/<+secretManager.environmentVariables.key>' \ | |
--header "Authorization: Bearer $access_token" | jq -r '.items[] | select(.isPassword == true) | .itemValue') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment