-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use minimal Vault permissions in integration test
- Loading branch information
Showing
4 changed files
with
55 additions
and
11 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/ash | ||
set -o errexit | ||
set -o nounset | ||
set -o noglob | ||
set -o pipefail | ||
|
||
# Required env variables | ||
: "$VAULT_ADDR" | ||
: "$VAULT_TOKEN" | ||
: "$HVGHA_VAULT_IMPORT_TOKEN" | ||
: "$HVGHA_VAULT_SIGN_TOKEN" | ||
|
||
vault secrets enable transit | ||
|
||
cat <<EOF | | ||
path "transit/wrapping_key" { | ||
capabilities = ["read"] | ||
} | ||
path "transit/keys/+/import" { | ||
capabilities = ["update"] | ||
} | ||
EOF | ||
vault policy write import-key - | ||
|
||
cat <<EOF | | ||
path "transit/sign/+" { | ||
capabilities = ["update"] | ||
} | ||
EOF | ||
vault policy write sign-token - | ||
|
||
vault token create -no-default-policy -policy=import-key -id="$HVGHA_VAULT_IMPORT_TOKEN" -field=token | ||
vault token create -no-default-policy -policy=sign-token -id="$HVGHA_VAULT_SIGN_TOKEN" -field=token |
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