Interview Prep/DevSecOps/Secrets and Identity Management

How would you set up HashiCorp Vault so Kubernetes workloads authenticate without any static token?

AdvancedScenarioSecrets and Identity Management
Answer

Situation read → The bootstrap secret problem: the app needs a credential to fetch credentials. Kubernetes auth uses the service account token as identity.

What I'd do →

  1. Enable the auth method:
vault auth enable kubernetes
vault write auth/kubernetes/config kubernetes_host=https://$K8S_API:443
vault write auth/kubernetes/role/orders \
  bound_service_account_names=orders-sa \
  bound_service_account_namespaces=orders \
  policies=orders-read ttl=1h
  1. Write a narrow policy: path "kv/data/orders/*" { capabilities = ["read"] }.
  2. Use the Vault Agent injector or Vault Secrets Operator to deliver secrets to pods.
  3. Use projected, audience-bound service account tokens, and enable Vault audit devices.

Why → Identity comes from the platform; nothing long-lived is ever written into a manifest.

Interview tip → Name it "secret zero" and explain how platform identity solves it.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Secrets and Identity Management