CI/CD & GitHub Actions (50 Qs)•Part 3: Enterprise Scale, Compliance & Production Hardening (Senior / Staff)
Zero-Trust Access with HashiCorp Vault Integration in GitHub Actions pipelines.
senior LevelCode ExampleState ManagementPipesCI/CD & DevOps
In Simple Words:
Instead of storing static long-lived credentials in GitHub Secrets, GitHub Actions exchanges its ephemeral JWT token (id-token: write) with HashiCorp Vault via OIDC to retrieve dynamic, short-lived credentials (e.g. database passwords valid for 1 hour).
yaml
- name: Retrieve Secrets from Vault
uses: hashicorp/vault-action@v3
with:
url: https://vault.corp.internal:8200
role: github-actions-deployer
method: jwt
secrets: |
secret/data/production/db password | DB_PASSWORD ;
secret/data/production/stripe api_key | STRIPE_KEY