As part of this lab, we will be required to create a policy, and a token, that can be used to authenticate against a vault server.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Unseal the Vault and Log in with the Root Token
- In the
Vault Server
, retrieve the vault keys. - Unseal the vault.
- Log in with the
Initial Root Token
.
- In the
- Enable KV Secrets Engine and Write a Generic Test Secret
- Enable a
kv
secrets engine at thesecrets-kv
path. - Write a secret to the
secrets-kv
path.
- Enable a
- Create a Policy That Gives Read Permissions to the KV Secrets Engine
- Create a policy file named
my_token_policy.hcl
. - Populate the policy file.
- Write the policy.
- Create a policy file named
- Create a Token, Test It Out, and Then Revoke It
- Create a token.
- Copy the
client_token
. - Log in with the newly created token.
- Attempt to read the secret.
- Attempt to write a new secret.
- Log in with the
Initial Root Token
. - Revoke the
client_token
.