clevis.1 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. .\" Automatically generated by Pandoc 1.19.1
  2. .\"
  3. .TH "CLEVIS" "1" "September 2017" "" ""
  4. .hy
  5. .SH NAME
  6. .PP
  7. clevis \-\- Automated decryption policy framework
  8. .SH SYNOPSIS
  9. .PP
  10. \f[C]clevis\f[] COMMAND [OPTIONS]
  11. .SH OVERVIEW
  12. .PP
  13. Clevis is a framework for automated decryption policy.
  14. It allows you to define a policy at encryption time that must be
  15. satisfied for the data to decrypt.
  16. Once this policy is met, the data is decrypted.
  17. .PP
  18. Clevis is pluggable.
  19. Our plugins are called pins.
  20. The job of a pin is to take a policy as its first argument and plaintext
  21. on standard input and to encrypt the data so that it can be
  22. automatically decrypted if the policy is met.
  23. Lets walk through an example.
  24. .SH HTTP ESCROW
  25. .PP
  26. When using the HTTP pin, we create a new, cryptographically\-strong,
  27. random key.
  28. This key is stored in a remote HTTP escrow server (using a simple PUT or
  29. POST).
  30. Then at decryption time, we attempt to fetch the key back again in order
  31. to decrypt our data.
  32. So, for our configuration we need to pass the URL to the key location:
  33. .IP
  34. .nf
  35. \f[C]
  36. $\ clevis\ encrypt\ http\ \[aq]{"url":"https://escrow.srv/1234"}\[aq]\ <\ PT\ >\ JWE
  37. \f[]
  38. .fi
  39. .PP
  40. To decrypt the data, simply provide the ciphertext (JWE):
  41. .IP
  42. .nf
  43. \f[C]
  44. $\ clevis\ decrypt\ <\ JWE\ >\ PLAINTEXT
  45. \f[]
  46. .fi
  47. .PP
  48. Notice that we did not pass any configuration during decryption.
  49. The decrypt command extracted the URL (and possibly other configuration)
  50. from the JWE object, fetched the encryption key from the escrow and
  51. performed decryption.
  52. .PP
  53. For more information, see \f[C]clevis\-encrypt\-http\f[](1).
  54. .SH TANG BINDING
  55. .PP
  56. Clevis provides support for the Tang network binding server.
  57. Tang provides a stateless, lightweight alternative to escrows.
  58. Encrypting data using the Tang pin works much like our HTTP pin above:
  59. .IP
  60. .nf
  61. \f[C]
  62. $\ clevis\ encrypt\ tang\ \[aq]{"url":"http://tang.srv"}\[aq]\ <\ PT\ >\ JWE
  63. The\ advertisement\ contains\ the\ following\ signing\ keys:
  64. _OsIk0T\-E2l6qjfdDiwVmidoZjA
  65. Do\ you\ wish\ to\ trust\ these\ keys?\ [ynYN]\ y
  66. \f[]
  67. .fi
  68. .PP
  69. As you can see above, Tang utilizes a trust\-on\-first\-use workflow.
  70. Alternatively, Tang can perform entirely offline encryption if you
  71. pre\-share the server advertisement.
  72. Decryption, too works like our first example:
  73. .IP
  74. .nf
  75. \f[C]
  76. $\ clevis\ decrypt\ <\ JWE\ >\ PT
  77. \f[]
  78. .fi
  79. .PP
  80. For more information, see \f[C]clevis\-encrypt\-tang\f[](1).
  81. .SH TPM2 BINDING
  82. .PP
  83. Clevis provides support to encrypt a key in a Trusted Platform Module
  84. 2.0 (TPM2) chip.
  85. The cryptographically\-strong, random key used for encryption is
  86. encrypted using the TPM2 chip, and then at decryption time is decrypted
  87. using the TPM2 to allow clevis to decrypt the secret stored in the JWE.
  88. .PP
  89. Encrypting data using the tpm2 pin works the same than the pins
  90. mentioned above:
  91. .IP
  92. .nf
  93. \f[C]
  94. $\ clevis\ encrypt\ tpm2\ \[aq]{}\[aq]\ <\ PT\ >\ JWE
  95. \f[]
  96. .fi
  97. .PP
  98. The pin has reasonable defaults for its configuration, but a different
  99. hierarchy, hash, and key algorithms can be chosen if the defaults used
  100. are not suitable.
  101. .PP
  102. Decryption also works similar to other pins, only the JWE needs to be
  103. provided:
  104. .IP
  105. .nf
  106. \f[C]
  107. $\ clevis\ decrypt\ <\ JWE\ >\ PT
  108. \f[]
  109. .fi
  110. .PP
  111. Note that like other pins no configuration is used for decryption, this
  112. is due clevis storing the public and private keys to unseal the TPM2
  113. encrypted object in the JWE so clevis can fetch that information from
  114. there.
  115. .PP
  116. For more information see \f[C]clevis\-encrypt\-tpm2\f[](1).
  117. .SH SHAMIR\[aq]S SECRET SHARING
  118. .PP
  119. Clevis provides a way to mix pins together to create sophisticated
  120. unlocking and high availability policies.
  121. This is accomplished by using an algorithm called Shamir\[aq]s Secret
  122. Sharing (SSS).
  123. .PP
  124. SSS is a thresholding scheme.
  125. It creates a key and divides it into a number of pieces.
  126. Each piece is encrypted using another pin (possibly even SSS
  127. recursively).
  128. Additionally, you define the threshold \f[C]t\f[].
  129. If at least \f[C]t\f[] pieces can be decrypted, then the encryption key
  130. can be recovered and decryption can succeed.
  131. .PP
  132. For example, let\[aq]s create a high\-availability setup using Tang:
  133. .IP
  134. .nf
  135. \f[C]
  136. $\ cfg=\[aq]{"t":1,"pins":{"tang":[{"url":...},{"url":...}]}}\[aq]
  137. $\ clevis\ encrypt\ sss\ "$cfg"\ <\ PT\ >\ JWE
  138. \f[]
  139. .fi
  140. .PP
  141. In this policy, we are declaring that we have a threshold of 1, but that
  142. there are multiple key fragments encrypted using different Tang servers.
  143. Since our threshold is 1, so long as any of the Tang servers are
  144. available, decryption will succeed.
  145. As always, decryption is simply:
  146. .IP
  147. .nf
  148. \f[C]
  149. $\ clevis\ decrypt\ <\ JWE\ >\ PT
  150. \f[]
  151. .fi
  152. .PP
  153. For more information, see \f[C]clevis\-encrypt\-tang\f[](1).
  154. .SH LUKS BINDING
  155. .PP
  156. Clevis can be used to bind an existing LUKS volume to its automation
  157. policy.
  158. This is accomplished with a simple command:
  159. .IP
  160. .nf
  161. \f[C]
  162. $\ clevis\ luks\ bind\ \-d\ /dev/sda\ tang\ \[aq]{"url":...}\[aq]
  163. \f[]
  164. .fi
  165. .PP
  166. This command performs four steps:
  167. .IP "1." 3
  168. Creates a new key with the same entropy as the LUKS master key.
  169. .IP "2." 3
  170. Encrypts the new key with Clevis.
  171. .IP "3." 3
  172. Stores the Clevis JWE in the LUKS header with LUKSMeta.
  173. .IP "4." 3
  174. Enables the new key for use with LUKS.
  175. .PP
  176. This disk can now be unlocked with your existing password as well as
  177. with the Clevis policy.
  178. Clevis provides two unlockers for LUKS volumes.
  179. First, we provide integration with Dracut to automatically unlock your
  180. root volume during early boot.
  181. Second, we provide integration with UDisks2 to automatically unlock your
  182. removable media in your desktop session.
  183. .PP
  184. For more information, see \f[C]clevis\-luks\-bind\f[](1).
  185. .SH SEE ALSO
  186. .PP
  187. \f[C]clevis\-encrypt\-http\f[](1), \f[C]clevis\-encrypt\-tang\f[](1),
  188. \f[C]clevis\-encrypt\-tpm2\f[](1), \f[C]clevis\-encrypt\-sss\f[](1),
  189. \f[C]clevis\-luks\-bind\f[](1), \f[C]clevis\-decrypt\f[](1)
  190. .SH AUTHORS
  191. Nathaniel McCallum <npmccallum@redhat.com>.