Vault¶
This feature deploys Vault, a tool for securely managing secrets used in modern computing (e.g. passwords, certificates, API keys).
Enabling Vault¶
To enable Vault, run the following command:
sunbeam enable vault
Vault units will be in blocked state after this step.
Initializing Vault¶
To initialize Vault, run the following command:
sunbeam vault init KEY_SHARES KEY_THRESHOLD
KEY_SHARES - Number of key shares to be generated by vault
KEY_THRESHOLD - Minimal number of key shares to be used to unseal vault
Output of the above command with 5 key shares and 3 key threshold looks like:
Unseal keys:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
cccccccccccccccccccccccccccccccccccccccccccc
dddddddddddddddddddddddddddddddddddddddddddd
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Root token: fff.ffffffffffffffffffffffff
It is recommended to store each of the unseal keys and root token into different files and keep them secure.
Unsealing Vault¶
To unseal Vault, run the following command:
cat <key file> | sunbeam vault unseal -
Unsealing the Vault requires minimum KEY_THRESHOLD keys to be provided to vault. So the unseal command should be executed KEY_THRESHOLD times. This will unseal the vault leader unit.
To unseal the non-leader units, repeat the unseal commands again.
For example, the process to unseal the Vault with 3 units, initialized with 5 key shares and 3 key threshold looks like:
Unseal with the first key:
$ cat <aaa.. key file> | sunbeam vault unseal -
Vault unseal operation status: 2 key shares required to unseal
Unseal with the second key:
$ cat <bbb.. key file> | sunbeam vault unseal -
Vault unseal operation status: 1 key shares required to unseal
Unseal with the third key:
$ cat <ccc.. key file> | sunbeam vault unseal -
Vault unseal operation status: completed for leader unit.
Rerun `sunbeam vault unseal` command to unseal non-leader units.
The leader unit gets unsealed and non-leader units are in sealed state.
Now repeat the process to unseal non-leader units. Unseal with the first key:
$ cat <aaa.. key file> | sunbeam vault unseal -
Vault unseal operation status:
vault/1 : 2 key shares required to unseal
vault/2 : 2 key shares required to unseal
Unseal with the second key:
$ cat <bbb.. key file> | sunbeam vault unseal -
Vault unseal operation status:
vault/1 : 1 key shares required to unseal
vault/2 : 1 key shares required to unseal
Unseal with the third key:
$ cat <ccc.. key file> | sunbeam vault unseal -
Vault unseal operation status: completed
Unsealing vault process completed.
Vault status¶
To see status of Vault, run the following command:
sunbeam vault status
Sample output of the above command looks like:
Vault Status
+---------+-------------+-----------+
| Unit | Initialized | Sealed |
+=========+=============+===========+
| vault/0 | True | False |
| vault/1 | True | False |
| vault/2 | True | False |
+---------+-------------+-----------+
Disabling Vault¶
To disable Vault, run the following command:
sunbeam disable vault
Caution
Disabling Vault will completely remove it from the infrastructure, all secrets will be lost.