Hello, all!
I'm attempting to write my first Auth plugin for Vault. In my organization, we have some sort of integration with our domain roles and AWS roles, that has been hidden in a black box by my organization's security team, so I can't really use the built-in AWS credentials plugin already installed in Vault by default (or I wouldn't even attempt this). So, with the blessing of my org's security team, I do have permission to leverage the microservices they created for generating AWS auth ID and SECRET keys. So, I am writing a plugin that leverages those services so I can do token-based generation of AWS keys for automation purposes.
Ok, with that wee-bit of background out there. My problem is (and I think I've only seen one real post on this from googling, but it didn't really help me). ok, I have my plugin stubbed out, building, and "enabling" in a DEV Vault instance. However, I'm getting a warning when I enable the plugin in Vault as shown here:
2018-05-23T17:58:47.633-0700 [DEBUG] auth.plugin.auth_plugin_dac366d1.myauth-plugin: starting plugin: metadata=true path=/Users/me/go/src/gitlab.mycompany.com/sse/vault-mynewvault-plugin/myauth-plugin args=[/Users/me/go/src/gitlab.mycompany.com/sse/vault-mynewvault-plugin/myauth-plugin]
2018-05-23T17:58:47.636-0700 [DEBUG] auth.plugin.auth_plugin_dac366d1.myauth-plugin: waiting for RPC address: metadata=true path=/Users/me/go/src/gitlab.mycompany.com/sse/vault-mynewvault-plugin/myauth-plugin
2018-05-23T17:58:47.653-0700 [DEBUG] auth.plugin.auth_plugin_dac366d1.myauth-plugin.vmyauth-plugin: plugin address: metadata=true address=/var/folders/lc/mtty42rj4ddcdzsm68zbzmpwdklbbr/T/plugin177935374 network=unix timestamp=2018-05-23T17:58:47.653-0700
2018-05-23T17:58:47.656-0700 [WARN ] auth.plugin.auth_plugin_dac366d1.myauth-plugin: error closing client during Kill: metadata=true err="rpc error: code = Canceled desc = grpc: the client connection is closing"
2018-05-23T17:58:47.658-0700 [DEBUG] auth.plugin.auth_plugin_dac366d1.myauth-plugin: plugin process exited: metadata=true path=/Users/me/go/src/gitlab.mycompany.com/sse/vault-mynewvault-plugin/myauth-plugin
2018-05-23T17:58:47.658-0700 [INFO ] core: enabled credential backend: path=myauth type=plugin
** Line 4 - highlighted above is a concern.
However, given that warning in the Vault debug output, I still get a success message back from the Vault client telling me the plugin has been enabled. So far, it seems to be OK until I try to USE the new plugin. The plugin is configured to accept either a UserId/Password combination, or a previously issued Vault token for a valid UserId/Password combination generated during an Okta login. However, no matter what or how many of the valid login credentials into the plugin:
vault write -f auth/myauth/login username=foo@mycompany.com password=bar
-or-
vault write -f auth/myauth/login token=<somevalidtoken>
-or even-
vault write -f auth/myauth/login invalid=invalid
I get an error returned by the Vault client:
Error writing data to auth/myauth/login: Error making API request.
URL: PUT http://localhost:8200/v1/auth/myauth/login
Code: 500. Errors:
* plugin exited before we could connect
And an error sent to the Vault server's Debug logs:
2018-05-23T17:59:27.184-0700 [DEBUG] auth.plugin.auth_plugin_dac366d1.myauth-plugin: starting plugin: path=/Users/me/go/src/gitlab.mycompany.com/sse/vault-mynewvault-plugin/myauth-plugin args=[/Users/me/go/src/gitlab.mycompany.com/sse/vault-amynewvault-plugin/myauth-plugin]
2018-05-23T17:59:27.187-0700 [DEBUG] auth.plugin.auth_plugin_dac366d1.myauth-plugin: waiting for RPC address: path=/Users/me/go/src/gitlab.mycompany.com/sse/vault-mynewvault-plugin/myauth-plugin
2018-05-23T17:59:27.227-0700 [ERROR] auth.plugin.auth_plugin_dac366d1.myauth-plugin.vmyauth-plugin: plugin tls init: error="error during token unwrap request: Error making API request.
URL: PUT http://127.0.0.1:8200/v1/sys/wrapping/unwrap
Code: 403. Errors:
* permission denied" timestamp=2018-05-23T17:59:27.227-0700
2018-05-23T17:59:27.229-0700 [DEBUG] auth.plugin.auth_plugin_dac366d1.myauth-plugin: plugin process exited: path=/Users/me/go/src/gitlab.mycompany.com/sse/vault-mynewvault-plugin/myauth-plugin
Any suggestions on where I need to look to help resolve this? Oh, and FWIW, this is on a local DEV instance running Vault 0.10.1 on a Mac OS-X 10.13.2 and the plugin was built with Go go1.10.1 darwin/amd4, if that matters any.
Thanks in advance!