You need Vault secrets in workflows without a static Vault token. How?
AdvancedScenarioSecrets, OIDC & Environments
Answer
Situation read → Vault supports JWT/OIDC auth with GitHub's issuer.
What I'd do →
- Vault:
vault auth enable jwt, configureoidc_discovery_url=https://token.actions.githubusercontent.com,bound_issuerthe same. - Role with
bound_claimsonrepositoryandenvironment,user_claim=actor, short TTL, and a policy forsecret/data/shack-api/prod/*. - Workflow:
- uses: hashicorp/vault-action@v3 with: url: https://vault.example.com method: jwt role: shack-api-prod secrets: secret/data/shack-api/prod db_password | DB_PASSWORD
Why → Same keyless model as cloud OIDC; Vault becomes the single source of truth.
Interview tip → Mention binding claims to environment so only approved jobs get prod secrets.
More on Secrets, OIDC & Environments
You find AWS access keys stored as repo secrets in 25 repos. Plan the migration.IntermediateA developer asks to print a secret in the log "just once" to debug. What do you do instead?BeginnerStaging and prod need different database URLs and different AWS roles, using one workflow. How?BeginnerSecurity requires two people for prod deploys: the author cannot approve. Configure it.BeginnerWrite the AWS trust policy for a role used only by the prod deploy job of one repo.IntermediatePR workflows need read-only AWS access for `terraform plan`, including from same-repo branches. How do you set trust?Advanced