Skip to content

Commit 85bf867

Browse files
authored
Docs for hot-reloadable remote cluster credentials (elastic#105483) (elastic#105545)
Docs PR to accompany elastic#103215. Resolves: ES-7625
1 parent 4ea2ec1 commit 85bf867

5 files changed

+37
-33
lines changed

docs/reference/modules/cluster/remote-clusters-api-key.asciidoc

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ In this model, cross-cluster operations use <<remote_cluster.port,a dedicated
3131
server port>> (remote cluster interface) for communication between clusters. A
3232
remote cluster must enable this port for local clusters to connect. Configure
3333
Transport Layer Security (TLS) for this port to maximize security (as explained
34-
in <<remote-clusters-security-api-key>>).
34+
in <<remote-clusters-security-api-key>>).
3535

3636
The local cluster must trust the remote cluster on the remote cluster interface.
3737
This means that the local cluster trusts the remote cluster's certificate
@@ -65,15 +65,15 @@ information, refer to https://www.elastic.co/subscriptions.
6565
===== On the remote cluster
6666

6767
// tag::remote-cluster-steps[]
68-
. Enable the remote cluster server on every node of the remote cluster. In
68+
. Enable the remote cluster server on every node of the remote cluster. In
6969
`elasticsearch.yml`:
70-
.. Set <<remote-cluster-network-settings,`remote_cluster_server.enabled`>> to
70+
.. Set <<remote-cluster-network-settings,`remote_cluster_server.enabled`>> to
7171
`true`.
7272
.. Configure the bind and publish address for remote cluster server traffic, for
7373
example using <<remote-cluster-network-settings,`remote_cluster.host`>>. Without
7474
configuring the address, remote cluster traffic may be bound to the local
7575
interface, and remote clusters running on other machines can't connect.
76-
.. Optionally, configure the remote server port using
76+
.. Optionally, configure the remote server port using
7777
<<remote_cluster.port,`remote_cluster.port`>> (defaults to `9443`).
7878
. Next, generate a certificate authority (CA) and a server certificate/key pair.
7979
On one of the nodes of the remote cluster, from the directory where {es} has
@@ -86,8 +86,8 @@ been installed:
8686
./bin/elasticsearch-certutil ca --pem --out=cross-cluster-ca.zip --pass CA_PASSWORD
8787
----
8888
+
89-
Replace `CA_PASSWORD` with the password you want to use for the CA. You can
90-
remove the `--pass` option and its argument if you are not deploying to a
89+
Replace `CA_PASSWORD` with the password you want to use for the CA. You can
90+
remove the `--pass` option and its argument if you are not deploying to a
9191
production environment.
9292

9393
.. Unzip the generated `cross-cluster-ca.zip` file. This compressed file
@@ -100,7 +100,7 @@ contains the following content:
100100
|_ ca.key
101101
----
102102

103-
.. Generate a certificate and private key pair for the nodes in the remote
103+
.. Generate a certificate and private key pair for the nodes in the remote
104104
cluster:
105105
+
106106
[source,sh]
@@ -183,13 +183,16 @@ Replace `ALIAS` with the same name that you will use to create the remote cluste
183183
later. When prompted, enter the encoded cross-cluster API key created on the
184184
remote cluster earlier.
185185

186-
. Restart the local cluster to load the keystore change.
186+
. Restart the local cluster to load changes to the keystore and settings.
187+
188+
**Note:** If you are configuring only the cross-cluster API key, you can call the <<cluster-nodes-reload-secure-settings>> API, instead of restarting the cluster.
189+
Configuring the `remote_cluster_client` settings in `elasticsearch.yml` still requires a restart.
187190

188191
[[remote-clusters-connect-api-key]]
189192
==== Connect to a remote cluster
190193

191194
:trust-mechanism: api-key
192195
include::remote-clusters-connect.asciidoc[]
193-
:!trust-mechanism:
196+
:!trust-mechanism:
194197

195198
include::{es-repo-dir}/security/authentication/remote-clusters-privileges-api-key.asciidoc[leveloffset=+1]

docs/reference/modules/cluster/remote-clusters-migration.asciidoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ include::remote-clusters-api-key.asciidoc[tag=remote-cluster-steps]
5151
[[remote-clusters-migration-stop]]
5252
==== Stop cross-cluster operations
5353

54-
On the local cluster, stop any persistent tasks that refer to the remote
54+
On the local cluster, stop any persistent tasks that refer to the remote
5555
cluster:
5656

5757
* Use the <<stop-transform>> API to stop any transforms.
@@ -74,13 +74,13 @@ roles used for cross-cluster operations. You should be able to copy these
7474
privileges from the original roles on the remote cluster, where they are defined
7575
under the certification based security model.
7676
** The roles on the local cluster can't exceed the `access` privilege granted by
77-
the cross-cluster API key. Any extra local privileges will be suppressed by the
77+
the cross-cluster API key. Any extra local privileges will be suppressed by the
7878
cross-cluster API key's privileges.
7979
** No update is needed if the {ccr} or {ccs} tasks have been configured with a
8080
`superuser` role. The `superuser` role is automatically updated to allow access
8181
to all remote indices.
8282
** Tasks that are run as regular users with named roles are immediately updated
83-
with the new privileges. A task will load a new definition the next time it
83+
with the new privileges. A task will load a new definition the next time it
8484
runs.
8585
** You need to restart tasks that are run using an API key (done in a later
8686
step).
@@ -123,7 +123,7 @@ created on the remote cluster earlier.
123123
. If you've dynamically configured the remote cluster (via the cluster settings
124124
API):
125125

126-
.. Restart the local cluster to load changes to the keystore.
126+
.. Restart the local cluster to load changes to the keystore and settings.
127127

128128
.. Re-add the remote cluster. Use the same remote cluster alias, and change the
129129
transport port into the remote cluster port. For example:
@@ -188,7 +188,7 @@ remote cluster:
188188
----
189189
// TEST[skip:TODO]
190190
<1> The remote cluster is connected.
191-
<2> If present, indicates the remote cluster has connected using API key
191+
<2> If present, indicates the remote cluster has connected using API key
192192
authentication.
193193

194194
[[remote-clusters-migration-resume]]
@@ -204,7 +204,7 @@ task will update the task with the updated API key.
204204
* Use the <<start-transform>> API to start any transforms.
205205
* Use the <<ml-open-job>> API to open any anomaly detection jobs.
206206
* Use the <<ccr-post-resume-follow>> API to resume any auto-follow {ccr}.
207-
* Use the <<ccr-resume-auto-follow-pattern>> API to resume any manual {ccr} or
207+
* Use the <<ccr-resume-auto-follow-pattern>> API to resume any manual {ccr} or
208208
existing indices that were created from the auto-follow pattern.
209209

210210
[[remote-clusters-migration-disable-cert]]
@@ -232,8 +232,8 @@ or distributed, is no longer trusted.
232232
Another solution is to apply IP filters to the transport interface, blocking
233233
traffic from outside the cluster.
234234

235-
. Optionally, delete any roles on the remote cluster that were only used for
236-
cross-cluster operations. These roles are no longer used under the API key based
235+
. Optionally, delete any roles on the remote cluster that were only used for
236+
cross-cluster operations. These roles are no longer used under the API key based
237237
security model.
238238

239239
[[remote-clusters-migration-rollback]]
@@ -252,7 +252,7 @@ the migration.
252252
. On each node, remove the `remote_cluster_client.ssl.*` settings from
253253
`elasticsearch.yml`.
254254

255-
. Restart the local cluster to apply changes to the keystore and
255+
. Restart the local cluster to apply changes to the keystore and
256256
`elasticsearch.yml`.
257257

258258
. On the local cluster, apply the original remote cluster settings. If the
@@ -263,4 +263,4 @@ remote cluster connection has been configured statically (using the
263263
local cluster has connected to the remote cluster. The response should have
264264
`"connected": true` and not have `"cluster_credentials": "::es_redacted::"`.
265265

266-
. Restart any persistent tasks that you've stopped earlier.
266+
. Restart any persistent tasks that you've stopped earlier.

docs/reference/modules/cluster/remote-clusters-settings.asciidoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ mode are described separately.
6565
is used as the fallback setting.
6666

6767

68-
`cluster.remote.<cluster_alias>.credentials` (<<secure-settings,Secure>>)::
68+
`cluster.remote.<cluster_alias>.credentials` (<<secure-settings,Secure>>, <<reloadable-secure-settings,Reloadable>>)::
69+
[[remote-cluster-credentials-setting]]
6970

7071
beta:[]
7172
Per cluster setting for configuring <<remote-clusters-api-key,remote clusters with the API Key based model>>.
@@ -75,6 +76,8 @@ beta:[]
7576
The presence (or not) of this setting determines which model a remote cluster uses.
7677
If present, the remote cluster uses the API key based model.
7778
Otherwise, it uses the certificate based model.
79+
If the setting is added, removed, or updated in the <<secure-settings,{es} keystore>> and reloaded via the
80+
<<cluster-nodes-reload-secure-settings>> API, the cluster will automatically rebuild its connection to the remote.
7881

7982
[[remote-cluster-sniff-settings]]
8083
==== Sniff mode remote cluster settings

docs/reference/modules/cluster/remote-clusters-troubleshooting.asciidoc

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ incoming cross-cluster requests by default, while it is ready to send outgoing
3131
cross-cluster requests. Ensure you've enabled the remote cluster server on every
3232
node of the remote cluster. In `elasticsearch.yml`:
3333

34-
* Set <<remote-cluster-network-settings,`remote_cluster_server.enabled`>> to
34+
* Set <<remote-cluster-network-settings,`remote_cluster_server.enabled`>> to
3535
`true`.
3636
* Configure the bind and publish address for remote cluster server traffic, for
3737
example using <<remote-cluster-network-settings,`remote_cluster.host`>>. Without
3838
configuring the address, remote cluster traffic may be bound to the local
3939
interface, and remote clusters running on other machines can't connect.
40-
* Optionally, configure the remote server port using
40+
* Optionally, configure the remote server port using
4141
<<remote_cluster.port,`remote_cluster.port`>> (defaults to `9443`).
4242

4343
[[remote-clusters-troubleshooting-common-issues]]
@@ -73,7 +73,7 @@ org.elasticsearch.transport.ConnectTransportException: [][192.168.0.42:9443] *co
7373
====== Resolution
7474

7575
* Check the host and port for the remote cluster are correct.
76-
* Ensure the <<remote-clusters-troubleshooting-enable-server,remote cluster
76+
* Ensure the <<remote-clusters-troubleshooting-enable-server,remote cluster
7777
server is enabled>> on the remote cluster.
7878
* Ensure no firewall is blocking the communication.
7979

@@ -108,11 +108,11 @@ cause of the failure. For example:
108108

109109
* Is the remote cluster certificate not signed by a trusted CA? This is the most
110110
likely cause.
111-
* Is hostname verification failing?
111+
* Is hostname verification failing?
112112
* Is the certificate expired?
113113

114114
Once you know the cause, you should be able to fix it by adjusting the remote
115-
cluster related SSL settings on either the local cluster or the remote cluster.
115+
cluster related SSL settings on either the local cluster or the remote cluster.
116116

117117
Often, the issue is on the local cluster. For example, fix it by configuring necessary
118118
trusted CAs (`xpack.security.remote_cluster_client.ssl.certificate_authorities`).
@@ -275,7 +275,7 @@ This does not show up in the logs of the remote cluster.
275275
====== Resolution
276276

277277
Add the cross-cluster API key to {es} keystore on every node of the local
278-
cluster. Restart the local cluster to reload the keystore.
278+
cluster. Use the <<cluster-nodes-reload-secure-settings>> API to reload the keystore.
279279

280280
[[remote-clusters-troubleshooting-wrong-api-key-type]]
281281
===== Using the wrong API key type
@@ -302,8 +302,7 @@ This does not show up in the logs of the remote cluster.
302302
Ask the remote cluster administrator to create and distribute a
303303
<<security-api-create-cross-cluster-api-key,cross-cluster API key>>. Replace the
304304
existing API key in the {es} keystore with this cross-cluster API key on every
305-
node of the local cluster. Restart the local cluster for keystore changes to
306-
take effect.
305+
node of the local cluster. Use the <<cluster-nodes-reload-secure-settings>> API to reload the keystore.
307306

308307
[[remote-clusters-troubleshooting-non-valid-api-key]]
309308
===== Invalid API key
@@ -334,15 +333,14 @@ The remote cluster logs `Authentication using apikey failed`:
334333
Ask the remote cluster administrator to create and distribute a
335334
<<security-api-create-cross-cluster-api-key,cross-cluster API key>>. Replace the
336335
existing API key in the {es} keystore with this cross-cluster API key on every
337-
node of the local cluster. Restart the local cluster for keystore changes to
338-
take effect.
336+
node of the local cluster. Use the <<cluster-nodes-reload-secure-settings>> API to reload the keystore.
339337

340338
[[remote-clusters-troubleshooting-insufficient-privileges]]
341339
===== API key or local user has insufficient privileges
342340

343341
The effective permission for a local user running requests on a remote cluster
344342
is determined by the intersection of the cross-cluster API key's privileges and
345-
the local user's `remote_indices` privileges.
343+
the local user's `remote_indices` privileges.
346344

347345
====== Symptom
348346

@@ -366,8 +364,7 @@ This does not show up in any logs.
366364
create and distribute a
367365
<<security-api-create-cross-cluster-api-key,cross-cluster API key>>. Replace the
368366
existing API key in the {es} keystore with this cross-cluster API key on every
369-
node of the local cluster. Restart the local cluster for keystore changes to
370-
take effect.
367+
node of the local cluster. Use the <<cluster-nodes-reload-secure-settings>> API to reload the keystore.
371368

372369
[[remote-clusters-troubleshooting-no-remote_indices-privileges]]
373370
===== Local user has no `remote_indices` privileges

docs/reference/setup/secure-settings.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,4 @@ There are reloadable secure settings for:
6464
* <<ref-jwt-settings, JWT realm>>
6565
* <<ref-ad-settings, Active Directory realm>>
6666
* <<ref-ldap-settings, LDAP realm>>
67+
* <<remote-cluster-credentials-setting, Remote cluster credentials for the API key based security model>>

0 commit comments

Comments
 (0)