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

Support export of latest public key from the Vault Transit Engine #1871

Open
chinnaxs opened this issue Jan 29, 2024 · 1 comment
Open

Support export of latest public key from the Vault Transit Engine #1871

chinnaxs opened this issue Jan 29, 2024 · 1 comment

Comments

@chinnaxs
Copy link

Which problem is this feature request solving?

We use Vault Transit Secret Engine to generate asymmetric keys. We would like to inject the current/latest generated public key into a k8s Pod. The injection happens via Vault Agent Sidecar Injector and annotation based Consul-template injection.

Describe the solution you'd like

We would like to have a new template function transit <PATH> where PATH is a path to a Transit Secret Engine, which points to the latest key. e.g. : transit/export/public-key/fookey/latest

Then we could inject the secret like this:

apiVersion: ...
kind: ...
spec:
  annotation:
    vault.hashicorp.com/agent-inject-secret-signing_key: |
      {{ with transit "transit/export/public-key/signing_key/latest" }}
        {{ .Data.key }}
      {{ end }}

Can you submit a pull request?

No.

@thevilledev
Copy link
Contributor

consul-template has a built-in secret template function which enables a generic read/write interface to any Vault backend. This includes the transit backend, so in your case something like this could work:

{{ with secret "transit/export/public-key/some-kind-of-key/latest" }}
{{ range .Data.keys }}{{ . }}{{ end }}{{ end }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants