Skip to main content
In this tutorial, you’ll learn how to leverage Vault’s Cubbyhole Secrets Engine for per-token data isolation and use Response Wrapping for secure, one-time delivery of secrets. We’ll cover:
  • Writing and reading token-specific cubbyhole data
  • Proving isolation between tokens
  • Populating and protecting a KV secret
  • Generating and unwrapping a wrapped secret both via CLI and UI

Prerequisites

  • Vault 1.10.0 Enterprise installed locally (initialized & unsealed)
  • Environment variable: VAULT_ADDR=http://127.0.0.1:8200
  • Familiarity with basic Vault concepts (Vault Overview)

1. Verify Vault Status

Expected output:

2. Authenticate as Root

Success! You are now authenticated as the root user.

3. Create an Unprivileged Token

Create a token with only the default policy:
Output:
Save the token value and log in with it:
Success! You are now authenticated with limited permissions.

4. Working with Cubbyhole

Every token receives a private cubbyhole path. Only the token owner can write/read its own cubbyhole.

4.1 Write to Cubbyhole

4.2 Read from Cubbyhole

4.3 Proving Token Isolation

Cubbyhole paths are isolated per token. No token can access another token’s cubbyhole.
  1. Switch back to root
  2. Attempt to read the unprivileged token’s cubbyhole
    Output: No value found at cubbyhole/training
  3. Confirm unprivileged token can still read its own data

5. KV Secrets Engine & Access Control

Next, we’ll show how an unprivileged token is denied access to KV secrets written by root.

5.1 As Root: Write a KV Secret

5.2 As Root: Read the KV Secret

5.3 Denied Access for Unprivileged Token

6. Response Wrapping

Response wrapping provides a one-time-use, time-limited wrapping token for secure secret transfer.

6.1 Generate a Wrapping Token

As root, request a 60-minute wrapped response:

6.2 Inspect the Wrapping Token

6.3 Unwrap as Unprivileged User

  1. Log in with the limited token:
  2. Unwrap the secret:

6.4 TTL & One-Time Use Demonstration

Or with 5-minute TTL:

7. UI Demonstration

In the Vault UI, a privileged user can:
  1. Navigate to Secrets → KV
  2. Select training and choose Wrap
  3. Copy the wrapping token and share via secure channels
An unprivileged user then goes to Tools → Unwrap Secret, pastes the token, and retrieves the secret.
The image shows a web interface for HashiCorp Vault, displaying a secret with a key-value pair under the "training" section. A notification at the bottom indicates a secret was successfully wrapped.

Summary

  • Stored token-specific data in Cubbyhole
  • Verified strict isolation between tokens
  • Secured KV secrets and demonstrated access denial
  • Generated, inspected, and unwrapped response-wrapping tokens
  • Showed one-time-use and TTL behaviors via CLI & UI
By following this guide, you can securely share secrets without exposing them directly over the network.

References

Watch Video

Practice Lab