Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secret function doesn't honour at-sign (@) to load file contents into an attribute #1489

Open
tomwerneruk opened this issue Jul 1, 2021 · 0 comments
Labels
enhancement hashicat-update-required Changes that need to be ported to hashicat vault Related to the Vault integration

Comments

@tomwerneruk
Copy link

Consul Template version

compiled from main @ commit 51401f3

Configuration

vault {
  address = "http://127.0.0.1:8200"
}

template {
  source      = "./in.tmpl"
  destination = "./out.cer"
}
{{ with secret "pki_int/sign/example-dot-com" "ttl=60s" "csr=@./MYCSR.csr" }}
{{ .Data.certificate }}
{{ end }}

Command

consul-template -template "in.tmpl:out.cer"
or
consul-template -config config.hcl 

Expected behavior

The Vault convention of prefixing a file with an @ then causes the contents to be read and used as the value

Actual behavior

The string is used literally, passing the value '@./MYCSR.csr' to Vault, causing an HTTP 400

Steps to reproduce

  1. Create a template and CSR as above
  2. Configure Vault using https://learn.hashicorp.com/tutorials/vault/pki-engine?in=vault/secrets-management
  3. Execute consul-template against Vault
@eikenb eikenb added enhancement hashicat-update-required Changes that need to be ported to hashicat vault Related to the Vault integration labels Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement hashicat-update-required Changes that need to be ported to hashicat vault Related to the Vault integration
Projects
None yet
Development

No branches or pull requests

2 participants