Skip to content

Instantly share code, notes, and snippets.

@3ng1n33r
Created November 11, 2023 12:25
Show Gist options
  • Save 3ng1n33r/e5daea627b49d7306429c8672d4c1daa to your computer and use it in GitHub Desktop.
Save 3ng1n33r/e5daea627b49d7306429c8672d4c1daa to your computer and use it in GitHub Desktop.
vault write auth/jwt/role/myproject-staging - <<EOF
{
"role_type": "jwt",
"policies": ["myproject-staging"],
"token_explicit_max_ttl": 60,
"user_claim": "user_email",
"bound_claims": {
"project_id": "51459829",
"ref": "staging*",
"ref_type": "branch"
}
}
EOF
vault write auth/jwt/role/myproject-production - <<EOF
{
"role_type": "jwt",
"policies": ["myproject-production"],
"token_explicit_max_ttl": 60,
"user_claim": "user_email",
"bound_claims_type": "glob",
"bound_claims": {
"project_id": "51459829",
"ref_protected": "true",
"ref_type": "branch",
"ref": "main"
}
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment