-
Notifications
You must be signed in to change notification settings - Fork 41
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 Vault AppRole auth method in provider #1335
Comments
Thanks for filing this @michael2m! As with the previous issue you filed, I'm not sure what our timeline for making this change would be - but if you're interested in contributing you can find more info in our Secretless Contributing Guide and in our general Conjur Contributing Guide. You can also contact us on Discourse. I wonder if the Vault go client would be open to an option to configure via env var / file? If not, could Secretless could certainly be configured for its connection to Vault via env var / config file and then pass the config to the Vault client in the provider Go code. If you'd like to propose an implementation for this, it would be great to share it here for feedback before starting work. I look forward to seeing how this moves forward! |
Effectively it is a refactor and behavorial extension to the internal/providers/vault/provider.go function ProviderFactory.
Each supported auth method can have its own function(s) to setup the client. This makes for quite a modular design, where the factory function only determines which auth method to use and call into the appropriate auth method handler function to setup the remainder. BTW the Vault client instance has to be configured through the ProviderFactory function of the Vault provider anyway (currently it does so implicitly). The Vault API for golang has a ReadEnvironment function, but that reads a limited and fixed set of (some deprecated) env vars. It's not useful here. |
While I'm hesitant to say that env-var config is the right path forward long-term, it could give us a bit more idea on how to start thinking about configuring the providers from within the secretless config file itself. Regarding your approach proposal, these are my initial thoughts:
|
I'm not entirely happy with env-var configuration either. Long-term alternative could be to have configuration section per provider, which can be referenced in the However on short-term easiest solution seems sticking to env-vars. I do believe that In the AppRole case you may need to unwrap a single-use token to obtain the Do you envision the modularity to follow a factory like pattern ? |
Yeah I agree
I think whatever is natural to add to the current architecture is fine. If a big refactor is needed, we may want to separate that from adding in the new functionality. As a small related sidenote, it historically did seem like factory patterns have been the most fitting for modular Golang architectures we worked on so far. |
If you'd like me to work out a solution in code, please assign this issue to me and label it |
@michael2m Let's see what @doodlesbykumbi has on his plate but that sounds good to me! |
@michael2m I like the suggestions for how to proceed, envvars for now followed later by provider configuration in |
@doodlesbykumbi I think either way could be fine:
I think you go a little further than I originally did or the related issue #1336. Having named providers, they can have their own configuration and be referred to by their name when used elsewhere. What more do you get when:
? Could you also share some more thoughts on how:
? |
The scenario is one where you have connection details stored in vault that requires authentication details that is stored in another vault. A concrete example is storing credentials for Conjur in the keychain, while Conjur stores the credentials for my service. Cribbing from your suggestion in #1336, I would imagine something like this. In this example
|
This is exactly what I had in mind @doodlesbykumbi. And indeed you can get secrets for one provider from another one, which does require a DAG be validated (I think a tree would be too restrictive). Should improved configuration like above and in #1336 be implemented before continuing this issue ? |
I just want to put a note here that we need some way to provide secure credentials in the config file since those are most likely variables that need setting and the config file is usually a higher risk vs env vars. |
Improved configuration is definitely a more ambitious undertaking than we're planning to do for now. Let's proceed with:
I've gone ahead and assigned you. The implementation of the auth method(s) we have in mind is as stated in your comment about using envvars. Please let me know when there's work ready for review. I think we can create a separate issue for the improved configuration then continue the discussion and capture the improvements we envisage for config v3 over in that issue. |
This link was broken. This change points it to the right header within the README
Published in CyberArk Aha! idea portal |
Feature: AppRole auth method for Vault provider
I would like to see AppRole auth method in Vault provider for Secretless because that offers alternative login to Vault for fetching secrets. Currently the Vault provider is based on the default behavior of the Vault API client, which assumes an environment variable with a token for the token auth method. This is overly restrictive (Vault supports many auth methods).
Solution
Have an additional environment variable to capture the auth method, e.g. VAULT_AUTH_METHOD=approle, whose value indicates the auth method to use. Additional environment variables may be used to feed the required auth details, e.g. VAULT_APPROLE_ROLE_ID= and VAULT_APPROLE_SECRET_ID=. Within the provider factory function it can handle the auth method accordingly (switching on the auth method value).
Alternatives
There does not seem to be an alternative at the moment, due to the way the provider factory function is implemented. It creates a fixed configuration relying on the default behavior of the Vault API client. The solution outlined above could help create a more generic solution, although initially supporting only the AppRole auth method.
In the Vault API client in golang, additional configuration settings have to set (in code). There are no other facilities for obtaining a config, e.g. from environment variables or configuration files like YAML.
Additional context
https://www.vaultproject.io/docs/auth
The text was updated successfully, but these errors were encountered: