Skip to content

Commit e3e69ae

Browse files
[DOCS] Reloadable Secure Settings (#31713)
Docs on reloadable secure settings for plugins #29135 .
1 parent d27bd36 commit e3e69ae

File tree

5 files changed

+79
-10
lines changed

5 files changed

+79
-10
lines changed

docs/plugins/discovery-ec2.asciidoc

+4-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ bin/elasticsearch-keystore add discovery.ec2.secret_key
3737
The following are the available discovery settings. All should be prefixed with `discovery.ec2.`.
3838
Those that must be stored in the keystore are marked as `Secure`.
3939

40-
4140
`access_key`::
4241

4342
An ec2 access key. The `secret_key` setting must also be specified. (Secure)
@@ -122,6 +121,10 @@ Defaults to `private_ip`.
122121
How long the list of hosts is cached to prevent further requests to the AWS API.
123122
Defaults to `10s`.
124123

124+
*All* secure settings of this plugin are {ref}/secure-settings.html#reloadable-secure-settings[reloadable].
125+
After you reload the settings, an aws sdk client with the latest settings
126+
from the keystore will be used.
127+
125128
[IMPORTANT]
126129
.Binding the network host
127130
==============================================

docs/plugins/repository-azure.asciidoc

+14-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ include::install_remove.asciidoc[]
1111
==== Azure Repository
1212

1313
To enable Azure repositories, you have first to define your azure storage settings as
14-
{ref}/secure-settings.html[secured settings]:
14+
{ref}/secure-settings.html[secure settings], before starting up the node:
1515

1616
[source,sh]
1717
----------------------------------------------------------------
@@ -20,6 +20,7 @@ bin/elasticsearch-keystore add azure.client.default.key
2020
----------------------------------------------------------------
2121

2222
Where `account` is the azure account name and `key` the azure secret key.
23+
These settings are used by the repository's internal azure client.
2324

2425
Note that you can also define more than one account:
2526

@@ -31,7 +32,18 @@ bin/elasticsearch-keystore add azure.client.secondary.account
3132
bin/elasticsearch-keystore add azure.client.secondary.key
3233
----------------------------------------------------------------
3334

34-
`default` is the default account name which will be used by a repository unless you set an explicit one.
35+
`default` is the default account name which will be used by a repository,
36+
unless you set an explicit one in the
37+
<<repository-azure-repository-settings, repository settings>>.
38+
39+
Both `account` and `key` storage settings are
40+
{ref}/secure-settings.html#reloadable-secure-settings[reloadable]. After you
41+
reload the settings, the internal azure clients, which are used to transfer the
42+
snapshot, will utilize the latest settings from the keystore.
43+
44+
NOTE: In progress snapshot/restore jobs will not be preempted by a *reload*
45+
of the storage secure settings. They will complete using the client as it was built
46+
when the operation started.
3547

3648
You can set the client side timeout to use when making any single request. It can be defined globally, per account or both.
3749
It's not set by default which means that Elasticsearch is using the

docs/plugins/repository-gcs.asciidoc

+9
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ PUT _snapshot/my_gcs_repository
112112
// CONSOLE
113113
// TEST[skip:we don't have gcs setup while testing this]
114114

115+
The `credentials_file` settings are {ref}/secure-settings.html#reloadable-secure-settings[reloadable].
116+
After you reload the settings, the internal `gcs` clients, used to transfer the
117+
snapshot contents, will utilize the latest settings from the keystore.
118+
119+
120+
NOTE: In progress snapshot/restore jobs will not be preempted by a *reload*
121+
of the client's `credentials_file` settings. They will complete using the client
122+
as it was built when the operation started.
123+
115124
[[repository-gcs-client]]
116125
==== Client Settings
117126

docs/plugins/repository-s3.asciidoc

+21-7
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ PUT _snapshot/my_s3_repository
3535
==== Client Settings
3636

3737
The client used to connect to S3 has a number of settings available. Client setting names are of
38-
the form `s3.client.CLIENT_NAME.SETTING_NAME` and specified inside `elasticsearch.yml`. The
39-
default client name looked up by a `s3` repository is called `default`, but can be customized
40-
with the repository setting `client`. For example:
38+
the form `s3.client.CLIENT_NAME.SETTING_NAME`. The default client name, which is looked up by
39+
an `s3` repository, is called `default`. It can be modified using the
40+
<<repository-s3-repository, repository setting>> `client`. For example:
4141

4242
[source,js]
4343
----
@@ -53,17 +53,31 @@ PUT _snapshot/my_s3_repository
5353
// CONSOLE
5454
// TEST[skip:we don't have s3 setup while testing this]
5555

56-
Some settings are sensitive and must be stored in the {ref}/secure-settings.html[elasticsearch keystore].
57-
For example, to use explicit AWS access keys:
56+
Most client settings are specified inside `elasticsearch.yml`, but some are
57+
sensitive and must be stored in the {ref}/secure-settings.html[elasticsearch keystore].
58+
59+
For example, before you start the node, run these commands to add AWS access
60+
key settings to the keystore:
5861

5962
[source,sh]
6063
----
6164
bin/elasticsearch-keystore add s3.client.default.access_key
6265
bin/elasticsearch-keystore add s3.client.default.secret_key
6366
----
6467

65-
The following are the available client settings. Those that must be stored in the keystore
66-
are marked as `Secure`.
68+
*All* client secure settings of this plugin are
69+
{ref}/secure-settings.html#reloadable-secure-settings[reloadable]. After you
70+
reload the settings, the internal `s3` clients, used to transfer the snapshot
71+
contents, will utilize the latest settings from the keystore. Any existing `s3`
72+
repositories, as well as any newly created ones, will pick up the new values
73+
stored in the keystore.
74+
75+
NOTE: In progress snapshot/restore tasks will not be preempted by a *reload*
76+
of the client's secure settings. The task will complete using the client as it
77+
was built when the operation started.
78+
79+
The following is the list of all the available client settings.
80+
Those that must be stored in the keystore are marked as `Secure` and are *reloadable*.
6781

6882
`access_key`::
6983

docs/reference/setup/secure-settings.asciidoc

+31
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,34 @@ To remove a setting from the keystore, use the `remove` command:
7575
bin/elasticsearch-keystore remove the.setting.name.to.remove
7676
----------------------------------------------------------------
7777

78+
[float]
79+
[[reloadable-secure-settings]]
80+
=== Reloadable secure settings
81+
82+
Just like the settings values in `elasticsearch.yml`, changes to the
83+
keystore contents are not automatically applied to the running
84+
elasticsearch node. Re-reading settings requires a node restart.
85+
However, certain secure settings are marked as *reloadable*. Such settings
86+
can be re-read and applied on a running node.
87+
88+
The values of all secure settings, *reloadable* or not, must be identical
89+
across all cluster nodes. After making the desired secure settings changes,
90+
using the `bin/elasticsearch-keystore add` command, call:
91+
[source,js]
92+
----
93+
POST _nodes/reload_secure_settings
94+
{
95+
"secure_settings_password": ""
96+
}
97+
----
98+
// CONSOLE
99+
This API will decrypt and re-read the entire keystore, on every cluster node,
100+
but only the *reloadable* secure settings will be applied. Changes to other
101+
settings will not go into effect until the next restart. Once the call returns,
102+
the reload has been completed, meaning that all internal datastructures dependent
103+
on these settings have been changed. Everything should look as if the settings
104+
had the new value from the start.
105+
106+
When changing multiple *reloadable* secure settings, modify all of them, on
107+
each cluster node, and then issue a `reload_secure_settings` call, instead
108+
of reloading after each modification.

0 commit comments

Comments
 (0)