2019-09-10 13:32:51 -04:00
|
|
|
[role="xpack"]
|
2017-11-20 11:44:43 -05:00
|
|
|
[[encrypting-data]]
|
2019-09-30 13:18:50 -04:00
|
|
|
== Encrypting sensitive data in {watcher}
|
2017-11-20 11:44:43 -05:00
|
|
|
|
|
|
|
Watches might have access to sensitive data such as HTTP basic authentication
|
|
|
|
information or details about your SMTP email service. You can encrypt this
|
|
|
|
data by generating a key and adding some secure settings on each node in your
|
|
|
|
cluster.
|
|
|
|
|
2018-09-17 15:35:55 -04:00
|
|
|
Every `password` field that is used in your watch within an HTTP basic
|
|
|
|
authentication block - for example within a webhook, an HTTP input or when using
|
2018-06-26 10:24:28 -04:00
|
|
|
the reporting email attachment - will not be stored as plain text anymore. Also
|
|
|
|
be aware, that there is no way to configure your own fields in a watch to be
|
|
|
|
encrypted.
|
|
|
|
|
2017-11-20 11:44:43 -05:00
|
|
|
To encrypt sensitive data in {watcher}:
|
|
|
|
|
2019-09-30 13:18:50 -04:00
|
|
|
. Use the <<syskeygen,elasticsearch-syskeygen>> command to create a system key file.
|
2017-11-20 11:44:43 -05:00
|
|
|
|
|
|
|
. Copy the `system_key` file to all of the nodes in your cluster.
|
|
|
|
+
|
|
|
|
--
|
|
|
|
IMPORTANT: The system key is a symmetric key, so the same key must be used on
|
|
|
|
every node in the cluster.
|
|
|
|
|
|
|
|
--
|
|
|
|
|
2019-09-30 13:18:50 -04:00
|
|
|
. Set the <<notification-settings,`xpack.watcher.encrypt_sensitive_data` setting>>:
|
2017-11-20 11:44:43 -05:00
|
|
|
+
|
|
|
|
--
|
|
|
|
|
|
|
|
[source,sh]
|
|
|
|
----------------------------------------------------------------
|
2018-03-22 13:57:31 -04:00
|
|
|
xpack.watcher.encrypt_sensitive_data: true
|
2017-11-20 11:44:43 -05:00
|
|
|
----------------------------------------------------------------
|
|
|
|
--
|
|
|
|
|
|
|
|
. Set the
|
2019-09-30 13:18:50 -04:00
|
|
|
<<notification-settings,`xpack.watcher.encryption_key` setting>> in the
|
|
|
|
<<secure-settings,{es} keystore>> on each node in the cluster.
|
2017-11-20 11:44:43 -05:00
|
|
|
+
|
|
|
|
--
|
|
|
|
For example, run the following command to import the `system_key` file on
|
|
|
|
each node:
|
|
|
|
|
|
|
|
[source,sh]
|
|
|
|
----------------------------------------------------------------
|
|
|
|
bin/elasticsearch-keystore add-file xpack.watcher.encryption_key <filepath>/system_key
|
|
|
|
----------------------------------------------------------------
|
|
|
|
--
|
|
|
|
|
|
|
|
. Delete the `system_key` file on each node in the cluster.
|
|
|
|
|
|
|
|
NOTE: Existing watches are not affected by these changes. Only watches that you
|
|
|
|
create after following these steps have encryption enabled.
|