Skip to content

Commit 62c9430

Browse files
ywangdtvernumlcawlAdam Locke
authored
Documentation for operator privileges (#68964) (#70193)
Add documentation for operator privilegs. The docs cover features delivered by phase 1 (#65256) and 2 (#66684). Co-authored-by: Tim Vernum <[email protected]> Co-authored-by: lcawl <[email protected]> Co-authored-by: Adam Locke <[email protected]>
1 parent 5a76249 commit 62c9430

6 files changed

+200
-0
lines changed

x-pack/docs/en/security/index.asciidoc

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ IP filtering, and auditing.
1818
* <<encrypting-communications>>
1919
* <<ip-filtering>>
2020
* <<ccs-clients-integrations>>
21+
* <<operator-privileges>>
2122
* <<security-getting-started>>
2223
* <<encrypting-internode-communications>>
2324
* <<security-troubleshooting>>
@@ -33,6 +34,7 @@ include::auditing/index.asciidoc[]
3334
include::securing-communications/index.asciidoc[]
3435
include::using-ip-filtering.asciidoc[]
3536
include::ccs-clients-integrations/index.asciidoc[]
37+
include::operator-privileges/index.asciidoc[]
3638
include::get-started-security.asciidoc[]
3739
include::securing-communications/tutorial-tls-intro.asciidoc[]
3840
include::troubleshooting.asciidoc[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
[role="xpack"]
2+
[testenv="enterprise"]
3+
[[configure-operator-privileges]]
4+
=== Configure operator privileges
5+
6+
include::operator-privileges-designed-for-note.asciidoc[]
7+
8+
Before you can use operator privileges, you must
9+
<<enable-operator-privileges, enable the feature>> on all nodes in the cluster
10+
and <<designate-operator-users,designate operator users>>.
11+
12+
[[enable-operator-privileges]]
13+
==== Enable operator privileges
14+
15+
In order to use the operator privileges feature, it must be enabled explicitly
16+
on each node in the cluster. Add the following setting in each
17+
`elasticsearch.yml` file:
18+
19+
[source,yaml]
20+
----------------------------
21+
xpack.security.operator_privileges.enabled: true
22+
----------------------------
23+
24+
If the node is already running before you make this change, you must restart
25+
the node for the feature to take effect.
26+
27+
WARNING: The feature needs to be either enabled or disabled consistently across
28+
all nodes in a cluster. Otherwise, you can get inconsistent behaviour depending
29+
on which node first receives a request and which node executes it.
30+
31+
When operator privileges are enabled on a cluster,
32+
<<operator-only-functionality,specific functionalities>> are restricted and can
33+
be executed only by users who have been explicitly designated as operator users.
34+
If a regular user attempts to execute these functionalities (even if they have
35+
the `superuser` role), a security exception occurs.
36+
37+
[[designate-operator-users]]
38+
==== Designate operator users
39+
40+
Operator users are just normal {es} users with special rights to perform
41+
operator-only functionalities. They are specified in an `operator_users.yml`
42+
file, which is located in the config directory (as defined by the `ES_PATH_CONF`
43+
environment variable). Similar to
44+
<<file-realm-configuration,other security config files>>, the
45+
`operator_users.yml` file is local to a node and does not apply globally to the
46+
cluster. This means, in most cases, the same file should be distributed or
47+
copied to all nodes in a cluster.
48+
49+
The `operator_users.yml` file defines a set of criteria that an authenticating
50+
user must match to be considered as an operator user. The following snippet
51+
shows an example of such a file:
52+
53+
[source,yaml]
54+
-----------------------------------
55+
operator: <1>
56+
- usernames: ["system_agent_1","system_agent_2"] <2>
57+
realm_type: "file" <3>
58+
auth_type: "realm" <4>
59+
-----------------------------------
60+
<1> A fixed value of `operator` signals the beginning of the definition.
61+
<2> A list of user names allowed for operator users. This field is mandatory.
62+
<3> The type of the authenticating realm allowed for operator users. The default
63+
and only acceptable value is <<file-realm,`file`>>.
64+
<4> The authentication type allowed for operator users. The default and only
65+
acceptable value is `realm`.
66+
67+
You must specify at least the `usernames` field. If no other fields are
68+
specified, their default values are used. All fields must be matched for a user
69+
to be qualified as an operator user. You can also specify multiple groups of
70+
criteria. This is currently not very useful since this feature does not yet
71+
support other realms or authentication types.
72+
73+
There are also two implicit rules that affect which users are operator users:
74+
75+
1. If the authenticating user <<run-as-privilege,runs as>> another user, neither
76+
of them are considered to be operator users.
77+
2. All <<internal-users>> are implicitly operator users.
78+
79+
IMPORTANT: After a user is designated as an operator user, they are still
80+
subject to regular <<authorization,RBAC user authorization>> checks. That is to
81+
say, in addition to specifying that a user is an operator user, you must also
82+
grant them the necessary {es} roles to perform their tasks. Consequently, it is
83+
entirely possible that an operator user can encounter an "access denied" error
84+
and fail to perform certain actions due to RBAC check failures. In short, an
85+
operator user is *not* automatically a `superuser`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[role="xpack"]
2+
[testenv="enterprise"]
3+
[[operator-privileges]]
4+
== Operator privileges
5+
6+
include::operator-privileges-designed-for-note.asciidoc[]
7+
8+
With a typical {es} deployment, people who administer the cluster also operate
9+
the cluster at the infrastructure level. User authorization based on
10+
<<authorization,role-based access control (RBAC)>> is effective and reliable for
11+
this environment. However, in more managed environments, such as
12+
{ess-trial}[{ess}], there is a distinction between the operator of the cluster
13+
infrastructure and the administrator of the cluster.
14+
15+
Operator privileges limit some functionality to operator users only. Operator
16+
users are just regular Elasticsearch users with access to specific
17+
<<operator-only-functionality,operator-only functionality>>. These
18+
privileges are not available to cluster administrators, even if they log in as
19+
a highly privileged user such as the `elastic` user or another user with the
20+
superuser role. By limiting system access, operator privileges enhance the
21+
Elasticsearch security model while safeguarding user capabilities.
22+
23+
24+
include::configure-operator-privileges.asciidoc[]
25+
26+
include::operator-only-functionality.asciidoc[]
27+
28+
include::operator-only-snapshot-and-restore.asciidoc[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[role="xpack"]
2+
[testenv="enterprise"]
3+
[[operator-only-functionality]]
4+
=== Operator-only functionality
5+
6+
include::operator-privileges-designed-for-note.asciidoc[]
7+
8+
Operator privileges provide protection for APIs and dynamic cluster settings.
9+
Any API or cluster setting that is protected by operator privileges is known as
10+
_operator-only functionality_. When the operator privileges feature is enabled,
11+
operator-only APIs can be executed only by operator users. Likewise,
12+
operator-only settings can be updated only by operator users. The list of
13+
operator-only APIs and dynamic cluster settings are pre-determined in the
14+
codebase. The list may evolve in future releases but it is otherwise fixed in a
15+
given {es} version.
16+
17+
[[operator-only-apis]]
18+
==== Operator-only APIs
19+
20+
* <<voting-config-exclusions>>
21+
* <<delete-license>>
22+
* <<update-license>>
23+
* <<autoscaling-put-autoscaling-policy>>
24+
* <<autoscaling-delete-autoscaling-policy>>
25+
* <<repo-analysis-api>>
26+
27+
[[operator-only-dynamic-cluster-settings]]
28+
==== Operator-only dynamic cluster settings
29+
30+
* All <<ip-filtering,IP filtering>> settings
31+
* The following the dynamic <<ml-settings,machine learning settings>>:
32+
- `xpack.ml.node_concurrent_job_allocations`
33+
- `xpack.ml.max_machine_memory_percent`
34+
- `xpack.ml.use_auto_machine_memory_percent`
35+
- `xpack.ml.max_lazy_ml_nodes`
36+
- `xpack.ml.process_connect_timeout`
37+
- `xpack.ml.nightly_maintenance_requests_per_second`
38+
- `xpack.ml.max_ml_node_size`
39+
- `xpack.ml.enable_config_migration`
40+
- `xpack.ml.persist_results_max_retries`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[role="xpack"]
2+
[testenv="enterprise"]
3+
[[operator-only-snapshot-and-restore]]
4+
=== Operator privileges for snapshot and restore
5+
6+
include::operator-privileges-designed-for-note.asciidoc[]
7+
8+
Invoking <<operator-only-apis,operator-only APIs>> or updating
9+
<<operator-only-dynamic-cluster-settings,operator-only dynamic cluster settings>>
10+
typically results in changes in the cluster state. The cluster state can be
11+
included in a cluster <<snapshot-restore,snapshot>>. Snapshots are a great way
12+
to preserve the data of a cluster, which can later be restored to bootstrap a
13+
new cluster, perform migration, or disaster recovery, for example. In a
14+
traditional self-managed environment, the intention is for the restore process
15+
to copy the entire cluster state over when requested. However, in a more
16+
managed environment, such as {ess-trial}[{ess}], data that is associated with
17+
<<operator-only-functionality,operator-only functionality>> is explicitly
18+
managed by the infrastructure code.
19+
20+
Restoring snapshot data associated with
21+
operator-only functionality could be problematic
22+
because:
23+
24+
1. A snapshot could contain incorrect values for operator-only functionalities.
25+
For example, the snapshot could have been taken in a different cluster where
26+
requirements are different or the operator privileges feature is not enabled.
27+
Restoring data associated with operator-only functionality breaks the guarantee
28+
of operator privileges.
29+
2. Even when the infrastructure code can correct the values immediately after
30+
a restore, there will always be a short period of time when the cluster could be
31+
in an inconsistent state.
32+
3. The infrastructure code prefers to configure operator-only functionality from
33+
a single place, that is to say, through API calls.
34+
35+
Therefore,
36+
<<configure-operator-privileges,*when the operator privileges feature is enabled*>>,
37+
snapshot data that is associated with any operator-only functionality is *not*
38+
restored.
39+
40+
NOTE: That information is still included when taking a snapshot so that all data
41+
is always preserved.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[NOTE]
2+
The operator privileges feature is designed for indirect use by {ess-trial}[{ess}],
3+
{ece-ref}[{ece}], and {eck-ref}[Elastic Cloud on Kubernetes]. Direct use is not
4+
supported.

0 commit comments

Comments
 (0)