This is the fourth post in a series on Vault. For previous posts see, Getting Started, Secrets Engines, and Manage Policies.
Overview Link to heading
Authentication is the process where users or automation provide credentials to gain a token. The tokens, similar to a session ID on a website, is then used to interact with Vault. The token itself states the policies and as a result the roles and access the user has. When using the development server, users are already familiar with using the hard-coded root token to get started.
Access Methods Link to heading
Vault has a number of authentication methods to choose from. Allowing a user to choose the best method of any use case. These methods are how clients or users access Vault.
Here are a couple of options in more detail:
TLS Certificates Link to heading
The TLS Certificate method allows for using SSL/TLS client certificates, signed by a CA or self-signed, for access.
The following enables the certificate auth method and adds a certificate for a “builder” policy. These builders are added to the test and build policies and places a one hour ttl to leases:
|
|
Then on the builder to login with the client cert:
|
|
Userpass Link to heading
The Userpass method allows users to access Vault using a username and password.
|
|
Then to login using the new access:
|
|
The user’s token string and TTY is printed along with the policies that apply to the user.
AppRole Link to heading
The AppRole enables a variety of potential workflows focused around automation. A role could possibly be created for a specific app on a machine, a user, across a number of machines, or even something else.
The AppRole method uses a role ID and secret ID to login and fetch a token. The role ID could be shared across a variety of machines, while the secret ID is meant to be unique for one instance of an application. The uniqueness allows for better auditing and having finer-grained revocation.
To start an admin enables the AppRole method and adds a role with a variety of ttl, use restrictions, and policies:
|
|
Then users, admins, or an orchestration mechanism can generate role and secret IDs as needed. This is done by the following:
|
|
Finally, to login using this mechanism is as easy as passing the role and secret IDs:
|
|
Clouds Link to heading
There are also authentication methods that let a user get cloud credentials.
These exist for the following clouds:
Others Link to heading
Finally, there are even more options that involve integration with other services:
See the authentication docs for the full list of support methods.
Next Steps Link to heading
With secrets, policies, and access in place, it is time to look deeper into dynamic database secret generation.