Cubbyhole is a built-in Vault secrets engine that gives every token its own private namespace. When the token is revoked, the contents disappear, making it a great fit for short-lived secret storage and handoff.
This article covers how Cubbyhole works, its lifecycle, how it pairs with response wrapping, hands-on workflows, operational constraints, and the gotchas commonly tested on the exam.
Cubbyhole is a secrets engine that ships with Vault by default. It gives each access token its own dedicated storage area. Values written by one token can only be read by that same token. There is no way to grant access from another token or via policy delegation.
The API is simple, with no versioning or metadata management. TTL is not attached to the secret itself; it follows the lifecycle of the associated token. When the token expires or is revoked, the Cubbyhole data is automatically purged.
| Aspect | Cubbyhole | KV v2 | Response Wrapping |
|---|---|---|---|
| Access scope | Token-only (same token only) | Shareable via policy | Holder of the wrapping token only (one-time) |
| Retention | While the token lives | Configurable (versions can be kept or deleted) | Within wrap-ttl (destroyed immediately on unwrap) |
| Versioning | None | Yes | Temporarily stores the target response (the actual data lives in the source engine) |
| Ease of sharing | Not possible (intentionally closed) | Possible (depends on policy design) | Ideal for secure one-way handoff |
| Primary use | Bootstrapping / temporary storage | Long-term key-value management | Secure delivery of secrets |
| When data is removed | On token expiry or revocation | Explicit delete, TTL, or versioning rules | On unwrap or wrap-ttl expiry |
Basic CLI operations
vault write cubbyhole/bootstrap token=child-abc note="startup"
vault read cubbyhole/bootstrap
vault delete cubbyhole/bootstrapThe availability of Cubbyhole data tracks the associated token, not the stored entry. Renewing the token preserves the data, while revoking it wipes the data immediately. This prevents secrets from being left behind.
Pay attention to the parent-child token relationship. Child tokens have their own Cubbyhole, isolated from the parent. When parent revocation cascades to children, the child tokens are invalidated too, and their Cubbyhole contents become inaccessible.
Token renewal/revocation and Cubbyhole behavior (CLI example)
# Issue a token (example)
vault token create -ttl=1h -policy=default -format=json | jq -r .auth.client_token > parent.token
# Issue a child token (within the parent's rights)
VAULT_TOKEN=$(cat parent.token) vault token create -ttl=15m -format=json | jq -r .auth.client_token > child.token
# Write to the cubbyhole as the child
VAULT_TOKEN=$(cat child.token) vault write cubbyhole/boot key=value
# Revoking the parent also invalidates its children, cutting off access
vault token revoke $(cat parent.token)
# Reads with child.token are expected to fail from here on
VAULT_TOKEN=$(cat child.token) vault read cubbyhole/bootCubbyhole shines for bootstrapping: a freshly started process uses a least-privilege child token to receive temporary config or a follow-on retrieval token. The distributor writes to a location only the target process's token can see, and the process retrieves and discards it right after startup. That pattern is safe.
Direct Cubbyhole reads and writes are NOT one-time. If you need to guarantee single-use behavior, use response wrapping (covered below).
Temporary storage via CLI / HTTP API
# CLI: write and read with the child token
VAULT_TOKEN=$CHILD_TOKEN vault write cubbyhole/config db_user=app db_pass=s3cr3t
VAULT_TOKEN=$CHILD_TOKEN vault read cubbyhole/config
# HTTP API: write
curl \
-H "X-Vault-Token: $CHILD_TOKEN" \
-H "Content-Type: application/json" \
-X POST \
-d '{"db_user":"app","db_pass":"s3cr3t"}' \
$VAULT_ADDR/v1/cubbyhole/config
# HTTP API: read
curl -H "X-Vault-Token: $CHILD_TOKEN" $VAULT_ADDR/v1/cubbyhole/configResponse wrapping seals a Vault response inside a wrapping token so it can be retrieved exactly once. Internally, Cubbyhole is used, and if the token is not unwrapped within wrap-ttl, the contents are automatically destroyed. This lets you ship only a token instead of the secret itself.
The producer attaches -wrap-ttl to any read operation, and the consumer calls vault unwrap or POSTs to /sys/wrapping/unwrap with the wrapping token. On a successful unwrap, the contents are returned and the token is invalidated.
Response wrapping handoff
Response wrapping example
# Wrap when reading secret data (a KV v2 secret, for example)
# The point is that whatever the engine, the response becomes a wrapping token
vault kv get -wrap-ttl=60s kv/app/api
# Output: wrapping_token=... (usable exactly once)
# Receiver: unwrap to get the contents (the token is then dead)
VAULT_TOKEN=$WRAPPING_TOKEN vault unwrap
# The same over the HTTP API
curl -s -H "X-Vault-Token: $VAULT_TOKEN" \
"$VAULT_ADDR/v1/kv/data/app/api?wrap_ttl=60s"
# auth.client_token in the response JSON is the wrapping token
# unwrap
curl -s -H "X-Vault-Token: $WRAPPING_TOKEN" \
-X POST "$VAULT_ADDR/v1/sys/wrapping/unwrap"Cubbyhole is ideal for lightweight temporary storage but unsuitable for large binaries or long-lived config files. Size limits depend on the underlying storage and operational policy, so as a rule, target small secrets and tokens only.
If audit logging is enabled, access under cubbyhole/ is also recorded (the data itself is masked). This is useful for leak detection and monitoring how wrapping tokens are handled.
Make cleanup explicit
# Delete it once you have taken it out
VAULT_TOKEN=$CHILD_TOKEN vault delete cubbyhole/config
# Revoke the child token once it has served its purpose
vault token revoke $CHILD_TOKENCubbyhole is private storage attached to a token. It is not designed to be shared with others via policy. Do not confuse it with the sharing and versioning model of KV v2.
Response wrapping is the mechanism that delivers one-time retrieval, and you should remember that it uses Cubbyhole internally. Contents are destroyed on wrap-ttl expiry or on a successful unwrap.
One-liner sanity check
# Only this token should be able to read its cubbyhole
VAULT_TOKEN=$OTHER_TOKEN vault read cubbyhole/boot # -> expected to fail with a permission errorAssociate
Question 1
Which statement about Vault's Cubbyhole is correct? Assume Associate level.
Correct answer: A
Cubbyhole is isolated per token, and only the same token can read or write its contents. Token revocation or expiry makes the contents unreachable. You cannot share another token's Cubbyhole via ACL, and there is no versioning. Response wrapping internally uses Cubbyhole to deliver one-time retrieval.
Can I set a TTL directly on Cubbyhole?
No. The lifetime of a Cubbyhole entry follows the lifecycle of the associated token. To control expiration, use the token TTL/Max TTL/renewal, or use wrap-ttl with response wrapping.
Can Cubbyhole be disabled or remounted at a different path?
Cubbyhole ships as a built-in engine in Vault and is used at the default cubbyhole/ path. It is not designed to be freely disabled or remounted like a typical secrets engine.
How can I guarantee single-use, one-time delivery?
Use response wrapping. Add -wrap-ttl to wrap the response, and the recipient calls unwrap. On a successful unwrap or TTL expiry, the contents are destroyed, guaranteeing one-time retrieval.
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...