I think the answer may be simpler than what you are thinking.
The application has to authenticate to vault to get the token in the first place (say, by using a client certificate, user/password, or AppRole). The application should just re-authenticate. That should generate a new token. (You'll have to check to see if the old token is automatically invalidated, or if you will have to do that manually.)
We're at about the same stage as you (actually not as far along) in our automation. My plan is to use ansible to generate a certificate for the client machine on its behalf (ridiculously easy to do with vault), push that to the client (in wrapped form), and use it for authentication against vault. Then it will be able to renew tokens or re-auth by itself. The certs can have a short lifetime, with ansible updating them every X period of time.
You might want to dig into AppRole, too. It's more complicated than using certs for authentication, but has an element of what you are looking for in key rolling. A trusted third party, like an ansible server, would generate the secret on behalf of the client, and push it to the client, where it would have a (very) limited lifetime. The client would have to periodically go back to the trusted third party. You have to establish a strong trust relationship, but the third party can cut the client off at any time, by simply not renewing the AppRole secret_id.
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/vault/issues
IRC: #vault-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Vault" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vault-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/c93852d1-0ea4-42b5-bf2b-d4217449e83f%40googlegroups.com.
Paul's suggestions are good to look into, but I have a more basic question:do you need your token lifetimes to be disparate from your application lifetimes?In many situations, the application is regularly rolled to deal with new deployments, security updates to any underling OS/base layers, and so on. It's pretty easy (using periodic tokens) to tie an application's token lifetime close to the application's lifetime if the period is going to be similar.The benefit to this approach is that if the application goes down early for some reason, the token disappears quickly.
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/vault/issues
IRC: #vault-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Vault" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vault-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/2f29baa7-5dfe-417b-a58d-ea0dddd502e8%40googlegroups.com.
As a quick and dirty sort of approach, Consul Template will keep a configured Vault token renewed, so you could just run that as a sidecar process purely for Vault token renewal :-)
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/vault/issues
IRC: #vault-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Vault" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vault-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/6126191c-8e51-4e2b-98d5-fac13312f0fa%40googlegroups.com.
2. Service/server periodically requests a new token (pull)Create an application/script that lives on each server (alongside each service) that periodically hits the Vault HTTP API to create a new token using the same permissions and policies of the token that it currently has. This application could acquire a new token, place it in a token file, and restart/reload whatever services that depend on a Vault token.