Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 36 ยท Getting Started

What Is HashiCorp Vault?

Understand what HashiCorp Vault is, what problems it solves and its main features: secrets, dynamic credentials, encryption as a service, identity and audit.

Every application needs secrets: database passwords, API keys, TLS certificates, encryption keys. HashiCorp Vault is a server whose whole job is to store, generate, hand out and protect those secrets, and to record who asked for what. Instead of pasting a password into a config file, an application proves its identity to Vault and receives the secret it is allowed to have, often a short-lived one that Vault creates on the spot.

In this lesson you will learn the problem Vault addresses, its main capabilities, and the vocabulary used in the rest of the course. You will also try a small model of the central idea: a central service that checks identity and policy before releasing a secret.

Vault cannot run on this site: it is a server program with its own storage and network listener. Commands in this course are shown read-only, and I never invent their output. The runnable examples are small Python models of the same ideas, clearly labelled as stand-ins.

The problem: secrets everywhere

Without a secrets manager, secrets end up in source code, environment files, chat messages, CI settings and wiki pages. Nobody knows who has a copy, nobody knows when one was last changed, and rotating a leaked password means hunting through every system. Vault answers these questions in one place:

  • Where are secrets stored? Encrypted, in Vault's storage backend.
  • Who can read them? Only identities that a policy allows.
  • For how long? Many secrets are leased and expire automatically.
  • Who read them? Every request is written to an audit log.

What Vault offers

Capability Meaning
Secure secret storage Arbitrary key/value secrets, encrypted before they touch disk.
Dynamic secrets Vault creates a database user or cloud credential on demand and revokes it after a lease.
Data encryption The Transit engine encrypts and decrypts your data without you holding the key.
Identity-based access Humans and machines log in with many methods and get a token carrying policies.
Leasing and renewal Every dynamic secret and token has a time to live (TTL) and can be revoked.
Auditing A detailed log of requests and responses, with sensitive values hashed.
flowchart LR
    App["Application"] -->|"1. authenticate"| V["Vault"]
    V -->|"2. token + policies"| App
    App -->|"3. request secret"| V
    V -->|"4. check policy, log to audit"| V
    V -->|"5. secret with lease"| App
    V --- S[("Encrypted storage")]

An application authenticates, receives a token, and uses that token to request secrets. Vault checks policy and writes an audit record each time.

Key vocabulary

  • Secret: anything sensitive: a password, key, certificate or token.
  • Secrets engine: a plugin mounted at a path that stores or generates secrets, such as kv, database or transit. See Secrets Engines Overview.
  • Auth method: a plugin that verifies identity, such as userpass, approle or kubernetes. See Auth Methods Overview.
  • Token: the credential Vault issues after login; almost every request carries one.
  • Policy: rules written in HCL that grant capabilities (read, create, update, delete, list) on paths.
  • Lease: a time-limited right to use a dynamic secret.
  • Seal / unseal: Vault starts sealed and cannot read its own data until it is unsealed. See Seal, Unseal and Shamir's Secret Sharing.

Everything in Vault is a path. secret/data/app/db is a path, auth/approle/login is a path, sys/health is a path. The CLI and the HTTP API are two ways to read and write paths.

Editions and where Vault runs

Vault is source-available under the Business Source License, with a paid Enterprise edition (namespaces, replication, Sentinel policy and more) and a managed service, HCP Vault. You can also run Vault yourself on VMs, bare metal or Kubernetes. This course focuses on the features every edition shares and flags the Enterprise-only ones. An open-source fork called OpenBao exists with a compatible API; most commands here carry over, but check its documentation for differences.

A policy-checking model

This stand-in is not Vault. It shows the central loop: log in, receive a token that carries policies, then ask for a path. Vault denies by default, so a path with no matching rule is refused.

Python A tiny model of identity, policy and secrets

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that the denied request is still audited. In real Vault the audit log holds the request path and metadata, while secret values are HMAC-hashed so that the log itself is not a secret store.

Python Why short-lived beats long-lived

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A leak discovered after 30 days exposes a static password for the full 30 days, but a one-hour lease for at most one hour. That is the argument for dynamic secrets, which you will build up to in the secrets engine lessons.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the main job of HashiCorp Vault?

    Vault is a secrets manager. It stores secrets, creates dynamic ones, encrypts data and audits access.
  2. 2. What does Vault do with a request for a path that no policy mentions?

    Vault policies are deny by default. A capability must be granted explicitly.
  3. 3. What is a lease?

    Dynamic secrets and tokens carry a TTL. When the lease ends or is revoked, the credential stops working.
  4. 4. Why are secret values hashed in the audit log?

    Vault HMACs sensitive values in audit entries, so you can correlate them without exposing them.

Summary

  • Vault is a central server that stores secrets, creates dynamic ones, encrypts data, checks identity and writes an audit trail.
  • Everything is a path, reached by CLI or HTTP API; secrets engines and auth methods are plugins mounted at paths.
  • Policies are deny by default; tokens carry the policies.
  • Short-lived, leased secrets reduce the damage of a leak.
  • Vault cannot run here, so examples are labelled stand-ins.

Next: The Secrets Problem and Secret Sprawl