security-hash-settings.asciidoc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. [discrete]
  2. [[hashing-settings]]
  3. === User cache and password hash algorithms
  4. Certain realms store user credentials in memory. To limit exposure
  5. to credential theft and mitigate credential compromise, the cache only stores
  6. a hashed version of the user credentials in memory. By default, the user cache
  7. is hashed with a salted `sha-256` hash algorithm. You can use a different
  8. hashing algorithm by setting the <<static-cluster-setting,static>>
  9. `cache.hash_algo` realm settings to any of the following values:
  10. [[cache-hash-algo]]
  11. .Cache hash algorithms
  12. |=======================
  13. | Algorithm | | | Description
  14. | `ssha256` | | | Uses a salted `sha-256` algorithm (default).
  15. | `md5` | | | Uses `MD5` algorithm.
  16. | `sha1` | | | Uses `SHA1` algorithm.
  17. | `bcrypt` | | | Uses `bcrypt` algorithm with salt generated in 1024 rounds.
  18. | `bcrypt4` | | | Uses `bcrypt` algorithm with salt generated in 16 rounds.
  19. | `bcrypt5` | | | Uses `bcrypt` algorithm with salt generated in 32 rounds.
  20. | `bcrypt6` | | | Uses `bcrypt` algorithm with salt generated in 64 rounds.
  21. | `bcrypt7` | | | Uses `bcrypt` algorithm with salt generated in 128 rounds.
  22. | `bcrypt8` | | | Uses `bcrypt` algorithm with salt generated in 256 rounds.
  23. | `bcrypt9` | | | Uses `bcrypt` algorithm with salt generated in 512 rounds.
  24. | `pbkdf2` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  25. pseudorandom function using 10000 iterations.
  26. | `pbkdf2_1000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  27. pseudorandom function using 1000 iterations.
  28. | `pbkdf2_10000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  29. pseudorandom function using 10000 iterations.
  30. | `pbkdf2_50000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  31. pseudorandom function using 50000 iterations.
  32. | `pbkdf2_100000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  33. pseudorandom function using 100000 iterations.
  34. | `pbkdf2_500000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  35. pseudorandom function using 500000 iterations.
  36. | `pbkdf2_1000000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  37. pseudorandom function using 1000000 iterations.
  38. | `pbkdf2_stretch` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  39. pseudorandom function using 10000 iterations, after hashing the
  40. initial input with SHA512 first.
  41. | `pbkdf2_stretch_1000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  42. pseudorandom function using 1000 iterations, after hashing the
  43. initial input with SHA512 first.
  44. | `pbkdf2_stretch_10000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  45. pseudorandom function using 10000 iterations, after hashing the
  46. initial input with SHA512 first.
  47. | `pbkdf2_stretch_50000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  48. pseudorandom function using 50000 iterations, after hashing the
  49. initial input with SHA512 first.
  50. | `pbkdf2_stretch_100000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  51. pseudorandom function using 100000 iterations, after hashing the
  52. initial input with SHA512 first.
  53. | `pbkdf2_stretch_500000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  54. pseudorandom function using 500000 iterations, after hashing the
  55. initial input with SHA512 first.
  56. | `pbkdf2_stretch_1000000`| | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  57. pseudorandom function using 1000000 iterations, after hashing the
  58. initial input with SHA512 first.
  59. | `noop`,`clear_text` | | | Doesn't hash the credentials and keeps it in clear text in
  60. memory. CAUTION: keeping clear text is considered insecure
  61. and can be compromised at the OS level (for example through
  62. memory dumps and using `ptrace`).
  63. |=======================
  64. Likewise, realms that store passwords hash them using cryptographically strong
  65. and password-specific salt values. You can configure the algorithm for password
  66. hashing by setting the <<static-cluster-setting,static>>
  67. `xpack.security.authc.password_hashing.algorithm` setting to one of the
  68. following:
  69. [[password-hashing-algorithms]]
  70. .Password hashing algorithms
  71. |=======================
  72. | Algorithm | | | Description
  73. | `bcrypt` | | | Uses `bcrypt` algorithm with salt generated in 1024 rounds. (default)
  74. | `bcrypt4` | | | Uses `bcrypt` algorithm with salt generated in 16 rounds.
  75. | `bcrypt5` | | | Uses `bcrypt` algorithm with salt generated in 32 rounds.
  76. | `bcrypt6` | | | Uses `bcrypt` algorithm with salt generated in 64 rounds.
  77. | `bcrypt7` | | | Uses `bcrypt` algorithm with salt generated in 128 rounds.
  78. | `bcrypt8` | | | Uses `bcrypt` algorithm with salt generated in 256 rounds.
  79. | `bcrypt9` | | | Uses `bcrypt` algorithm with salt generated in 512 rounds.
  80. | `bcrypt10` | | | Uses `bcrypt` algorithm with salt generated in 1024 rounds.
  81. | `bcrypt11` | | | Uses `bcrypt` algorithm with salt generated in 2048 rounds.
  82. | `bcrypt12` | | | Uses `bcrypt` algorithm with salt generated in 4096 rounds.
  83. | `bcrypt13` | | | Uses `bcrypt` algorithm with salt generated in 8192 rounds.
  84. | `bcrypt14` | | | Uses `bcrypt` algorithm with salt generated in 16384 rounds.
  85. | `pbkdf2` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  86. pseudorandom function using 10000 iterations.
  87. | `pbkdf2_1000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  88. pseudorandom function using 1000 iterations.
  89. | `pbkdf2_10000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  90. pseudorandom function using 10000 iterations.
  91. | `pbkdf2_50000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  92. pseudorandom function using 50000 iterations.
  93. | `pbkdf2_100000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  94. pseudorandom function using 100000 iterations.
  95. | `pbkdf2_500000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  96. pseudorandom function using 500000 iterations.
  97. | `pbkdf2_1000000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  98. pseudorandom function using 1000000 iterations.
  99. | `pbkdf2_stretch` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  100. pseudorandom function using 10000 iterations, after hashing the
  101. initial input with SHA512 first.
  102. | `pbkdf2_stretch_1000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  103. pseudorandom function using 1000 iterations, after hashing the
  104. initial input with SHA512 first.
  105. | `pbkdf2_stretch_10000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  106. pseudorandom function using 10000 iterations, after hashing the
  107. initial input with SHA512 first.
  108. | `pbkdf2_stretch_50000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  109. pseudorandom function using 50000 iterations, after hashing the
  110. initial input with SHA512 first.
  111. | `pbkdf2_stretch_100000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  112. pseudorandom function using 100000 iterations, after hashing the
  113. initial input with SHA512 first.
  114. | `pbkdf2_stretch_500000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  115. pseudorandom function using 500000 iterations, after hashing the
  116. initial input with SHA512 first.
  117. | `pbkdf2_stretch_1000000`| | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  118. pseudorandom function using 1000000 iterations, after hashing the
  119. initial input with SHA512 first.
  120. |=======================
  121. Furthermore, {es} supports authentication via securely-generated high entropy tokens,
  122. for instance <<security-api-create-api-key,API keys>>.
  123. Analogous to passwords, only the tokens' hashes are stored. Since the tokens are guaranteed
  124. to have sufficiently high entropy to resist offline attacks, secure salted hash functions are supported
  125. in addition to the password-hashing algorithms mentioned above.
  126. You can configure the algorithm for API key stored credential hashing
  127. by setting the <<static-cluster-setting,static>>
  128. `xpack.security.authc.api_key.hashing.algorithm` setting to one of the
  129. following
  130. [[secure-token-hashing-algorithms]]
  131. .Secure token hashing algorithms
  132. |=======================
  133. | Algorithm | | | Description
  134. | `ssha256` | | | Uses a salted `sha-256` algorithm. (default)
  135. | `bcrypt` | | | Uses `bcrypt` algorithm with salt generated in 1024 rounds.
  136. | `bcrypt4` | | | Uses `bcrypt` algorithm with salt generated in 16 rounds.
  137. | `bcrypt5` | | | Uses `bcrypt` algorithm with salt generated in 32 rounds.
  138. | `bcrypt6` | | | Uses `bcrypt` algorithm with salt generated in 64 rounds.
  139. | `bcrypt7` | | | Uses `bcrypt` algorithm with salt generated in 128 rounds.
  140. | `bcrypt8` | | | Uses `bcrypt` algorithm with salt generated in 256 rounds.
  141. | `bcrypt9` | | | Uses `bcrypt` algorithm with salt generated in 512 rounds.
  142. | `bcrypt10` | | | Uses `bcrypt` algorithm with salt generated in 1024 rounds.
  143. | `bcrypt11` | | | Uses `bcrypt` algorithm with salt generated in 2048 rounds.
  144. | `bcrypt12` | | | Uses `bcrypt` algorithm with salt generated in 4096 rounds.
  145. | `bcrypt13` | | | Uses `bcrypt` algorithm with salt generated in 8192 rounds.
  146. | `bcrypt14` | | | Uses `bcrypt` algorithm with salt generated in 16384 rounds.
  147. | `pbkdf2` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  148. pseudorandom function using 10000 iterations.
  149. | `pbkdf2_1000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  150. pseudorandom function using 1000 iterations.
  151. | `pbkdf2_10000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  152. pseudorandom function using 10000 iterations.
  153. | `pbkdf2_50000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  154. pseudorandom function using 50000 iterations.
  155. | `pbkdf2_100000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  156. pseudorandom function using 100000 iterations.
  157. | `pbkdf2_500000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  158. pseudorandom function using 500000 iterations.
  159. | `pbkdf2_1000000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  160. pseudorandom function using 1000000 iterations.
  161. | `pbkdf2_stretch` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  162. pseudorandom function using 10000 iterations, after hashing the
  163. initial input with SHA512 first.
  164. | `pbkdf2_stretch_1000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  165. pseudorandom function using 1000 iterations, after hashing the
  166. initial input with SHA512 first.
  167. | `pbkdf2_stretch_10000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  168. pseudorandom function using 10000 iterations, after hashing the
  169. initial input with SHA512 first.
  170. | `pbkdf2_stretch_50000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  171. pseudorandom function using 50000 iterations, after hashing the
  172. initial input with SHA512 first.
  173. | `pbkdf2_stretch_100000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  174. pseudorandom function using 100000 iterations, after hashing the
  175. initial input with SHA512 first.
  176. | `pbkdf2_stretch_500000` | | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  177. pseudorandom function using 500000 iterations, after hashing the
  178. initial input with SHA512 first.
  179. | `pbkdf2_stretch_1000000`| | | Uses `PBKDF2` key derivation function with `HMAC-SHA512` as a
  180. pseudorandom function using 1000000 iterations, after hashing the
  181. initial input with SHA512 first.
  182. |=======================