hashicorp / hashicorp/consul-template

Vault KV v2: cannot access `subkeys/` path via `consul-template`

Open
#2,015 0 comments 5 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
4.8k
Forks
801
Avg merge
4h 5m
Merged PRs (30d)
6

Description

Currently, the code that shims `data/` into Vault KV v2 paths only checks if the path starts with `data/` or `metadata/`. ([code](https://github.com/hashicorp/consul-template/blob/6cbdad30ecf122701936108979b7e3be892461c2/dependency/vault_read.go#L215-L219))

This effectively means that only these paths are accessible within Vault KV v2 secrets engines.

For example, attempting to access a path starting with `subkeys/` ([Vault API Docs)](https://developer.hashicorp.com/vault/api-docs/secret/kv/kv-v2#read-secret-subkeys) will result in the shim transforming the path to `data/subkeys/...`, missing the desired endpoint.

The code that shims `data/` into Vault KV v2 paths needs to check for every possible valid prefix before deciding to shim in `data/`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.