Version
An immutable revision under one KV v2 key.
Chapter 6 of 16 · Human user · Priya
Use versioned static secrets while keeping values out of source, logs, history, arguments, and durable application storage.
Chapter 5 complete and the shared KV v2 key created by bootstrap.
Priya can retrieve one KV field into protected temporary storage and verify version metadata only.
| Owner | Consumer-facing responsibility |
|---|---|
| You own | Defines consumption, validation, reload, and stop-using behavior. |
| Platform team owns | Provides trusted runtime identity, protected delivery, network, and telemetry. |
| Vault owns | Operates auth mounts, policies, engines, audit, and recovery. |
An immutable revision under one KV v2 key.
A precondition preventing overwrite of an unexpected version.
Hides selected versions while retaining recoverable data.
Permanently removes all versions and metadata.
source learn-vault/.runtime/learner.env
umask 077
vault kv get -field=feature_mode lockbox-kv/orders-api > learn-vault/.runtime/feature-mode
test "$(stat -f '%Lp' learn-vault/.runtime/feature-mode)" = 600
vault kv metadata get -format=json lockbox-kv/orders-api | jq '{current_version:.data.current_version}'| Symptom | The application reads an older value after rotation. |
|---|---|
| Likely causes | Pinned version, stale Agent render, no process reload, or overlong cache. |
| Inspect safely | Compare metadata version with recorded consumer version and render time. |
| Do not print | Old or new values, rendered files, or process environment. |
Break it: Keep a rendered KV field after verification.
Fix it: Remove the runtime file and rely on version and freshness metadata for evidence.
Escalate with time, endpoint, auth path, role, mount, namespace when relevant, status code, request ID, and sanitized error class. Never attach a credential or response body.
labs/bootstrap owns the disposable server, auth mounts, policies, roles, and engines; learner actions begin after setup.
$0; local containers only
Run labs/bootstrap/setup.sh and source .runtime/learner.env unless the chapter lab says AppRole alone is sufficient.
Run the dedicated KV consumer script, verify protected delivery and version metadata, then remove the runtime field.
cd learn-vault/labs/kv-v2
./read-field.sh
./cleanup.sh
Complete every item in the Verify section using metadata-only evidence; no secret value appears in terminal output or tracked files.
Use the Failure drill and Break it / fix it evidence fields. Stop before broadening policy, weakening identity or TLS checks, or copying secret-bearing diagnostics.
Remove renders, unset the token, and exclude .runtime from backups and support bundles.
orders-api consumes a minimal field and records only its KV version and reload time.
No. It helps local recovery but does not define retention or disaster recovery.
It prevents overwriting a newer revision the writer did not read.
No. Process ownership, backups, crash tools, and copies still matter.
Version and freshness, never value.
KV v2 provides versioned storage; consumers still own narrow retrieval, protected delivery, reload, and deletion.