Skip to content

Commit 6f43380

Browse files
author
Adam Locke
authored
[DOCS] Document when security auto configuration is skipped (#86575) (#86839)
* [DOCS] Document when security auto configuration is skipped * Add xpack autoconfiguration parameter and links * Fix typo and add related link 🔗 * Incorporate review feedback * Remove keystore section and instead integrate into previous section (cherry picked from commit acc22de)
1 parent e7d1406 commit 6f43380

File tree

2 files changed

+97
-1
lines changed

2 files changed

+97
-1
lines changed

docs/reference/settings/security-settings.asciidoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ information about disabling {security-features} in specific {kib} instances, see
3333
{kibana-ref}/security-settings-kb.html[{kib} security settings].
3434
--
3535

36+
`xpack.security.autoconfiguration.enabled`::
37+
(<<static-cluster-setting,Static>>)
38+
Defaults to `true`, which enables
39+
<<configuring-stack-security,security auto configuration>>.
40+
+
41+
--
42+
If set to `false`, security auto configuration is disabled, which is not
43+
recommended. When disabled, security is not configured automatically when
44+
starting {es} for the first time, which means that you must
45+
<<manually-configure-security,manually configure security>>.
46+
--
47+
3648
`xpack.security.hide_settings`::
3749
(<<static-cluster-setting,Static>>)
3850
A comma-separated list of settings that are omitted from the results of the

x-pack/docs/en/security/configuring-stack-security.asciidoc

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ minutes. This token automatically applies the security settings from your {es}
1515
cluster, authenticates to {es} with the built-in `kibana` service account, and writes the
1616
security configuration to `kibana.yml`.
1717

18+
NOTE: There are <<stack-skip-auto-configuration,some cases>> where security
19+
can't be configured automatically because the node startup process detects that
20+
the node is already part of a cluster, or that security is already configured or
21+
explicitly disabled.
22+
1823
[discrete]
1924
=== Prerequisites
2025

@@ -72,10 +77,19 @@ bin/kibana
7277
. Enroll {kib} using either interactive or detached mode.
7378

7479
* *Interactive mode* (browser)
75-
80+
7681
.. In your terminal, click the generated link to open {kib} in your browser.
7782
.. In your browser, paste the enrollment token that you copied and click the
7883
button to connect your {kib} instance with {es}.
84+
+
85+
--
86+
[NOTE]
87+
====
88+
{kib} won't enter interactive mode if it detects existing credentials for {es}
89+
(`elasticsearch.username` and `elasticsearch.password`) or an existing URL for
90+
`elasticsearch.hosts`.
91+
====
92+
--
7993

8094
* *Detached mode* (non-browser)
8195
+
@@ -112,3 +126,73 @@ include::{es-ref-dir}/setup/install/security-files-reference.asciidoc[leveloffse
112126
Additionally, when you use the enrollment token to connect {kib} to a secured {es} cluster, the HTTP layer CA certificate is retrieved from {es} and stored in the
113127
{kib} `/data` directory. This file establishes trust between {kib} and the {es}
114128
Certificate Authority (CA) for the HTTP layer.
129+
130+
[discrete]
131+
[[stack-skip-auto-configuration]]
132+
=== Cases when security auto configuration is skipped
133+
When you start {es} for the first time, the node startup process tries to
134+
automatically configure security for you. The process runs some checks to
135+
determine:
136+
137+
* If this is the first time that the node is starting
138+
* Whether security is already configured
139+
* If the startup process can modify the node configuration
140+
141+
If any of those checks fail, there's a good indication that you
142+
<<manually-configure-security,manually configured security>>, or don't want
143+
security to be configured automatically. In these cases, the node starts
144+
normally using the existing configuration.
145+
146+
[discrete]
147+
[[stack-existing-environment-detected]]
148+
==== Existing environment detected
149+
If certain directories already exist, there's a strong indication that the node
150+
was started previously. Similarly, if certain files _don't_ exist, or we can't
151+
read or write to specific files or directories, then we're likely not running as
152+
the user who installed {es} or an administrator imposed restrictions. If any of
153+
the following environment checks are true, security isn't configured
154+
automatically.
155+
156+
The {es} `/data` directory exists and isn't empty::
157+
The existence of this directory is a strong indicator that the node was started
158+
previously, and might already be part of a cluster.
159+
160+
The `elasticsearch.yml` file doesn't exist (or isn't readable), or the `elasticsearch.keystore` isn't readable::
161+
If either of these files aren't readable, we can't determine whether {es} security
162+
features are already enabled. This state can also indicate that the node startup
163+
process isn't running as a user with sufficient privileges to modify the
164+
node configuration.
165+
166+
The {es} configuration directory isn't writable::
167+
This state likely indicates that an administrator made this directory read-only,
168+
or that the user who is starting {es} is not the user that installed {es}.
169+
170+
[discrete]
171+
[[stack-existing-settings-detected]]
172+
==== Existing settings detected
173+
The following settings are incompatible with security auto configuration. If any
174+
of these settings exist, the node startup process skips configuring security
175+
automatically and the node starts normally.
176+
177+
* {ref}/modules-node.html#node-roles[`node.roles`] is set to a value where the
178+
node can't be elected as `master`, or if the node can't hold data
179+
* {ref}/security-settings.html#general-security-settings[`xpack.security.autoconfiguration.enabled`] is set to `false`
180+
* {ref}/security-settings.html#general-security-settings[`xpack.security.enabled`] has a value set
181+
* Any of the
182+
{ref}/security-settings.html#transport-tls-ssl-settings[`xpack.security.transport.ssl.*`] or
183+
{ref}/security-settings.html#http-tls-ssl-settings[`xpack.security.http.ssl.*`]
184+
settings have a value set in the `elasticsearch.yml` configuration file or in
185+
the `elasticsearch.keystore`
186+
* Any of the `discovery.type`, `discovery.seed_hosts`, or
187+
`cluster.initial_master_nodes`
188+
{ref}/modules-discovery-settings.html[discovery and cluster formation settings]
189+
have a value set
190+
+
191+
--
192+
[NOTE]
193+
====
194+
Exceptions are when `discovery.type` is set to `single-node`, or when
195+
`cluster.initial_master_nodes` exists but contains only the name of the current
196+
node.
197+
====
198+
--

0 commit comments

Comments
 (0)