Vault Deployment Architecture · Topic 2 of 3

Storage Backends and Unsealing

Vault Associate 003: what the storage backend holds, integrated storage versus Consul, Shamir key shares, auto unseal and when recovery keys are used.

  • 4 min
In a nutshell
  • The storage backend holds only encrypted data and is outside the barrier.
  • A sealed Vault can reach storage but cannot decrypt it.
  • Integrated storage is built in, uses Raft and is HashiCorp supported. Consul is an external option.

What it is

The storage backend is where Vault keeps its data durably, so the data survives restarts. Vault writes only encrypted data to it, because the barrier encrypts everything before it leaves Vault.

Unsealing is the step that lets a freshly started Vault decrypt that data. A Vault server always starts sealed: it can reach storage but cannot read what is in it.

Plaintextinside VaultBarrierencryptsStorage backendencrypted data only

How it works

What storage is for

The storage backend sits outside the barrier and is treated as untrusted. It holds the encrypted data, including the configuration of auth methods, secrets engines and audit devices.

Vault is configured with a storage stanza. The backend also decides whether high availability is possible, because HA needs a backend that supports it.

BackendNotes
Integrated storage (Raft)Built into Vault, recommended and supported by HashiCorp, no extra system to run, data on disk
ConsulExternal HashiCorp supported backend that needs its own dedicated Consul cluster, data in memory
Others (S3, DynamoDB, PostgreSQL and more)External systems you run, with limited or community support

Integrated storage supports high availability and Enterprise replication without a third-party system. It uses the Raft consensus protocol, so it needs a quorum: a majority of the nodes. Five nodes have a quorum of three and tolerate two failures.

storage "raft" {
  path    = "/opt/vault/data"
  node_id = "vault_1"
}
cluster_addr = "https://vault-1.example.com:8201"

The key hierarchy

Vault protects data in layers. The data is encrypted by a key that lives with it. That key is encrypted by a root key, and the root key is encrypted by the unseal key.

By default Vault splits the unseal key with Shamir's Secret Sharing. A threshold of the shares is needed to rebuild it.

vault operator init
vault operator init -key-shares=5 -key-threshold=3

The default is 5 key shares with a threshold of 3. Nobody needs to hold the whole key, so no single person can unseal Vault alone.

Unsealing and sealing

An operator supplies shares one at a time, in any order, even from different machines. Each node must be unsealed separately.

vault operator unseal
vault status

Sealing removes the root key from memory and needs a client with the root policy or sudo capability on sys/seal. After a restart the node is sealed again.

Vault startssealedShare 1Share 2Share 3threshold metUnsealedserves requests

Auto unseal

With auto unseal, a trusted cloud KMS, HSM or another Vault's transit engine holds the unseal responsibility. At startup Vault asks that service to decrypt the root key, so nobody types shares in.

Initialization then returns recovery keys instead of unseal keys. Their defaults are also 5 shares with a threshold of 3. They cannot unseal Vault if auto unseal fails, but operations that need a quorum, such as generating a root token, use them.

How the exam asks about this

  • "A server using Shamir restarted and now returns errors on every request." It is sealed and must be unsealed.
  • "A cluster uses a cloud KMS to unseal. What are recovery keys for?" Quorum operations such as generating a root token, not unsealing.
  • "How many shares and what threshold does vault operator init use by default?" 5 shares, threshold 3.

What to remember for the exam

  • The storage backend holds only encrypted data and is outside the barrier.
  • A sealed Vault can reach storage but cannot decrypt it.
  • Integrated storage is built in, uses Raft and is HashiCorp supported. Consul is an external option.
  • Shamir is the default seal. The defaults are 5 shares with a threshold of 3.
  • Every node must be unsealed, and sealing needs sudo on sys/seal.
  • With auto unseal you get recovery keys, and they are used instead of unseal keys for operations like generating a root token.
Watch out

Recovery keys cannot unseal Vault. If the auto unseal service or its keys are permanently lost, the cluster cannot be recovered, even from backups.

Common mistakes

Believing storage holds plaintext. The barrier encrypts data before it reaches storage, which is why the backend is untrusted. Anyone reading the storage directly sees only ciphertext.

Confusing unseal keys and recovery keys. Unseal keys come from a Shamir seal and open Vault. Recovery keys come from auto unseal and are used for quorum operations only.

Expecting one unseal to cover the cluster. In a multi-node cluster each node is unsealed on its own. Unsealing one node does not unseal the others.

Check yourself

  • What does a sealed Vault server still have access to?

    The physical storage backend. It cannot decrypt the data because it does not have the keys.

  • What are the default vault operator init values?

    5 key shares and a key threshold of 3. With auto unseal the recovery shares and threshold default to the same values.

  • When are recovery keys used?

    With auto unseal, for operations that need a quorum, such as generating a root token. They cannot unseal Vault.

Topic 2 of 3 in Vault Deployment Architecture

Test yourself on Vault Deployment Architecture

The full HashiCorp Vault Associate 003 question bank has 600 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by HashiCorp. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.