Difficulty: beginner
Estimated Time: 5 minutes


HashiCorp Vault's secret engines are components responsible for managing secrets:

  • Secrets are pieces of sensitive information that can be used to access infrastructure, resources, data, etc.
  • Some secret engines simply store and read data
    • Like encrypted Redis/Memcached
  • Some connect to other services and generate dynamic credentials on-demand
  • Others provide encryption as a service (EaaS), TOTP generation, certificates, etc.

This scenario demonstrates the cubbyhole secret engine.

Cubbyhole Secret Engine:

  • Used to store arbitrary secrets
    • Enabled by default at the cubbyhole/ path
  • Its lifetime is linked to the token used to write the data
    • No concept of a time-to-live (TTL) or refresh interval for values in cubbyhole
    • Even the root token cannot read the data if it wasn't written by the root
  • Cubbyhole secret engine cannot be disabled, moved or enabled multiple times

This lab demonstrates the following:

  • Write secrets in Cubbyhole
  • Create a new token for apps which was wrapped
  • Unwrap the wrapped token and tested its permissions

You learned the vault CLI commands to interact with the cubbyhole secret engines.

  • Wrote secrets in Cubbyhole
  • Created a new token for apps which was wrapped
  • Unwrapped the wrapped token and tested its permissions


Vault Secret Engines - Cubbyhole

Step 1 of 4

Getting Started

Enter the following command to start the Vault server in development mode.

Click on the command () will automatically copy it into the terminal and execute it.

vault server -dev -dev-root-token-id="root"

Scroll up the Terminal to locate the following output:

==> Vault server configuration:

             Api Address:
                     Cgo: disabled
         Cluster Address:
              Listener 1: tcp (addr: "", cluster address: "", tls: "disabled")
               Log Level: info
                   Mlock: supported: true, enabled: false
                 Storage: inmem
                 Version: Vault v1.0.0
             Version Sha: c19cef14891751a23eaa9b41fd456d1f99e7e856

WARNING! dev mode is enabled! In this mode, Vault runs entirely in-memory
and starts unsealed with a single unseal key. The root token is already
authenticated to the CLI, so you can immediately begin using Vault.

When Vault is running in development mode, it runs entirely in-memory that the data does not get persisted. This build-in, pre-configured server is useful for local development, testing and exploration.

Login with root token

Click the + next to the opened Terminal, and select Open New Terminal.

New Terminal

In the Terminal 2, set the VAULT_ADDR environment variable:

export VAULT_ADDR=''

Login with the generated root token.

vault login root

Now, you are logged in as a root and ready to play!