Skip to content

Commit f20aee7

Browse files
author
Christoph Wurm
authored
Docs: Update writer role with least required privileges (#13849)
Updates the writer role documentation based on #13847 and #13848. Also corrects some mistakes. 1. Changes `read from` to the correct `write to` (Beats does not read from indices). 2. Setting `setup.template.enabled` to `false` is no longer necessary after #13847. 3. Setting `setup.ilm.overwrite` to `false` is unnecessary if `setup.ilm.check_exists` is already `false` (even today). 4. Adds a note about only `monitor` and `create_doc` being always necessary, explicitly calling out the most secure configuration (following #13847 and #13848). 5. Correct what `monitor` is for: It's for checking things like cluster version and license, not "sending monitor info". 6. Replaces `manage_pipeline` with the read-only `cluster:admin/ingest/pipeline/get`. Unfortunately, there is no read-only cluster role for pipelines, so it requires this privilege. But better than the very permissive `manage_pipeline` that allows changing any pipeline. 7. Changes `index` to the more restrictive, append-only `create_doc` (introduced in elastic/elasticsearch#45806).
1 parent 279cc7e commit f20aee7

File tree

1 file changed

+60
-46
lines changed

1 file changed

+60
-46
lines changed

libbeat/docs/security/users.asciidoc

+60-46
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,32 @@ the following privileges:
4141
+
4242
[options="header"]
4343
|====
44-
|Privileges | Why needed?
44+
|Type | Privilege | Purpose
4545

46+
|Cluster
4647
|`monitor`
47-
|Send monitoring data to the cluster
48+
|Retrieve cluster details (e.g. version)
4849

4950
ifndef::no_ilm[]
51+
|Cluster
5052
|`manage_ilm`
5153
|Set up and manage index lifecycle management (ILM) policy
5254
endif::no_ilm[]
5355

5456
ifdef::has_ml_jobs[]
57+
|Cluster
5558
|`manage_ml`
56-
|Set up machine learning job configurations
59+
|Set up Machine Learning job configurations
5760
endif::has_ml_jobs[]
5861

62+
|Index
5963
|`manage` on +{beat_default_index_prefix}-*+ indices
6064
|Set up aliases used by ILM
6165

6266
ifdef::has_ml_jobs[]
67+
|Index
6368
|`read` on +{beat_default_index_prefix}-*+ indices
64-
|Read {beatname_uc} indices in order to set up machine learning jobs
69+
|Read {beatname_uc} indices in order to set up Machine Learning jobs
6570
endif::has_ml_jobs[]
6671
|====
6772
+
@@ -76,7 +81,7 @@ need to set up {beatname_uc}:
7681
+
7782
[options="header"]
7883
|====
79-
|Roles | Why needed?
84+
|Role | Purpose
8085

8186
|`kibana_user`
8287
|Load dependencies, such as example dashboards, if available, into {kib}
@@ -122,21 +127,23 @@ If you don't use the +{beat_default_index_prefix}_system+ user:
122127
+
123128
[options="header"]
124129
|====
125-
|Privileges | Why needed?
130+
|Type | Privilege | Purpose
126131

132+
|Cluster
127133
|`monitor`
128-
|Send monitoring info
129-
130-
|`kibana_user`
131-
|Use {kib}
134+
|Retrieve cluster details (e.g. version)
132135
|====
133136

134-
. Assign the *monitoring role*, along with the following built-in role, to
137+
. Assign the *monitoring role*, along with the following built-in roles, to
135138
users who need to monitor {beatname_uc}:
136139
+
137140
[options="header"]
138141
|====
139-
|Role | Why needed?
142+
|Role | Purpose
143+
144+
|`kibana_user`
145+
|Use {kib}
146+
140147
|`monitoring_user`
141148
|Use *Stack Monitoring* in {kib} to monitor {beatname_uc}
142149
|====
@@ -164,19 +171,22 @@ information.
164171
+
165172
[options="header"]
166173
|====
167-
|Role | Why needed?
174+
|Role | Purpose
175+
168176
|`remote_monitoring_collector`
169177
|Collect monitoring metrics from {beatname_uc}
178+
170179
|`remote_monitoring_agent`
171180
|Send monitoring data to the monitoring cluster
172181
|====
173182

174183
. Assign the following role to users who will view the monitoring data in
175184
{kib}:
176-
185+
+
177186
[options="header"]
178187
|====
179-
|Role | Why needed?
188+
|Role | Purpose
189+
180190
|`monitoring_user`
181191
|Use *Stack Monitoring* in {kib} to monitor {beatname_uc}
182192
|====
@@ -185,71 +195,73 @@ endif::serverless[]
185195
[[privileges-to-publish-events]]
186196
==== Grant privileges and roles needed for publishing
187197

188-
Users who publish events to {es} need to create and read from {beatname_uc}
198+
Users who publish events to {es} need to create and write to {beatname_uc}
189199
indices. To minimize the privileges required by the writer role, you can use the
190-
<<privileges-to-setup-beats,setup role>> to pre-load dependencies. Then turn off
191-
setup options in the {beatname_uc} config file before running {beatname_uc} to
192-
publish events. For example:
200+
<<privileges-to-setup-beats,setup role>> to pre-load dependencies.
193201

194202
ifndef::no_ilm[]
195-
[source,yaml]
196-
----
197-
setup.template.enabled: false
198-
setup.ilm.check_exists: false
199-
setup.ilm.overwrite: false <1>
200-
----
201-
<1> Omit `ilm.check_exists` and `ilm.overwrite` if ILM is disabled.
202-
endif::no_ilm[]
203+
When using ILM, turn off the ILM setup check in the {beatname_uc} config file before
204+
running {beatname_uc} to publish events:
203205

204-
ifdef::no_ilm[]
205206
[source,yaml]
206207
----
207-
setup.template.enabled: false
208+
setup.ilm.check_exists: false
208209
----
209210
endif::no_ilm[]
210211

211212
To grant the required privileges:
212213

213-
. Create a *writer role*, called something like +{beat_default_index_prefix}_writer+, that has
214-
the following privileges (this list assumes the setup options shown earlier are
215-
set to `false`):
214+
. Create a *writer role*, called something like +{beat_default_index_prefix}_writer+,
215+
that has the following privileges:
216+
+
217+
NOTE: The `monitor` cluster privilege and the `create_doc` privilege on
218+
+{beat_default_index_prefix}-*+ indices are required in every configuration.
216219
+
217220
[options="header"]
218221
|====
219-
|Privileges | Why needed?
222+
|Type | Privilege | Purpose
220223

221224
ifndef::apm-server[]
225+
|Cluster
222226
|`monitor`
223-
|Send monitoring info
227+
|Retrieve cluster details (e.g. version)
224228
endif::apm-server[]
225229

226230
ifndef::no_ilm[]
231+
|Cluster
227232
|`read_ilm`
228-
|Read the ILM policy when connecting to clusters that support ILM
233+
| Read the ILM policy when connecting to clusters that support ILM.
234+
Not needed when `setup.ilm.check_exists` is `false`.
229235
endif::no_ilm[]
230236

231237
ifeval::["{beatname_lc}"=="filebeat"]
232-
|`manage_pipeline`
233-
|Load ingest pipelines used by modules
238+
|Cluster
239+
|`cluster:admin/ingest/pipeline/get`
240+
|Check for ingest pipelines used by modules. Needed when using modules.
234241
endif::[]
235242

243+
|Index
244+
|`create_doc` on +{beat_default_index_prefix}-*+ indices
245+
|Write events into {es}
246+
236247
ifndef::no_ilm[]
248+
|Index
237249
|`view_index_metadata` on +{beat_default_index_prefix}-*+ indices
238-
|Check for alias when connecting to clusters that support ILM
250+
|Check for alias when connecting to clusters that support ILM.
251+
Not needed when `setup.ilm.check_exists` is `false`.
239252
endif::no_ilm[]
240253

241-
|`index` on +{beat_default_index_prefix}-*+ indices
242-
|Index events into {es}
243-
254+
|Index
244255
|`create_index` on +{beat_default_index_prefix}-*+ indices
245-
|Create daily indices when connecting to clusters that do not support ILM
256+
|Create daily indices when connecting to clusters that do not support ILM.
257+
Not needed when using ILM.
246258
|====
247259
ifndef::apm-server[]
248260
+
249261
Omit any privileges that aren't relevant in your environment.
250262
endif::apm-server[]
251263

252-
. Assign the *writer role* to users who will index events into {es}.
264+
. Assign the *writer role* to users who will index events into {es}.
253265

254266
[[kibana-user-privileges]]
255267
==== Grant privileges and roles needed to read {beatname_uc} data
@@ -270,8 +282,9 @@ the following privilege:
270282
+
271283
[options="header"]
272284
|====
273-
|Privilege | Why needed?
285+
|Type | Privilege | Purpose
274286

287+
|Index
275288
|`read` on +{beat_default_index_prefix}-*+ indices
276289
|Read data indexed by {beatname_uc}
277290
|====
@@ -281,7 +294,7 @@ users who need to read {beatname_uc} data:
281294
+
282295
[options="header"]
283296
|====
284-
|Roles | Why needed?
297+
|Role | Purpose
285298

286299
|`kibana_user` or `kibana_dashboard_only_user`
287300
|Use {kib}. `kibana_dashboard_only_user` grants read-only access to dashboards.
@@ -302,10 +315,11 @@ data:
302315
+
303316
[options="header"]
304317
|====
305-
|Roles | Why needed?
318+
|Role | Purpose
306319

307320
|`kibana_user` and `apm_user`
308321
|Use the APM UI
322+
309323
|`admin`
310324
|Read and update APM Agent configuration via Kibana
311325
|====

0 commit comments

Comments
 (0)