hashicorp / hashicorp/consul-template

Rendering PKI CRL

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

Description

See https://discuss.hashicorp.com/t/vault-agent-template-get-pki-crl/47672/2

When redering the CRL of a PKI (`{{ with secret "pki-root/cert/crl" }}{{ .Data.certificate }}{{ end }}`), consul-template throws the following error:
```
vault.read(pki-root/cert/crl): failed to check if pki-root/cert/crl is KVv2, assume not: Error making API request.#012#012URL: GET https://active.vault.service.consul:8200/v1/sys/internal/ui/mounts/pki-root/cert/crl#012Code: 403. Errors:#012#012* preflight capability check returned 403, please ensure client’s policies grant access to path “pki-root/cert/crl/”
```

Workaround to suppress this error message:
```
path "pki-root/a-nonexistent-path-so-that-sys-internal-ui-mounts-will-return-info-about-this-mount" {
capabilities = ["list"]
}
```

Proposed solution:
Add some option to force kv version:
`{{ with secret "pki-root/cert/crl" kv_version="1" }}{{ .Data.certificate }}{{ end }}`

Contributor guide

Open the contributing guide

Research direction

No source files or tests are identified in the issue. Start by tracing how the secret template expression for Vault's PKI CRL is parsed and how the pki-root/cert/crl lookup performs its KV-version check; done should include a supported explicit KV-version option that renders the CRL without the 403 preflight error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.