-
Notifications
You must be signed in to change notification settings - Fork 327
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 passing secrets using systemd LoadCredential directive #491
Comments
@squalus thanks for your PRs and thank you for opening this issue and for bringing the conversation here. I very much appreciate you taking the time to look at VP's code and implementing this improvement. I'm not familiar with systemd credentials, but I'm curious.. There are several items including the OAuth credentials in the configuration which are secrets. Could we hold the entire VP configuration in a file under $CREDENTIALS_DIRECTORY By holding the entire configuration there, that feels future proof and succinct with regard to the implementation. |
I think the main purpose of this is to be able to manage the config file and the secrets in a different place. For example, your config file can be committed to git, or generated with helm or nix. And if you use systemd credentials, you can still manage your configuration in a nice way but leave the secrets out of it. So I wouldn't want to move the entire configuration file to the secrets management system. Then I wouldn't be able to, for example, store the listen address or OIDC domain in a variable in my templating system. If there are only a small number of secrets and we don't expect that list to change very often, perhaps we can add a few more calls to |
Yes thanks, but just humor me for a minute and help me explore a bit.. Is it possible to put the entire configuration into the $CREDENTIALS_DIRECTORY? |
Yes, you could do something like this:
And at runtime, vouch-proxy will be able to read the config file from |
@squalus thanks for the clarification. Sorry for the delay in response. FYI - The next few weeks are going to be like this due to summer travel plans.
I like this idea. By my reckoning it would be straight forward to implement, it is future proof and it allows other sources of config to be added in a similar fashion. I'm uncertain of how to handle config elements being set by one config and then overwritten by another config. Perhaps it's enough to be very clear about what's going on at startup with good logging; provide additional checks to ensure that any time a config item is already set and then overwritten by the next configuration it's |
Updated the PR to support a full config file overlay. It can either come through a new env var, or through CREDENTIALS_DIRECTORY. Other secrets management systems, like Docker secrets, could use the env var approach. |
I would like vouch-proxy to support the systemd LoadCredential directive for passing secrets.
OAUTH_CLIENT_SECRET
andOAUTH_CLIENT_ID
are good candidates for this.vouch-proxy could read the files at
$CREDENTIALS_DIRECTORY/<secret_name>
as a lower priority item than the environment variables.Proposed implementation in #487
Systemd credentials documentation: https://systemd.io/CREDENTIALS/
The text was updated successfully, but these errors were encountered: