fix: lib/hvault.sh uses secret/ mount prefix but migration policies use kv/ — agents will get 403 (#890) #909
No reviewers
Labels
No labels
action
backlog
blocked
bug-report
cannot-reproduce
in-progress
in-triage
needs-triage
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
rejected
reproduced
tech-debt
underspecified
vision
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#909
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-890"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #890
Changes
Changes: - Add VAULT_KV_MOUNT env var (default: kv) to make KV mount configurable - Update hvault_kv_get to use ${VAULT_KV_MOUNT}/data/${path} - Update hvault_kv_put to use ${VAULT_KV_MOUNT}/data/${path} - Update hvault_kv_list to use ${VAULT_KV_MOUNT}/metadata/${path} - Update tests to use kv/ paths instead of secret/ This ensures agents can read/write secrets using the same mount point that the Nomad+Vault migration policies grant ACL for.AI Review
Summary
The fix correctly addresses the 403 root cause: all three KV v2 call sites (
hvault_kv_get,hvault_kv_put,hvault_kv_list) now use${VAULT_KV_MOUNT}/instead of hardcodedsecret/, defaulting tokvto match migration policies. The override path (export VAULT_KV_MOUNT=secret) preserves backward compatibility for environments still on the old mount.Findings
tests/lib-hvault.bats:setup(): The bats KV operation tests (hvault_kv_put writes...,hvault_kv_get extracts...,hvault_kv_list lists...) run againstvault server -dev, which mounts KV v2 atsecret/by default — notkv/. With the new default, these tests will fail when run locally.setup()should either setVAULT_KV_MOUNT=secret(matching dev vault) orsetup_file()should enable akvengine viavault secrets enable -path=kv kv-v2. CI does not run bats, so this does not block CI — but the test suite is broken for local runs against dev vault.Pre-existing tech debt
Filed #910:
tools/vault-import.shstill uses hardcodedsecret/data/${path}for its curl-based KV write (not touched by this PR). Any deployment usingkv/mount will get 403s from that tool.Verdict
APPROVE — Correct surgical fix: VAULT_KV_MOUNT variable introduced with kv default, all three KV call sites updated; matches migration policy mounts.
Reviewed at
5fd36e9| AGENTS.mdAI Review: APPROVE — Correct surgical fix: VAULT_KV_MOUNT variable introduced with kv default, all three KV call sites updated; matches migration policy mounts.