secure-settings.asciidoc 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. ----------------------------------------------------------------