-
Notifications
You must be signed in to change notification settings - Fork 49
Description
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.