Interview Prep/GitHub Actions/Secrets, OIDC & Environments

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 →

  1. Vault: vault auth enable jwt, configure oidc_discovery_url=https://token.actions.githubusercontent.com, bound_issuer the same.
  2. Role with bound_claims on repository and environment, user_claim=actor, short TTL, and a policy for secret/data/shack-api/prod/*.
  3. 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.

All GitHub Actions questions Roadmap: GitHub Actions

More on Secrets, OIDC & Environments