cross-cluster.asciidoc 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. [[cross-cluster-configuring]]
  2. === Cross Cluster Search and Security
  3. {ref}/modules-cross-cluster-search.html[Cross Cluster Search] enables
  4. federated search across multiple clusters. When using cross cluster search
  5. with secured clusters, all clusters must have {security} enabled.
  6. The local cluster (the cluster used to initiate cross cluster search) must be
  7. allowed to connect to the remote clusters, which means that the CA used to
  8. sign the SSL/TLS key of the local cluster must be trusted by the remote
  9. clusters.
  10. User authentication is performed on the local cluster and the user and user's
  11. roles are passed to the remote clusters. A remote cluster checks the user's
  12. roles against its local role definitions to determine which indices the user
  13. is allowed to access.
  14. [WARNING]
  15. This feature was added as Beta in {es} `v5.3` with further improvements made in
  16. 5.4 and 5.5. It requires gateway eligible nodes to be on `v5.5` onwards.
  17. To use cross cluster search with secured clusters:
  18. * Enable {security} on every node in each connected cluster. For more
  19. information about the `xpack.security.enabled` setting, see
  20. {ref}/security-settings.html[Security Settings in {es}].
  21. * Enable encryption globally. To encrypt communications, you must enable
  22. <<ssl-tls,enable SSL/TLS>> on every node.
  23. * Enable a trust relationship between the cluster used for performing cross
  24. cluster search (the local cluster) and all remote clusters. This can be done
  25. either by:
  26. +
  27. ** Using the same certificate authority to generate certificates for all
  28. connected clusters, or
  29. ** Adding the CA certificate from the local cluster as a trusted CA in
  30. each remote cluster (see {ref}/security-settings.html#transport-tls-ssl-settings[Transport TLS settings]).
  31. * Configure the local cluster to connect to remote clusters as described
  32. in {ref}/modules-remote-clusters.html#configuring_remote_clusters[Configuring Remote Clusters].
  33. For example, the following configuration adds two remote clusters
  34. to the local cluster:
  35. +
  36. --
  37. [source,js]
  38. -----------------------------------------------------------
  39. PUT _cluster/settings
  40. {
  41. "persistent": {
  42. "cluster": {
  43. "remote": {
  44. "cluster_one": {
  45. "seeds": [ "10.0.1.1:9300" ]
  46. },
  47. "cluster_two": {
  48. "seeds": [ "10.0.2.1:9300" ]
  49. }
  50. }
  51. }
  52. }
  53. }
  54. -----------------------------------------------------------
  55. // CONSOLE
  56. --
  57. * On the local cluster, ensure that users are assigned to (at least) one role
  58. that exists on the remote clusters. On the remote clusters, use that role
  59. to define which indices the user may access. (See <<authorization>>).
  60. ==== Example Configuration of Cross Cluster Search
  61. In the following example, we will configure the user `alice` to have permissions
  62. to search any index starting with `logs-` in cluster `two` from cluster `one`.
  63. First, enable cluster `one` to perform cross cluster search on remote cluster
  64. `two` by running the following request as the superuser on cluster `one`:
  65. [source,js]
  66. -----------------------------------------------------------
  67. PUT _cluster/settings
  68. {
  69. "persistent": {
  70. "cluster.remote.cluster_two.seeds": [ "10.0.2.1:9300" ]
  71. }
  72. }
  73. -----------------------------------------------------------
  74. // CONSOLE
  75. Next, set up a role called `cluster_two_logs` on both cluster `one` and
  76. cluster `two`.
  77. On cluster `one`, this role does not need any special privileges:
  78. [source,js]
  79. -----------------------------------------------------------
  80. POST /_xpack/security/role/cluster_two_logs
  81. {
  82. }
  83. -----------------------------------------------------------
  84. // CONSOLE
  85. On cluster `two`, this role allows the user to query local indices called
  86. `logs-` from a remote cluster:
  87. [source,js]
  88. -----------------------------------------------------------
  89. POST /_xpack/security/role/cluster_two_logs
  90. {
  91. "cluster": [],
  92. "indices": [
  93. {
  94. "names": [
  95. "logs-*"
  96. ],
  97. "privileges": [
  98. "read",
  99. "read_cross_cluster"
  100. ]
  101. }
  102. ]
  103. }
  104. -----------------------------------------------------------
  105. // CONSOLE
  106. Finally, create a user on cluster `one` and apply the `cluster_two_logs` role:
  107. [source,js]
  108. -----------------------------------------------------------
  109. POST /_xpack/security/user/alice
  110. {
  111. "password" : "somepassword",
  112. "roles" : [ "cluster_two_logs" ],
  113. "full_name" : "Alice",
  114. "email" : "alice@example.com",
  115. "enabled": true
  116. }
  117. -----------------------------------------------------------
  118. // CONSOLE
  119. With all of the above setup, the user `alice` is able to search indices in
  120. cluster `two` as follows:
  121. [source,js]
  122. -----------------------------------------------------------
  123. GET two:logs-2017.04/_search <1>
  124. {
  125. "query": {
  126. "match_all": {}
  127. }
  128. }
  129. -----------------------------------------------------------
  130. // CONSOLE
  131. // TEST[skip:todo]
  132. //TBD: Is there a missing description of the <1> callout above?
  133. :edit_url: https://github.com/elastic/kibana/edit/{branch}/docs/security/cross-cluster-kibana.asciidoc
  134. include::{kib-repo-dir}/security/cross-cluster-kibana.asciidoc[]