secure-settings.asciidoc 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. [[secure-settings]]
  2. === Secure settings
  3. Some settings are sensitive, and relying on filesystem permissions to protect
  4. their values is not sufficient. For this use case, Elasticsearch provides a
  5. keystore and the `elasticsearch-keystore` tool to manage the settings in the keystore.
  6. NOTE: All commands here should be run as the user which will run Elasticsearch.
  7. NOTE: Only some settings are designed to be read from the keystore. See
  8. documentation for each setting to see if it is supported as part of the keystore.
  9. NOTE: All the modifications to the keystore take affect only after restarting
  10. Elasticsearch.
  11. NOTE: The elasticsearch keystore currently only provides obfuscation. In the future,
  12. password protection will be added.
  13. These settings, just like the regular ones in the `elasticsearch.yml` config file,
  14. need to be specified on each node in the cluster. Currently, all secure settings
  15. are node-specific settings that must have the same value on every node.
  16. [float]
  17. [[creating-keystore]]
  18. === Creating the keystore
  19. To create the `elasticsearch.keystore`, use the `create` command:
  20. [source,sh]
  21. ----------------------------------------------------------------
  22. bin/elasticsearch-keystore create
  23. ----------------------------------------------------------------
  24. The file `elasticsearch.keystore` will be created alongside `elasticsearch.yml`.
  25. [float]
  26. [[list-settings]]
  27. === Listing settings in the keystore
  28. A list of the settings in the keystore is available with the `list` command:
  29. [source,sh]
  30. ----------------------------------------------------------------
  31. bin/elasticsearch-keystore list
  32. ----------------------------------------------------------------
  33. [float]
  34. [[add-string-to-keystore]]
  35. === Adding string settings
  36. Sensitive string settings, like authentication credentials for cloud
  37. plugins, can be added using the `add` command:
  38. [source,sh]
  39. ----------------------------------------------------------------
  40. bin/elasticsearch-keystore add the.setting.name.to.set
  41. ----------------------------------------------------------------
  42. The tool will prompt for the value of the setting. To pass the value
  43. through stdin, use the `--stdin` flag:
  44. [source,sh]
  45. ----------------------------------------------------------------
  46. cat /file/containing/setting/value | bin/elasticsearch-keystore add --stdin the.setting.name.to.set
  47. ----------------------------------------------------------------
  48. [float]
  49. [[remove-settings]]
  50. === Removing settings
  51. To remove a setting from the keystore, use the `remove` command:
  52. [source,sh]
  53. ----------------------------------------------------------------
  54. bin/elasticsearch-keystore remove the.setting.name.to.remove
  55. ----------------------------------------------------------------
  56. [float]
  57. [[reloadable-secure-settings]]
  58. === Reloadable secure settings
  59. Just like the settings values in `elasticsearch.yml`, changes to the
  60. keystore contents are not automatically applied to the running
  61. elasticsearch node. Re-reading settings requires a node restart.
  62. However, certain secure settings are marked as *reloadable*. Such settings
  63. can be re-read and applied on a running node.
  64. The values of all secure settings, *reloadable* or not, must be identical
  65. across all cluster nodes. After making the desired secure settings changes,
  66. using the `bin/elasticsearch-keystore add` command, call:
  67. [source,js]
  68. ----
  69. POST _nodes/reload_secure_settings
  70. ----
  71. // CONSOLE
  72. This API will decrypt and re-read the entire keystore, on every cluster node,
  73. but only the *reloadable* secure settings will be applied. Changes to other
  74. settings will not go into effect until the next restart. Once the call returns,
  75. the reload has been completed, meaning that all internal datastructures dependent
  76. on these settings have been changed. Everything should look as if the settings
  77. had the new value from the start.
  78. When changing multiple *reloadable* secure settings, modify all of them, on
  79. each cluster node, and then issue a `reload_secure_settings` call, instead
  80. of reloading after each modification.