-
HashiCorp Vault is an identity-based secrets and encryption management system.
-
A secret is anything that you want to tightly control access to, such as API encryption keys, passwords, and certificates.
-
Vault provides encryption services that are gated by authentication and authorization methods. Using Vault’s UI, CLI, or HTTP API, access to secrets and other sensitive data can be securely stored and managed, tightly controlled (restricted), and auditable.
Barrier
- Vault’s encryption layer, referred to as the barrier, is responsible for encrypting and decrypting Vault data.
- When the Vault server starts, it writes data to its storage backend.
- Since the storage backend resides outside the barrier, it’s considered untrusted so Vault will encrypt the data before it sends them to the storage backend.
- This mechanism ensures that if a malicious attacker attempts to gain access to the storage backend, the data cannot be compromised since it remains encrypted, until Vault decrypts the data. The storage backend provides a durable data persistent layer where data is secured and available across server restarts.
Seal/Unseal
-
When a Vault server is started, it starts in a sealed state. In this state, Vault is configured to know where and how to access the physical storage, but doesn’t know how to decrypt any of it.
-
Unsealing is the process of obtaining the plaintext root key necessary to read the decryption key to decrypt the data, allowing access to the Vault.
-
The data stored by Vault is encrypted. Vault needs the encryption key in order to decrypt the data. The encryption key is also stored with the data (in the keyring), but encrypted with another encryption key known as the root key.
-
Therefore, to decrypt the data, Vault must decrypt the encryption key which requires the root key. Unsealing is the process of getting access to this root key. The root key is stored alongside all other Vault data, but is encrypted by yet another mechanism: the unseal key.
-
To recap:
- most Vault data is encrypted using the ‘encryption key in the keyring’;
- the keyring is encrypted by the root key;
- and the root key is encrypted by the unseal key.
reference