hashicorp / hashicorp/consul-template
Vault KV v2: cannot access `subkeys/` path via `consul-template`
- 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
Assessment
This issue has not been assessed yet.