2017-04-11 04:08:12 -04:00
|
|
|
[[cross-cluster-configuring]]
|
|
|
|
=== Cross Cluster Search and Security
|
|
|
|
|
|
|
|
{ref}/modules-cross-cluster-search.html[Cross Cluster Search] enables
|
|
|
|
federated search across multiple clusters. When using cross cluster search
|
|
|
|
with secured clusters, all clusters must have {security} enabled.
|
|
|
|
|
|
|
|
The local cluster (the cluster used to initiate cross cluster search) must be
|
|
|
|
allowed to connect to the remote clusters, which means that the CA used to
|
|
|
|
sign the SSL/TLS key of the local cluster must be trusted by the remote
|
|
|
|
clusters.
|
|
|
|
|
|
|
|
User authentication is performed on the local cluster and the user and user's
|
|
|
|
roles are passed to the remote clusters. A remote cluster checks the user's
|
|
|
|
roles against its local role definitions to determine which indices the user
|
|
|
|
is allowed to access.
|
|
|
|
|
2017-07-11 08:15:23 -04:00
|
|
|
|
2017-09-08 11:41:32 -04:00
|
|
|
[WARNING]
|
2017-11-27 10:56:38 -05:00
|
|
|
This feature was added as Beta in {es} `v5.3` with further improvements made in
|
|
|
|
5.4 and 5.5. It requires gateway eligible nodes to be on `v5.5` onwards.
|
2017-07-11 08:15:23 -04:00
|
|
|
|
2017-04-11 04:08:12 -04:00
|
|
|
To use cross cluster search with secured clusters:
|
|
|
|
|
2018-04-05 15:06:43 -04:00
|
|
|
* Enable {security} on every node in each connected cluster. For more
|
|
|
|
information about the `xpack.security.enabled` setting, see
|
|
|
|
{ref}/security-settings.html[Security Settings in {es}].
|
2017-04-11 04:08:12 -04:00
|
|
|
|
|
|
|
* Enable encryption globally. To encrypt communications, you must enable
|
|
|
|
<<ssl-tls,enable SSL/TLS>> on every node.
|
|
|
|
|
|
|
|
* Enable a trust relationship between the cluster used for performing cross
|
|
|
|
cluster search (the local cluster) and all remote clusters. This can be done
|
|
|
|
either by:
|
|
|
|
+
|
|
|
|
** Using the same certificate authority to generate certificates for all
|
|
|
|
connected clusters, or
|
|
|
|
** Adding the CA certificate from the local cluster as a trusted CA in
|
2017-06-23 14:21:07 -04:00
|
|
|
each remote cluster (see {ref}/security-settings.html#transport-tls-ssl-settings[Transport TLS settings]).
|
2017-04-11 04:08:12 -04:00
|
|
|
|
|
|
|
* Configure the local cluster to connect to remote clusters as described
|
|
|
|
in {ref}/modules-cross-cluster-search.html#_configuring_cross_cluster_search[Configuring Cross Cluster Search].
|
|
|
|
For example, the following configuration adds two remote clusters
|
|
|
|
to the local cluster:
|
|
|
|
+
|
2017-11-27 10:56:38 -05:00
|
|
|
--
|
2017-04-11 04:08:12 -04:00
|
|
|
[source,js]
|
|
|
|
-----------------------------------------------------------
|
|
|
|
PUT _cluster/settings
|
|
|
|
{
|
|
|
|
"persistent": {
|
|
|
|
"search": {
|
|
|
|
"remote": {
|
|
|
|
"cluster_one": {
|
|
|
|
"seeds": [ "10.0.1.1:9300" ]
|
|
|
|
},
|
|
|
|
"cluster_two": {
|
|
|
|
"seeds": [ "10.0.2.1:9300" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
-----------------------------------------------------------
|
2017-11-27 10:56:38 -05:00
|
|
|
// CONSOLE
|
|
|
|
--
|
2017-04-11 04:08:12 -04:00
|
|
|
|
|
|
|
* On the local cluster, ensure that users are assigned to (at least) one role
|
|
|
|
that exists on the remote clusters. On the remote clusters, use that role
|
|
|
|
to define which indices the user may access. (See <<authorization>>).
|
|
|
|
|
2017-04-21 07:37:34 -04:00
|
|
|
==== Example Configuration of Cross Cluster Search
|
|
|
|
|
|
|
|
In the following example, we will configure the user `alice` to have permissions
|
|
|
|
to search any index starting with `logs-` in cluster `two` from cluster `one`.
|
|
|
|
|
|
|
|
First, enable cluster `one` to perform cross cluster search on remote cluster
|
|
|
|
`two` by running the following request as the superuser on cluster `one`:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
-----------------------------------------------------------
|
2017-11-27 10:56:38 -05:00
|
|
|
PUT _cluster/settings
|
2017-04-21 07:37:34 -04:00
|
|
|
{
|
|
|
|
"persistent": {
|
2017-11-27 10:56:38 -05:00
|
|
|
"search.remote.cluster_two.seeds": [ "10.0.2.1:9300" ]
|
2017-04-21 07:37:34 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
-----------------------------------------------------------
|
2017-11-27 10:56:38 -05:00
|
|
|
// CONSOLE
|
2017-04-21 07:37:34 -04:00
|
|
|
|
|
|
|
Next, set up a role called `cluster_two_logs` on both cluster `one` and
|
|
|
|
cluster `two`.
|
|
|
|
|
2017-09-08 11:41:32 -04:00
|
|
|
On cluster `one`, this role does not need any special privileges:
|
2017-04-21 07:37:34 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
-----------------------------------------------------------
|
|
|
|
POST /_xpack/security/role/cluster_two_logs
|
|
|
|
{
|
|
|
|
}
|
|
|
|
-----------------------------------------------------------
|
2017-11-27 10:56:38 -05:00
|
|
|
// CONSOLE
|
2017-04-21 07:37:34 -04:00
|
|
|
|
|
|
|
On cluster `two`, this role allows the user to query local indices called
|
|
|
|
`logs-` from a remote cluster:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
-----------------------------------------------------------
|
|
|
|
POST /_xpack/security/role/cluster_two_logs
|
|
|
|
{
|
2018-05-04 13:52:11 -04:00
|
|
|
"cluster": [],
|
2017-04-21 07:37:34 -04:00
|
|
|
"indices": [
|
|
|
|
{
|
|
|
|
"names": [
|
2017-04-27 07:32:22 -04:00
|
|
|
"logs-*"
|
2017-04-21 07:37:34 -04:00
|
|
|
],
|
|
|
|
"privileges": [
|
|
|
|
"read",
|
2017-05-23 13:18:03 -04:00
|
|
|
"read_cross_cluster"
|
2017-04-21 07:37:34 -04:00
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
-----------------------------------------------------------
|
2017-11-27 10:56:38 -05:00
|
|
|
// CONSOLE
|
2017-04-21 07:37:34 -04:00
|
|
|
|
|
|
|
Finally, create a user on cluster `one` and apply the `cluster_two_logs` role:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
-----------------------------------------------------------
|
|
|
|
POST /_xpack/security/user/alice
|
|
|
|
{
|
|
|
|
"password" : "somepassword",
|
|
|
|
"roles" : [ "cluster_two_logs" ],
|
|
|
|
"full_name" : "Alice",
|
|
|
|
"email" : "alice@example.com",
|
|
|
|
"enabled": true
|
|
|
|
}
|
|
|
|
-----------------------------------------------------------
|
2017-11-27 10:56:38 -05:00
|
|
|
// CONSOLE
|
2017-04-21 07:37:34 -04:00
|
|
|
|
|
|
|
With all of the above setup, the user `alice` is able to search indices in
|
|
|
|
cluster `two` as follows:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
-----------------------------------------------------------
|
2017-04-27 07:32:22 -04:00
|
|
|
GET two:logs-2017.04/_search <1>
|
2017-04-21 07:37:34 -04:00
|
|
|
{
|
|
|
|
"query": {
|
|
|
|
"match_all": {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
-----------------------------------------------------------
|
2017-11-27 10:56:38 -05:00
|
|
|
// CONSOLE
|
|
|
|
// TEST[skip:todo]
|
2017-09-08 11:41:32 -04:00
|
|
|
//TBD: Is there a missing description of the <1> callout above?
|
2017-04-27 07:32:22 -04:00
|
|
|
|
2018-05-23 12:37:55 -04:00
|
|
|
:edit_url: https://github.com/elastic/kibana/edit/{branch}/x-pack/docs/en/security/cross-cluster-kibana.asciidoc
|
2017-09-08 11:41:32 -04:00
|
|
|
include::{xkb-repo-dir}/security/cross-cluster-kibana.asciidoc[]
|