Skip to content

Instantly share code, notes, and snippets.

@gitrgoliveira
Last active January 17, 2022 16:06
Show Gist options
  • Save gitrgoliveira/1fd5d1d5f68371a76cf8a3e4f4eac8f3 to your computer and use it in GitHub Desktop.
Save gitrgoliveira/1fd5d1d5f68371a76cf8a3e4f4eac8f3 to your computer and use it in GitHub Desktop.
vault setup bash
vault auth enable jwt
vault write auth/jwt/config \
oidc_discovery_url="https://token.actions.githubusercontent.com" \
bound_issuer="https://token.actions.githubusercontent.com" \
default_role="demo"
# "user_claim": "workflow" defines the entity alias.
vault write auth/jwt/role/demo -<<EOF
{
"role_type": "jwt",
"bound_subject": "",
"bound_claims": {
"sub": ["repo:gitrgoliveira/vault-action-exampleapp:ref:refs/*"]
},
"bound_claims_type": "glob",
"bound_audiences": "https://github.com/gitrgoliveira",
"user_claim": "workflow",
"policies": "vault-action",
"ttl": "1h"
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment