clevis.1 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. .\" Automatically generated by Pandoc 1.19.1
  2. .\"
  3. .TH "CLEVIS" "1" "Sepember 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 SHAMIR\[aq]S SECRET SHARING
  82. .PP
  83. Clevis provides a way to mix pins together to create sophisticated
  84. unlocking and high availability policies.
  85. This is accomplished by using an algorithm called Shamir\[aq]s Secret
  86. Sharing (SSS).
  87. .PP
  88. SSS is a thresholding scheme.
  89. It creates a key and divides it into a number of pieces.
  90. Each piece is encrypted using another pin (possibly even SSS
  91. recursively).
  92. Additionally, you define the threshold \f[C]t\f[].
  93. If at least \f[C]t\f[] pieces can be decrypted, then the encryption key
  94. can be recovered and decryption can succeed.
  95. .PP
  96. For example, let\[aq]s create a high\-availability setup using Tang:
  97. .IP
  98. .nf
  99. \f[C]
  100. $\ cfg=\[aq]{"t":1,"pins":{"tang":[{"url":...},{"url":...}]}}\[aq]
  101. $\ clevis\ encrypt\ sss\ "$cfg"\ <\ PT\ >\ JWE
  102. \f[]
  103. .fi
  104. .PP
  105. In this policy, we are declaring that we have a threshold of 1, but that
  106. there are multiple key fragments encrypted using different Tang servers.
  107. Since our threshold is 1, so long as any of the Tang servers are
  108. available, decryption will succeed.
  109. As always, decryption is simply:
  110. .IP
  111. .nf
  112. \f[C]
  113. $\ clevis\ decrypt\ <\ JWE\ >\ PT
  114. \f[]
  115. .fi
  116. .PP
  117. For more information, see \f[C]clevis\-encrypt\-tang\f[](1).
  118. .SH LUKS BINDING
  119. .PP
  120. Clevis can be used to bind an existing LUKS volume to its automation
  121. policy.
  122. This is accomplished with a simple command:
  123. .IP
  124. .nf
  125. \f[C]
  126. $\ clevis\ luks\ bind\ \-d\ /dev/sda\ tang\ \[aq]{"url":...}\[aq]
  127. \f[]
  128. .fi
  129. .PP
  130. This command performs four steps:
  131. .IP "1." 3
  132. Creates a new key with the same entropy as the LUKS master key.
  133. .IP "2." 3
  134. Encrypts the new key with Clevis.
  135. .IP "3." 3
  136. Stores the Clevis JWE in the LUKS header with LUKSMeta.
  137. .IP "4." 3
  138. Enables the new key for use with LUKS.
  139. .PP
  140. This disk can now be unlocked with your existing password as well as
  141. with the Clevis policy.
  142. Clevis provides two unlockers for LUKS volumes.
  143. First, we provide integration with Dracut to automatically unlock your
  144. root volume during early boot.
  145. Second, we provide integration with UDisks2 to automatically unlock your
  146. removable media in your desktop session.
  147. .PP
  148. For more information, see \f[C]clevis\-luks\-bind\f[](1).
  149. .SH SEE ALSO
  150. .PP
  151. \f[C]clevis\-encrypt\-http\f[](1), \f[C]clevis\-encrypt\-tang\f[](1),
  152. \f[C]clevis\-encrypt\-sss\f[](1), \f[C]clevis\-luks\-bind\f[](1),
  153. \f[C]clevis\-decrypt\f[](1)
  154. .SH AUTHORS
  155. Nathaniel McCallum <npmccallum@redhat.com>.