clevis.1.adoc 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. CLEVIS(1)
  2. =========
  3. :doctype: manpage
  4. == NAME
  5. clevis - Automated decryption policy framework
  6. == SYNOPSIS
  7. *clevis* COMMAND [OPTIONS]
  8. == OVERVIEW
  9. Clevis is a framework for automated decryption policy. It allows you to define
  10. a policy at encryption time that must be satisfied for the data to decrypt.
  11. Once this policy is met, the data is decrypted.
  12. Clevis is pluggable. Our plugins are called pins. The job of a pin is to
  13. take a policy as its first argument and plaintext on standard input and to
  14. encrypt the data so that it can be automatically decrypted if the policy is
  15. met. Lets walk through an example.
  16. == HTTP ESCROW
  17. When using the HTTP pin, we create a new, cryptographically-strong, random key.
  18. This key is stored in a remote HTTP escrow server (using a simple PUT or POST).
  19. Then at decryption time, we attempt to fetch the key back again in order to
  20. decrypt our data. So, for our configuration we need to pass the URL to the key
  21. location:
  22. $ clevis encrypt http '{"url":"https://escrow.srv/1234"}' < PT > JWE
  23. To decrypt the data, simply provide the ciphertext (JWE):
  24. $ clevis decrypt < JWE > PLAINTEXT
  25. Notice that we did not pass any configuration during decryption. The decrypt
  26. command extracted the URL (and possibly other configuration) from the JWE
  27. object, fetched the encryption key from the escrow and performed decryption.
  28. For more information, see link:clevis-encrypt-http.1.adoc[*clevis-encrypt-http*(1)].
  29. == TANG BINDING
  30. Clevis provides support for the Tang network binding server. Tang provides
  31. a stateless, lightweight alternative to escrows. Encrypting data using the Tang
  32. pin works much like our HTTP pin above:
  33. $ clevis encrypt tang '{"url":"http://tang.srv"}' < PT > JWE
  34. The advertisement contains the following signing keys:
  35. _OsIk0T-E2l6qjfdDiwVmidoZjA
  36. Do you wish to trust these keys? [ynYN] y
  37. As you can see above, Tang utilizes a trust-on-first-use workflow.
  38. Alternatively, Tang can perform entirely offline encryption if you pre-share
  39. the server advertisement. Decryption, too works like our first example:
  40. $ clevis decrypt < JWE > PT
  41. For more information, see link:clevis-encrypt-tang.1.adoc[*clevis-encrypt-tang*(1)].
  42. == TPM2 BINDING
  43. Clevis provides support to encrypt a key in a Trusted Platform Module 2.0 (TPM2)
  44. chip. The cryptographically-strong, random key used for encryption is encrypted
  45. using the TPM2 chip, and then at decryption time is decrypted using the TPM2 to
  46. allow clevis to decrypt the secret stored in the JWE.
  47. Encrypting data using the tpm2 pin works the same than the pins mentioned above:
  48. $ clevis encrypt tpm2 '{}' < PT > JWE
  49. The pin has reasonable defaults for its configuration, but a different hierarchy,
  50. hash, and key algorithms can be chosen if the defaults used are not suitable.
  51. Decryption also works similar to other pins, only the JWE needs to be provided:
  52. $ clevis decrypt < JWE > PT
  53. Note that like other pins no configuration is used for decryption, this is due
  54. clevis storing the public and private keys to unseal the TPM2 encrypted object
  55. in the JWE so clevis can fetch that information from there.
  56. For more information see link:clevis-encrypt-tpm2.1.adoc[*clevis-encrypt-tpm2*(1)].
  57. == SHAMIR'S SECRET SHARING
  58. Clevis provides a way to mix pins together to create sophisticated unlocking
  59. and high availability policies. This is accomplished by using an algorithm
  60. called Shamir's Secret Sharing (SSS).
  61. SSS is a thresholding scheme. It creates a key and divides it into a number of
  62. pieces. Each piece is encrypted using another pin (possibly even SSS
  63. recursively). Additionally, you define the threshold *t*. If at least *t*
  64. pieces can be decrypted, then the encryption key can be recovered and
  65. decryption can succeed.
  66. For example, let's create a high-availability setup using Tang:
  67. $ cfg='{"t":1,"pins":{"tang":[{"url":...},{"url":...}]}}'
  68. $ clevis encrypt sss "$cfg" < PT > JWE
  69. In this policy, we are declaring that we have a threshold of 1, but that there
  70. are multiple key fragments encrypted using different Tang servers. Since our
  71. threshold is 1, so long as any of the Tang servers are available, decryption
  72. will succeed. As always, decryption is simply:
  73. $ clevis decrypt < JWE > PT
  74. For more information, see link:clevis-encrypt-tang.1.adoc[*clevis-encrypt-tang*(1)].
  75. == LUKS BINDING
  76. Clevis can be used to bind an existing LUKS volume to its automation policy.
  77. This is accomplished with a simple command:
  78. $ clevis luks bind -d /dev/sda tang '{"url":...}'
  79. This command performs four steps:
  80. 1. Creates a new key with the same entropy as the LUKS master key.
  81. 2. Encrypts the new key with Clevis.
  82. 3. Stores the Clevis JWE in the LUKS header with LUKSMeta.
  83. 4. Enables the new key for use with LUKS.
  84. This disk can now be unlocked with your existing password as well as with
  85. the Clevis policy. Clevis provides two unlockers for LUKS volumes. First,
  86. we provide integration with Dracut to automatically unlock your root volume
  87. during early boot. Second, we provide integration with UDisks2 to
  88. automatically unlock your removable media in your desktop session.
  89. For more information, see link:clevis-luks-bind.1.adoc[*clevis-luks-bind*(1)].
  90. == SEE ALSO
  91. link:clevis-encrypt-http.1.adoc[*clevis-encrypt-http*(1)],
  92. link:clevis-encrypt-tang.1.adoc[*clevis-encrypt-tang*(1)],
  93. link:clevis-encrypt-tpm2.1.adoc[*clevis-encrypt-tpm2*(1)],
  94. link:clevis-encrypt-sss.1.adoc[*clevis-encrypt-sss*(1)],
  95. link:clevis-luks-bind.1.adoc[*clevis-luks-bind*(1)],
  96. link:clevis-decrypt.1.adoc[*clevis-decrypt*(1)]