SecurityVault Associate

HashiCorp Vault: Secrets Management, Encryption, and Dynamic Credentials

Hardcoded secrets — database passwords in config files, API keys in environment variables, SSH keys checked into Git — are among the most common root causes of breaches. HashiCorp Vault solves this by centralising secrets management, providing dynamic short-lived credentials, and enforcing fine-grained access control. The Vault Associate certification tests whether you understand Vault's architecture, authentication methods, secrets engines, policies, and encryption capabilities well enough to deploy and operate Vault in production.

12 min
4 sections · 10 exam key points

Vault Architecture and Core Concepts

Vault runs as a server process with a client-server model — clients authenticate and request secrets via the Vault API (HTTPS). Architecture components: Storage Backend (where Vault persists encrypted data — Integrated Raft storage recommended for HA, also supports Consul, S3, Azure, GCS), Barrier (encryption layer — all data written to storage is AES-256-GCM encrypted with the encryption key), Unsealing (Vault starts sealed — must be unsealed with Shamir key shares or auto-unseal from a cloud KMS before it can serve requests), Active and Standby nodes (Vault Enterprise HA: one active node handles requests, standbys forward requests to active and can serve reads in performance standby mode). Initialisation: vault operator init generates the root token and unseal keys (key shares) — distribute shares to different people (5-of-7 threshold is common practice), store securely. Seal/unseal: vault operator seal locks Vault immediately (emergency shutdown), vault operator unseal requires threshold number of key holders or auto-unseal config.

Authentication Methods

Vault must know who is asking before granting access. Auth methods map external identity to Vault policies. Token auth: every authenticated identity in Vault has a token — tokens have TTLs, policies attached, and an accessor (reference without the secret). AppRole: designed for machine-to-machine auth — the application knows a RoleID (public) and retrieves a SecretID (short-lived, one-time-use) to authenticate and get a token. This separates the two credentials across deployment pipelines so no single person or system knows both. Cloud provider auth: AWS IAM auth (Vault validates the AWS caller identity — works in EC2, Lambda, ECS with IAM roles — no static credentials), Azure managed identity auth, GCP service account auth — preferred for cloud workloads. Kubernetes auth: Vault validates the Kubernetes service account JWT against the Kubernetes API — each pod authenticates with its service account token, gets a Vault token with appropriate policies. LDAP/OIDC: human user authentication via corporate directory or identity provider.

Secrets Engines: Static and Dynamic

Secrets engines are the plugins that manage specific types of secrets. KV (Key-Value) secrets engine: KV v1 (simple key-value, no versioning), KV v2 (versioned — keeps configurable number of previous versions, soft delete, metadata). Use KV for static secrets that do not change frequently. Dynamic secrets are Vault's superpower: instead of storing long-lived credentials, Vault generates short-lived credentials on demand. Database secrets engine: Vault connects to PostgreSQL, MySQL, MongoDB, Oracle, and more — when an application requests credentials, Vault creates a new database user with a configurable TTL and returns the credentials. When the lease expires, Vault automatically revokes the user. AWS secrets engine: generates temporary AWS IAM credentials or STS AssumeRole tokens with a defined TTL — no long-lived AWS access keys. PKI secrets engine: issues X.509 certificates on demand — set short TTLs (24 hours) to reduce risk from certificate compromise, auto-renewal in apps using Vault Agent or cert-manager. SSH secrets engine: either CA signing (sign short-lived SSH certificates for hosts and users) or OTP (one-time passwords — no SSH key management).

Policies, Leases, and Access Control

Vault policies control what an authenticated identity can do. Policies are written in HCL or JSON and reference paths with capability lists: capabilities = ['read', 'list'] grants read and list on a path, create and update grant write operations, delete grants deletion, sudo allows administrative operations on root-protected paths. Policy assignment: policies are attached to auth method roles, not directly to users — when a user or application authenticates via AppRole, Kubernetes, or AWS auth, Vault looks up the role's configured policies and creates a token with those policies. Deny-by-default: if no policy grants access to a path, access is denied — you do not need explicit deny statements. Leases: every dynamic secret has a lease — a TTL after which Vault automatically revokes it. Applications can renew leases before expiry. Operators can revoke a lease immediately (incident response: leak detected — revoke the specific lease). Vault Agent: sidecar or daemon that handles authentication, lease renewal, and template rendering — applications never see Vault tokens, just the rendered secret files.

Key exam facts — Vault Associate

  • Vault starts sealed — must unseal with key shares (Shamir) or cloud KMS auto-unseal
  • AppRole: RoleID (public) + SecretID (short-lived, one-time) — separate via deployment pipeline
  • Dynamic secrets: generated on demand with TTL — automatically revoked at expiry
  • KV v2: versioned key-value store — configurable version history, soft delete, metadata
  • PKI secrets engine: issues short-lived X.509 certificates on demand
  • Database secrets engine: creates temporary database users — auto-revoked at lease expiry
  • Vault policies: deny-by-default — only explicitly granted capabilities are allowed
  • Vault Agent handles authentication and lease renewal — apps get rendered files, not tokens
  • AWS IAM auth method eliminates static AWS credentials in cloud workloads
  • Kubernetes auth validates pod service account JWT — each pod authenticates per service account

Common exam traps

Vault is just a more complicated way to store secrets in a database

Vault provides dynamic secrets, automatic credential rotation, fine-grained access policies, encryption as a service, and audit logging — capabilities that go far beyond a secrets database. The dynamic secrets feature alone eliminates entire categories of credential sprawl.

Vault's KV engine is the most important feature

KV is a convenience for static secrets. Vault's unique value comes from dynamic secrets engines (database, AWS, PKI) that generate and revoke credentials automatically — eliminating long-lived credentials from the environment entirely.

Vault is only for large enterprises

Vault open source is free and widely used by startups and individual developers. The paid Vault Enterprise adds HA clustering, disaster recovery replication, and namespace multi-tenancy — but the core secrets management capability is available to everyone.

Practice this topic

Test yourself on HashiCorp Vault

JT Exams routes you to questions in your exact weak areas — automatically, after every session.

No credit card · Cancel anytime

Related certification topics