|
@@ -12,7 +12,9 @@ volumes.
|
|
|
What does this look like? Well, the first step is encrypting some data. We do
|
|
|
this with a simple command:
|
|
|
|
|
|
- $ clevis encrypt PIN CONFIG < PLAINTEXT > CIPHERTEXT.jwe
|
|
|
+```bash
|
|
|
+$ clevis encrypt PIN CONFIG < PLAINTEXT > CIPHERTEXT.jwe
|
|
|
+```
|
|
|
|
|
|
This command takes plaintext on standard input and produces an encrypted JWE
|
|
|
object on standard output. Besides the plaintext, we need to specify two
|
|
@@ -64,8 +66,7 @@ advertisement is trusted.
|
|
|
|
|
|
Clevis provides support to encrypt a key in a Trusted Platform Module 2.0 (TPM2)
|
|
|
chip. The cryptographically-strong, random key used for encryption is encrypted
|
|
|
-using the TPM2 chip, and then at decryption time is decrypted using the TPM2 to
|
|
|
-allow clevis to decrypt the secret stored in the JWE.
|
|
|
+using the TPM2 chip, and is decrypted using TPM2 at the time of decryption to allow clevis to decrypt the secret stored in the JWE.
|
|
|
|
|
|
For example:
|
|
|
|
|
@@ -88,11 +89,11 @@ recursively). Additionally, you define the threshold `t`. If at least `t`
|
|
|
pieces can be decrypted, then the encryption key can be recovered and
|
|
|
decryption can succeed.
|
|
|
|
|
|
-Here is an example where we use the SSS pin with both the Tang and HTTP pins:
|
|
|
+Here is an example where we use the SSS pin with both the Tang and TPM2 pins:
|
|
|
|
|
|
```bash
|
|
|
$ echo hi | clevis encrypt sss \
|
|
|
-'{"t": 2, "pins": {"http": {"url": "http://server.local/key"}, "tang": {"url": "http://tang.local"}}}' \
|
|
|
+'{"t": 2, "pins": {"tpm2": {"pcr_ids": "0"}, "tang": {"url": "http://tang.local"}}}' \
|
|
|
> hi.jwe
|
|
|
```
|
|
|
|
|
@@ -100,16 +101,16 @@ In the above example, we define two child pins and have a threshold of 2.
|
|
|
This means that during decryption **both** child pins must succeed in order for
|
|
|
SSS itself to succeed.
|
|
|
|
|
|
-Here is another example where we use just the HTTP pin:
|
|
|
+Here is another example where we use just the Tang pin:
|
|
|
|
|
|
```bash
|
|
|
$ echo hi | clevis encrypt sss \
|
|
|
-'{"t": 1, "pins": {"http": [{"url": "http://server1.local/key"}, {"url": "http://server1.local/key"}]}}' \
|
|
|
+'{"t": 1, "pins": {"tang": [{"url": "http://server1.local/key"}, {"url": "http://server2.local/key"}]}}' \
|
|
|
> hi.jwe
|
|
|
```
|
|
|
|
|
|
-In this example, we define two child instances of the HTTP pin - each with its
|
|
|
-own configuration. Since we have a threshold of 1, if **either** of the HTTP
|
|
|
+In this example, we define two child instances of the Tang pin - each with its
|
|
|
+own configuration. Since we have a threshold of 1, if **either** of the Tang
|
|
|
pin instances succeed during decryption, SSS will succeed.
|
|
|
|
|
|
### Binding LUKS Volumes
|
|
@@ -162,7 +163,7 @@ initramfs you will need to run:
|
|
|
sudo update-initramfs -u -k 'all'
|
|
|
```
|
|
|
|
|
|
-Upon reboot it will behave exactly as if using Dracut.
|
|
|
+Upon reboot, it will behave exactly as if using Dracut.
|
|
|
|
|
|
#### Unlocker: UDisks2
|
|
|
|
|
@@ -215,3 +216,41 @@ UDisks2 unlocker, respectively.
|
|
|
```bash
|
|
|
$ sudo dnf install clevis clevis-dracut clevis-udisks2
|
|
|
```
|
|
|
+
|
|
|
+## Manual compilation
|
|
|
+
|
|
|
+As remarked in the previous section, **it is suggested not to install Clevis directly**.
|
|
|
+However, in case no Clevis packages exist for your Linux distribution, the steps to
|
|
|
+manually compile and install Clevis are next ones:
|
|
|
+
|
|
|
+* Download latest version of the binaries (not that the latest version could change):
|
|
|
+```bash
|
|
|
+$ wget https://github.com/latchset/clevis/releases/download/v19/clevis-19.tar.xz
|
|
|
+```
|
|
|
+
|
|
|
+* Untar the binaries file:
|
|
|
+```bash
|
|
|
+$ tar Jxvf clevis-19.tar.xz
|
|
|
+```
|
|
|
+
|
|
|
+* Create build directory and change path to it:
|
|
|
+```bash
|
|
|
+$ cd clevis-19
|
|
|
+$ mkdir build
|
|
|
+$ cd build
|
|
|
+```
|
|
|
+
|
|
|
+* Execute `meson` to setup compilation:
|
|
|
+```bash
|
|
|
+$ meson setup ..
|
|
|
+```
|
|
|
+
|
|
|
+* Compile with `ninja` command:
|
|
|
+```bash
|
|
|
+$ ninja
|
|
|
+```
|
|
|
+
|
|
|
+* Install with `ninja install` command (you will need root permissions for it):
|
|
|
+```bash
|
|
|
+$ sudo ninja install
|
|
|
+```
|