cross-cluster.asciidoc 4.8 KB

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