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

[Feature Request] Ability not to do cert auth login as part of lookup #24

Closed
petems opened this issue Feb 15, 2020 · 1 comment · Fixed by #66
Closed

[Feature Request] Ability not to do cert auth login as part of lookup #24

petems opened this issue Feb 15, 2020 · 1 comment · Fixed by #66

Comments

@petems
Copy link
Member

petems commented Feb 15, 2020

Since the 1.1.0 release of Vault, it has the ability to do auto-auth lookup as a daemonized agent. This includes certs, so the approach in the function stays the same, but the auth token would be cached and automaticaly renewed when needed. Also, it would mean that lookups for certain secrets that have a long lease time.

I did a write-up of the whole process here: https://petersouter.xyz/vault-caching-with-auto-auth-and-puppet/

However, this only works if the token is not given during lookup time, so the logic that does the cert auth and gets the token needs to be disabled for this to work.

I'm not sure how best to do this: a parameter that disables the token lookup (eg. $d = Deferred('vault_lookup::lookup', ["secret/test", 'https://vault.hostname:8200', :cert_auth => disabled])) or a new function that has the same logic but is named differently (eg. $d = Deferred('vault_lookup::lookup_agent', ["secret/test"]) that defaults to localhost:8200 or something like that

This would also resolve the issue of #7 & #16

@petems petems changed the title [Feature Request] Ability not to do token authentication [Feature Request] Ability not to do cert auth login as part of lookup Feb 15, 2020
@fuero
Copy link

fuero commented Feb 18, 2020

tl;dr:
vault_lookup should support unix sockets as VAULT_ADDR.

long version:
I looked into the agent + auto-auth mode offered by vault, and it adds the ability to bind the listener to a socket.

As it's possible for local users to abuse a network socket that's been pre-authenticated against Vault, I'd suggest using a unix socket protected by proper permissions (and SELinux Labels) to ward off that risk.

It's offered by more recent versions of consul-template as well.

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

Successfully merging a pull request may close this issue.

2 participants