Vault splits the master key that encrypts its storage using Shamir secret sharing, so the key can only be reconstructed once a quorum of shards is collected. This is what we call key sharding.
This article walks through N-of-M threshold design, manual vs. auto-unseal, and the difference between rekey and recovery keys, with command examples and operational guardrails. The summary is tuned for Associate / Ops level exam questions.
Shamir secret sharing splits one secret into M shards in such a way that the secret can only be reconstructed when N or more shards are collected. Vault leverages this property: it never stores the master key directly and instead reconstructs it at unseal time from a threshold of shards.
When Vault starts up, it is sealed by default and the data in storage sits behind an encrypted barrier. Once enough unseal keys (shards) are supplied to meet the threshold, the master key is reconstructed and Vault unseals. With auto-unseal, an HSM or cloud KMS performs this decryption automatically, and what gets distributed via Shamir is the recovery key instead.
3-of-5 Shamir and the Vault seal/unseal flow
Example: Check the current seal status
vault status
# Key Value
# Seal Type shamir | awskms | gcpckms | hsm ...
# Sealed true/false
# Unseal Progress 0/3, and so onChoose the shard count M and the threshold N to balance business continuity against internal controls. Too many shards increases distribution overhead and leak risk; too high a threshold risks not being able to unseal during an incident. M=5-7 with N=3 is a reasonable starting point.
Even with auto-unseal, define how recovery keys are stored in case of disaster recovery or lost root tokens. In practice, encrypt each shard individually with PGP and separate hot/cold lines and audit roles.
| Item | Unseal Key (Shamir) | Recovery Key (Shamir) | Auto-Unseal (KMS/HSM) |
|---|---|---|---|
| Primary use | Reconstruct master key during manual unseal | Recovery operations (generate-root, rekey, etc.) | Automatic unseal at startup |
| When generated | Generated when auto-unseal is not in use | Generated when auto-unseal is in use | Used whenever auto-unseal is enabled |
| Who is required | A threshold number of holders, supplied in person or via secure channel | A threshold number of holders (usually only in emergencies) | Whoever controls the external KMS/HSM, plus the Vault server itself |
| Benefits | Full control with no external dependencies | Improves recoverability if the KMS fails | Operational automation and short recovery time |
| Caveats | Human-dependent — recovery takes time | Not used day-to-day, so storage and procedures tend to get forgotten | Hinges on solid IAM and availability design for the KMS/HSM |
Example: Initialization options aligned with your threshold design
vault operator init \
-key-shares=5 \
-key-threshold=3 \
-pgp-keys="key1.asc,key2.asc,key3.asc,key4.asc,key5.asc"
# Each emitted shard is encrypted individually with the matching PGP public keyDuring initialization, Vault builds the encrypted barrier in its backend and generates Shamir-split keys plus an initial root token. With auto-unseal, the output is recovery keys rather than unseal keys.
Unsealing requires entering keys repeatedly until the threshold is met. In a cluster, every node must be unsealed individually (auto-unseal excepted).
Example commands: Initialization and unseal
# Initialize (manual unseal configuration)
vault operator init -key-shares=5 -key-threshold=3 > init.out
# Distribute unseal keys 1..5 from the output securely
# Unseal (enter the threshold number of keys in turn)
vault operator unseal <Unseal_Key_1>
vault operator unseal <Unseal_Key_2>
vault operator unseal <Unseal_Key_3>
# Check the status
vault status
# With auto-unseal, initialization prints recovery keys instead
# Normally you never unseal by hand (it is automatic). The keys are only for recovery operationsUse rekey whenever you need to change the shard recipients or threshold mid-operation. Rekey requires a threshold-meeting set of current keys and produces a brand-new set of shards. If you use PGP, supply new PGP keys to re-encrypt the output.
If the root token is lost, use generate-root. With auto-unseal, you must meet the recovery key threshold instead.
Example commands: Rekey and root token generation
# Rekey the unseal keys (manual unseal configuration)
vault operator rekey -init -key-shares=7 -key-threshold=4
# Keep the nonce from the output and supply the threshold number of current keys to approve
vault operator rekey -nonce=<nonce> <Unseal_Key_1>
...
# Rekeying the recovery keys with auto-unseal
vault operator rekey -target=recovery -init -key-shares=5 -key-threshold=3
vault operator rekey -target=recovery -nonce=<nonce> <Recovery_Key_1>
...
# Regenerating the root token (generate-root)
vault operator generate-root -init
# Keep the OTP/nonce from the output and supply the threshold number of keys
vault operator generate-root -nonce=<nonce> <Key_Share_1>
...
# When it completes, the new root token is printed (or decoded with the OTP)For Associate / Ops, it is enough to clearly distinguish Shamir N-of-M, unseal keys vs. recovery keys, the benefits and prerequisites of auto-unseal, and when to use rekey vs. generate-root.
In production, what makes or breaks key sharding is separation of duties, diversifying key media and storage locations, enabling auditing, and rehearsing disaster recovery.
Checklist example: Auditing and safe handoff
# Enable auditing (file example)
vault audit enable file file_path=/var/log/vault_audit.log
# Response wrapping (handing over an initial secret)
VAULT_TOKEN=<admin> vault kv get -wrap-ttl=5m secret/bootstrap
# The receiver only ever gets the wrapping_token, and unwraps it
vault unwrap <wrapping_token>Associate / Ops
Question 1
You operate Vault with manual unseal, initialized with -key-shares=5 and -key-threshold=3. You want to recover quickly after a planned restart. Which is the correct action?
Correct answer: A
Manual unseal only requires entering N unseal keys (3 in this case) one after another. Rekey regenerates keys and is not a required restart step. Logging in with an admin token does not unseal. Recovery keys are for emergency operations under auto-unseal.
Is Shamir still used when auto-unseal is configured?
Yes. KMS/HSM handles the routine unseal, but Shamir-split Recovery keys are still generated for emergency recovery, generate-root, and rekey operations. You do not need to enter them during normal startup.
Can the threshold N be changed later?
Yes. Run vault operator rekey with new -key-shares and -key-threshold values. You must provide enough current keys to meet the existing threshold, after which the old key set is swapped out for the new one.
Does every node in a cluster need to be unsealed?
With manual unseal, yes — every node must be unsealed individually. With auto-unseal, an external KMS/HSM decrypts at node startup, so every node is unsealed automatically.
Practice with certification-focused question sets
Try free questionsNicheeLab Editorial Team
NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.
Vault Core Concepts: Sealed/Unsealed, Auth, Secrets (2026)
Vault fundamentals — sealed/unsealed state, auth methods, se...
Vault Operations Professional (VOP-003): Complete Guide (2026)
Pass the Vault Operations Professional exam — enterprise pat...
Vault Path-Based Routing: API URL Structure (2026)
How Vault's path-based routing works — mount points, sub-pat...
Vault Tokens: Auth Token Mechanics (2026)
Token fundamentals — service vs. batch tokens, accessor, ren...
Vault Token Types: Service, Batch, Periodic (2026)
Service vs. batch tokens compared — performance, ACL behavio...