clevis-encrypt-tpm2.1 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. .\" Automatically generated by Pandoc 1.19.1
  2. .\"
  3. .TH "CLEVIS\-ENCRYPT\-TPM2" "1" "November 2017" "" ""
  4. .hy
  5. .SH NAME
  6. .PP
  7. clevis\-encrypt\-tpm2 \-\- Encrypts using a TPM2.0 chip binding policy
  8. .SH SYNOPSIS
  9. .PP
  10. \f[C]clevis\ encrypt\ tpm2\f[] CONFIG < PT > JWE
  11. .SH OVERVIEW
  12. .PP
  13. The \f[C]clevis\ encrypt\ tpm2\f[] command encrypts using a Trusted
  14. Platform Module 2.0 (TPM2) chip.
  15. Its only argument is the JSON configuration object.
  16. .PP
  17. When using the tpm2 pin, we create a new, cryptographically\-strong,
  18. random key.
  19. This key is encrypted using the TPM2 chip.
  20. Then at decryption time, the key is decrypted again using the TPM2 chip.
  21. .IP
  22. .nf
  23. \f[C]
  24. $\ clevis\ encrypt\ tpm2\ \[aq]{}\[aq]\ <\ PT\ >\ JWE
  25. \f[]
  26. .fi
  27. .PP
  28. The pin has reasonable defaults for its configuration, but a different
  29. hierarchy, hash, and key algorithms can be chosen if the defaults used
  30. are not suitable:
  31. .IP
  32. .nf
  33. \f[C]
  34. $\ clevis\ encrypt\ tpm2\ \[aq]{"hash":"sha1","key":"rsa"}\[aq]\ <\ PT\ >\ JWE
  35. \f[]
  36. .fi
  37. .PP
  38. To decrypt the data, simply provide the ciphertext (JWE):
  39. .IP
  40. .nf
  41. \f[C]
  42. $\ clevis\ decrypt\ <\ JWE\ >\ PT
  43. \f[]
  44. .fi
  45. .PP
  46. Note that like other pins no configuration is used for decryption, this
  47. is due clevis storing the public and private keys to unseal the TPM2
  48. encrypted object in the JWE so clevis can fetch that information from
  49. there.
  50. .PP
  51. The pin also supports sealing data to a Platform Configuration Registers
  52. (PCR) state.
  53. That way the data can only be unsealed if the PCRs hashes values match
  54. the policy used when sealing.
  55. .PP
  56. For example, to seal the data to the PCR with index 0 and 1 for the SHA1
  57. bank:
  58. .IP
  59. .nf
  60. \f[C]
  61. $\ clevis\ encrypt\ tpm2\ \[aq]{"pcr_bank":"sha1","pcr_ids":"0,1"}\[aq]\ <\ PT\ >\ JWE
  62. \f[]
  63. .fi
  64. .PP
  65. The PCR digest values are looked up from the current hash values for the
  66. PCRs, but a digest can also be provided if the data needs to be sealed
  67. with values different to the current ones, by passing the binary hash
  68. encoded in base64:
  69. .IP
  70. .nf
  71. \f[C]
  72. $\ clevis\ encrypt\ tpm2\ \[aq]{"pcr_ids":"0","pcr_digest":"xy7J5svCtqlfM03d1lE5gdoA8MI"}\[aq]\ <\ PT\ >\ JWE
  73. \f[]
  74. .fi
  75. .SH Threat model
  76. .PP
  77. The Clevis security model relies in the fact that an attacker will not
  78. be able to access both the encrypted data and the decryption key.
  79. .PP
  80. For most Clevis pins, the decryption key is not locally stored, so the
  81. decryption policy is only satisfied if the decryption key can be
  82. remotely accessed.
  83. It could for example be stored in a remote server or in a hardware
  84. authentication device that has to be plugged into the machine.
  85. .PP
  86. The tpm2 pin is different in this regard, since a key is wrapped by a
  87. TPM2 chip that is always present in the machine.
  88. This does not mean that there are not use cases for this pin, but it is
  89. important to understand the fact that an attacker that has access to
  90. both the encrypted data and the local TPM2 chip will be able to decrypt
  91. the data.
  92. .SH CONFIG
  93. .PP
  94. This command uses the following configuration properties:
  95. .IP \[bu] 2
  96. \f[C]hash\f[] (string) : Hash algorithm used in the computation of the
  97. object name (default: sha256)
  98. .PP
  99. It must be one of the following:
  100. .IP \[bu] 2
  101. \f[C]sha1\f[]
  102. .IP \[bu] 2
  103. \f[C]sha256\f[]
  104. .IP \[bu] 2
  105. \f[C]sha384\f[]
  106. .IP \[bu] 2
  107. \f[C]sha512\f[]
  108. .IP \[bu] 2
  109. \f[C]sm3_256\f[]
  110. .IP \[bu] 2
  111. \f[C]key\f[] (string) : Algorithm type for the generated key (default:
  112. ecc)
  113. .PP
  114. It must be one of the following:
  115. .IP \[bu] 2
  116. \f[C]rsa\f[]
  117. .IP \[bu] 2
  118. \f[C]keyedhash\f[]
  119. .IP \[bu] 2
  120. \f[C]ecc\f[]
  121. .IP \[bu] 2
  122. \f[C]symcipher\f[]
  123. .IP \[bu] 2
  124. \f[C]pcr_bank\f[] (string) : PCR algorithm bank to use for policy
  125. (default: sha1)
  126. .PP
  127. It must be one of the following:
  128. .IP \[bu] 2
  129. \f[C]sha1\f[]
  130. .IP \[bu] 2
  131. \f[C]sha256\f[]
  132. .IP \[bu] 2
  133. \f[C]pcr_ids\f[] (string) : Comma separated list of PCR used for policy.
  134. If not present, no policy is used
  135. .IP \[bu] 2
  136. \f[C]pcr_digest\f[] (string) : Binary PCR hashes encoded in base64.
  137. If not present, the hash values are looked up
  138. .SH SEE ALSO
  139. .PP
  140. \f[C]clevis\-decrypt\f[](1)
  141. .SH AUTHORS
  142. Javier Martinez Canillas <javierm@redhat.com>.