Hello there,
I have been setting up a vault + consul cluster and have everything finally working right except that we want to use TLS certs to authenticate into vault from the CLI, libraries, etc.
Steps I took (generally):
- create a certificate and private key (cert.pem, key.pem) (using cfssl in guide linked above)
- enable TLS Certificates authentication (used default path of `cert`:
vault write auth/cert/certs/cli \
display_name=cli \
policies=cli \
certificate=@cli.pem \
ttl=3600
- create a new policy (I named the policy cli):
path "cert/*" {
capabilities = ["create", "read", "update", "delete", "list"]
}
- this is fairly permissive on purpose until I get it working, then I will reduce.
- attempt to log into policy with cert authentication - this is where the problems arise...
I have tried the following based on the guide:
output I get:
{"errors":["missing name in alias"]}
Ok, that didn't work, so I tried:
$ vault login -method=cert -ca-cert=ca.pem -client-cert=cli.pem -client-key=cli-key.pem name=cli
output:
Error authenticating: Error making API request.
URL: PUT https://:8200/v1/auth/cert/login
Code: 500. Errors:
* missing name in alias
Same output...
So I searched the codebase and found this as the only place that error exists:
Which appears to be part of the logic which looks for an alias name in the response, I am providing this (as detailed in the guide) as name=cli
I am assuming that the alias would be whatever I name it when creating it and writing the policy to auth/cert/certs/cli
I, of course needed to change it for TLS auth and not github as shown in the guide. I am not using LDAP, username/pass, or github authentication currently and have no users in the system (outside of root).