KV Secrets Engine vs Transit Secrets Engine: Storage vs Encryption as a Service in Vault

Contents

One of the first choices when adopting Vault is whether to store secrets in Vault or use Vault only as an encryption service. Both are Vault secrets engines, but the data location and responsibility boundaries are completely different. This post compares KV-based storage with Transit-based encryption services and categorizes the open-source options.

Line guide

  • 논리적 요청·응답 흐름
  • 외부 보관 책임
  • 굵은 테두리는 Vault 경계, 굵은 상자는 값이나 키가 남는 곳이다.

KV: 시크릿 저장·조회

KV: 시크릿 값을 Vault에 보관애플리케이션이 kv put으로 시크릿을 쓰고 kv get으로 읽는다. KV는 시크릿 값을 Vault 스토리지 백엔드에 보관하고 값을 반환한다.애플리케이션VaultKV스토리지백엔드시크릿 값 보관kv put으로 쓰기kv get으로 읽기시크릿 값 반환

Transit: 암호화 서비스, 데이터는 외부

Transit: 키는 Vault, 암호문은 외부애플리케이션이 평문을 base64로 인코딩해 encrypt 요청을 보내면 Vault Transit이 보관한 키로 연산해 ciphertext를 돌려준다. 앱은 ciphertext를 외부 DB나 앱 저장소에 보관한다. 복호화 때 ciphertext로 decrypt를 요청해 base64 plaintext를 돌려받는다. Transit은 평문을 저장하지 않지만 요청에는 평문이 전달된다.애플리케이션VaultTransit키 보관회전·rewrap암복호연산평문(base64)encrypt 요청ciphertext 반환ciphertext로decrypt 요청plaintext(base64) 반환외부 DB/앱 저장소ciphertext 보관보관하고 복호화 때 가져옴
KV는 Vault 스토리지 백엔드에 값을 보관하고, Transit은 키 보관과 암복호 연산만 맡아 평문을 저장하지 않지만 암호화 요청에는 평문(base64 인코딩이며 암호화가 아님)이 전달된다.
Read the diagram as text
  1. KV: 애플리케이션이 kv put으로 시크릿 값을 Vault KV에 쓴다.
  2. KV는 시크릿 값을 Vault 스토리지 백엔드에 보관한다.
  3. kv get으로 읽으면 Vault가 시크릿 값을 반환한다.
  4. Transit: 애플리케이션이 평문을 base64로 인코딩해 encrypt 요청을 보낸다.
  5. Vault Transit이 보관한 키로 연산해 ciphertext를 반환한다. 평문은 저장하지 않는다.
  6. 애플리케이션이 ciphertext를 외부 DB/앱 저장소에 보관한다.
  7. 복호화: ciphertext로 decrypt를 요청하면 plaintext(base64)를 돌려받는다.

KV Secrets Engine: Store Secrets Inside Vault

KV is literally a key-value store. Secrets an application needs, such as DB passwords and API tokens, are stored inside Vault and read when needed. They benefit from Vault's access control and audit logging, and Vault becomes the single source of truth.

Key Characteristics

Example: Basic KV v2 Operations

bash
# 환경 변수
export VAULT_ADDR="http://127.0.0.1:8200"
export VAULT_TOKEN="s.xxxxx"

# 시크릿 저장
vault kv put secret/app db_password="p@ssw0rd" api_key="abcd1234"

# 시크릿 조회
vault kv get secret/app

The expected output looks like this.

text
===== Data =====
Key             Value
---             -----
api_key         abcd1234
db_password     p@ssw0rd

KV v2 supports versioning and distinguishes deletion, recovery, and permanent deletion. If typos or incorrect updates happen frequently during operations, v2 is much safer.

Transit Secrets Engine: Keys in Vault, Data Outside

Transit is an encryption service. Data remains in the application or DB, while Vault handles only key storage and encryption/decryption operations. The biggest difference is that Vault does not store the plaintext.

Key Characteristics

Example: Basic Transit Operations

bash
# 키 생성
vault write -f transit/keys/payments

# 평문을 base64로 인코딩해서 암호화 요청
PLAINTEXT=$(printf 'card-1234' | base64)
vault write transit/encrypt/payments plaintext="$PLAINTEXT"

The expected output looks like this.

text
Key         Value
---         -----
ciphertext  vault:v1:AbCdEf...==

Decryption takes ciphertext and returns base64-encoded plaintext.

bash
vault write transit/decrypt/payments ciphertext="vault:v1:AbCdEf...=="
text
Key       Value
---       -----
plaintext Y2FyZC0xMjM0

KV vs Transit Comparison

Category KV Secrets Engine Transit Secrets Engine
Purpose Secret store Encryption/decryption service
Data location Inside Vault External systems
Responsibility boundary Vault also stores the data Vault handles only keys and operations
Access pattern read/write encrypt/decrypt/sign/verify
Availability impact Affects secret retrieval Affects every encryption request
Rotation strategy Update the values themselves, with versioning Rotate key versions, rewrap
Backup/recovery A Vault backup is a secret backup Vault backups are important for preserving keys

Selection Criteria: When to Use KV or Transit

Operational Checklist (Delegate → Review → Own)

In practice, security reliability depends on who automates what and who holds final responsibility.

Map of Open-Source Options

Vault's KV/Transit concepts are widely known, but the open-source ecosystem takes various approaches. The following list groups options by KV storage and Transit-style encryption services.

KV-Based Secret Stores

Project Type Notes
HashiCorp Vault (OSS) Central KV + various secrets engines Includes KV v1/v2 and Transit
OpenBao Vault-compatible fork Includes KV and Transit
CyberArk Conjur OSS Centralized secret management Policy-based access control
Keywhiz Secret distribution server Large-scale deployments exist
Confidant Secret distribution server Maintenance status needs checking
Kubernetes Secrets In-cluster KV etcd encryption must be configured

Transit-Style Encryption Services

Project Type Notes
HashiCorp Vault Transit Encryption/decryption API Supports key rotation and rewrap
OpenBao Transit Vault-compatible encryption API A model similar to Vault
OpenStack Barbican KMS-style Provides key/secret management APIs

GitOps/File-Based Encryption (Supporting Tools)

Project Type Notes
Mozilla SOPS File encryption tool Based on KMS integration
Bitnami Sealed Secrets Kubernetes CRD GitOps secret encryption

For open-source software, maintenance matters as much as features. Check release cadence and community activity before adopting a tool.

Diagram

100%

Drag to pan; pinch or use the wheel to zoom. Keyboard: arrow keys pan, + − zoom, 0 fits, Esc closes. The same content is in “Read the diagram as text” below the figure.