Welcome to this tutorial on the Vault Transit Secrets Engine. In this guide, you’ll learn how to enable and configure the Transit engine, manage encryption keys, and perform encrypt, decrypt, and rewrap operations.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
Table of Contents
- Overview
- Verify Enabled Secrets Engines
- Enable the Transit Engine
- Create and Inspect an Encryption Key
- Rotate an Encryption Key
- Encrypt Data
- Rewrap Data After Rotation
- Decrypt Ciphertexts
- Enforce Minimum Decryption Version
- Conclusion
Overview
The Transit Secrets Engine provides cryptographic functions as a service. It allows you to offload encryption, decryption, key management, and more to Vault without storing raw data. Learn more in the official docs: Transit Secrets Engine.Verify Enabled Secrets Engines
First, check which secrets engines are active on your Vault dev server:| Path | Type | Description |
|---|---|---|
| cubbyhole/ | cubbyhole | per-token private secret storage |
| identity/ | identity | identity store |
| secret/ | kv (v2) | key/value secret storage |
| sys/ | system | system endpoints for control & debugging |
In Vault dev mode, the
cubbyhole/, identity/, secret/ (KV v2), and sys/ engines are enabled by default.Enable the Transit Engine
Enable the Transit engine at the default pathtransit/:
| Path | Type | Description |
|---|---|---|
| transit/ | transit | n/a |
Create and Inspect an Encryption Key
Create a new key namedtraining:
| Field | Value |
|---|---|
| name | training |
| type | aes256-gcm96 |
| latest_version | 1 |
| supports_encryption | true |
| supports_decryption | true |
Rotate an Encryption Key
Rotatetraining to generate a new version:
Encrypt Data
- Base64-encode your plaintext:
- Encrypt the encoded string:
ciphertext for later use.
Rewrap Data After Rotation
After rotating to version 3:Decrypt Ciphertexts
Decrypt version 2:Enforce Minimum Decryption Version
To block decryption of older ciphertext, setmin_decryption_version=3:
Any ciphertext with a version lower than the
min_decryption_version will be rejected.Conclusion
In this lesson, you have:- Enabled and configured the Transit Secrets Engine
- Created, rotated, and inspected encryption keys
- Encrypted, decrypted, and rewrapped data
- Enforced minimum decryption version policies