Description
Hi!
I'm looking for a way to securely deliver secrets onto my nodes, and believe the best way to go about that is to use Vault for secrets management. I've been reading up on support for this in Puppet, and came across documentation referincing the use of this Puppet module. After looking at the documentation, I'm rather certain that the recommended way of using Vault's AppRole authentication method (the method I prefer for having nodes authenticating with my Vault instance) is not supported by this module. The main issue seems to be the lack of support for unwrapping wrapped secrets here.
The way to use the AppRole as recommended by Hashicorp is as follows (translated to Puppet terminology):
- The Puppet Server, authenticated with the Vault Server with, for instance, a token, by policy only has permissions to request secret ID's for AppRoles
- The Puppet Server requests a secret ID for a specific AppRole from vault, and asks for it to be returned in a wrapped response (this results in a token that may be used by the node to retrieve the unwrapped secret ID)
- The Puppet Server provides the wrapped response to the node and instructs it (via a Deferred call) to unwrap the secret, resulting in a usable secret ID
- The Node (in the same deferred call) exchanges the role ID and secret ID for a token which it then may use to retrieve a specific secret, like a KV store value.
As far as I can tell from looking at the source code, step 3 is not implemented; only an unwrapped secret ID can be passed as an argument. It would be really nice if there is a way to pass a wrapped secret token to the lookup command, which would first be exchanged for the actual secret ID in the code. This might be as simple as detecting whether the secret ID is in fact a secret ID (seems like a UUID format) or a token (typically 3 lowercase letters, a period and then followed by random alphanumeric characters), and adding the unwrap logic before exchanging role ID/secret ID for an authentication token if the format is the latter. Or perhaps an unwrap:
prefix for the secret ID?