30
30
import static org .elasticsearch .xpack .core .security .authz .store .ReservedRolesStore .getRemoteIndicesReadPrivileges ;
31
31
32
32
/**
33
- * This exists in a separate file so it can be assigned to the Kibana security team in the CODEOWNERS file
33
+ * This exists in a separate file so it can be assigned to the Kibana security
34
+ * team in the CODEOWNERS file
34
35
*/
35
36
class KibanaOwnedReservedRoleDescriptors {
36
37
@@ -87,9 +88,11 @@ static RoleDescriptor kibanaSystem(String name) {
87
88
SuggestProfilesAction .NAME ,
88
89
ProfileHasPrivilegesAction .NAME ,
89
90
"write_fleet_secrets" ,
90
- // To facilitate ML UI functionality being controlled using Kibana security privileges
91
+ // To facilitate ML UI functionality being controlled using Kibana security
92
+ // privileges
91
93
"manage_ml" ,
92
- // The symbolic constant for this one is in SecurityActionMapper, so not accessible from X-Pack core
94
+ // The symbolic constant for this one is in SecurityActionMapper, so not
95
+ // accessible from X-Pack core
93
96
"cluster:admin/analyze" ,
94
97
// To facilitate using the file uploader functionality
95
98
"monitor_text_structure" ,
@@ -104,7 +107,8 @@ static RoleDescriptor kibanaSystem(String name) {
104
107
.build (),
105
108
RoleDescriptor .IndicesPrivileges .builder ().indices (".monitoring-*" ).privileges ("read" , "read_cross_cluster" ).build (),
106
109
RoleDescriptor .IndicesPrivileges .builder ().indices (".management-beats" ).privileges ("create_index" , "read" , "write" ).build (),
107
- // To facilitate ML UI functionality being controlled using Kibana security privileges
110
+ // To facilitate ML UI functionality being controlled using Kibana security
111
+ // privileges
108
112
RoleDescriptor .IndicesPrivileges .builder ().indices (".ml-anomalies*" , ".ml-stats-*" ).privileges ("read" ).build (),
109
113
RoleDescriptor .IndicesPrivileges .builder ()
110
114
.indices (".ml-annotations*" , ".ml-notifications*" )
@@ -139,20 +143,23 @@ static RoleDescriptor kibanaSystem(String name) {
139
143
RoleDescriptor .IndicesPrivileges .builder ().indices ("traces-apm.*" ).privileges ("read" , "read_cross_cluster" ).build (),
140
144
RoleDescriptor .IndicesPrivileges .builder ().indices ("traces-apm-*" ).privileges ("read" , "read_cross_cluster" ).build (),
141
145
142
- // Logstash telemetry queries of kibana task runner to access Logstash metric indices
146
+ // Logstash telemetry queries of kibana task runner to access Logstash metric
147
+ // indices
143
148
RoleDescriptor .IndicesPrivileges .builder ().indices ("metrics-logstash.*" ).privileges ("read" ).build (),
144
149
145
150
// Data telemetry reads mappings, metadata and stats of indices
146
151
RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("view_index_metadata" , "monitor" ).build (),
147
- // Endpoint diagnostic information. Kibana reads from these indices to send telemetry
152
+ // Endpoint diagnostic information. Kibana reads from these indices to send
153
+ // telemetry
148
154
RoleDescriptor .IndicesPrivileges .builder ().indices (".logs-endpoint.diagnostic.collection-*" ).privileges ("read" ).build (),
149
155
// Fleet secrets. Kibana can only write to this index.
150
156
RoleDescriptor .IndicesPrivileges .builder ()
151
157
.indices (".fleet-secrets*" )
152
158
.privileges ("write" , "delete" , "create_index" )
153
159
.allowRestrictedIndices (true )
154
160
.build (),
155
- // Other Fleet indices. Kibana reads and writes to these indices to manage Elastic Agents.
161
+ // Other Fleet indices. Kibana reads and writes to these indices to manage
162
+ // Elastic Agents.
156
163
RoleDescriptor .IndicesPrivileges .builder ()
157
164
.indices (".fleet-actions*" )
158
165
.privileges ("all" )
@@ -217,26 +224,32 @@ static RoleDescriptor kibanaSystem(String name) {
217
224
.indices (ReservedRolesStore .LISTS_INDEX , ReservedRolesStore .LISTS_ITEMS_INDEX )
218
225
.privileges ("all" )
219
226
.build (),
220
- // "Alerts as data" internal backing indices used in Security Solution, Observability, etc.
221
- // Kibana system user creates these indices; reads / writes to them via the aliases (see below).
227
+ // "Alerts as data" internal backing indices used in Security Solution,
228
+ // Observability, etc.
229
+ // Kibana system user creates these indices; reads / writes to them via the
230
+ // aliases (see below).
222
231
RoleDescriptor .IndicesPrivileges .builder ().indices (ReservedRolesStore .ALERTS_BACKING_INDEX ).privileges ("all" ).build (),
223
- // "Alerts as data" public index aliases used in Security Solution, Observability, etc.
232
+ // "Alerts as data" public index aliases used in Security Solution,
233
+ // Observability, etc.
224
234
// Kibana system user uses them to read / write alerts.
225
235
RoleDescriptor .IndicesPrivileges .builder ().indices (ReservedRolesStore .ALERTS_INDEX_ALIAS ).privileges ("all" ).build (),
226
236
// "Alerts as data" public index alias used in Security Solution
227
237
// Kibana system user uses them to read / write alerts.
228
238
RoleDescriptor .IndicesPrivileges .builder ().indices (ReservedRolesStore .PREVIEW_ALERTS_INDEX_ALIAS ).privileges ("all" ).build (),
229
239
// "Alerts as data" internal backing indices used in Security Solution
230
- // Kibana system user creates these indices; reads / writes to them via the aliases (see below).
240
+ // Kibana system user creates these indices; reads / writes to them via the
241
+ // aliases (see below).
231
242
RoleDescriptor .IndicesPrivileges .builder ()
232
243
.indices (ReservedRolesStore .PREVIEW_ALERTS_BACKING_INDEX_ALIAS )
233
244
.privileges ("all" )
234
245
.build (),
235
- // Endpoint / Fleet policy responses. Kibana requires read access to send telemetry
246
+ // Endpoint / Fleet policy responses. Kibana requires read access to send
247
+ // telemetry
236
248
RoleDescriptor .IndicesPrivileges .builder ().indices ("metrics-endpoint.policy-*" ).privileges ("read" ).build (),
237
249
// Endpoint metrics. Kibana requires read access to send telemetry
238
250
RoleDescriptor .IndicesPrivileges .builder ().indices ("metrics-endpoint.metrics-*" ).privileges ("read" ).build (),
239
- // Endpoint events. Kibana reads endpoint alert lineage for building and sending telemetry
251
+ // Endpoint events. Kibana reads endpoint alert lineage for building and sending
252
+ // telemetry
240
253
RoleDescriptor .IndicesPrivileges .builder ().indices ("logs-endpoint.events.*" ).privileges ("read" ).build (),
241
254
// Fleet package install and upgrade
242
255
RoleDescriptor .IndicesPrivileges .builder ()
@@ -261,39 +274,48 @@ static RoleDescriptor kibanaSystem(String name) {
261
274
"indices:admin/data_stream/lifecycle/put"
262
275
)
263
276
.build (),
264
- // Endpoint specific action responses. Kibana reads and writes (for third party agents) to the index
277
+ // Endpoint specific action responses. Kibana reads and writes (for third party
278
+ // agents) to the index
265
279
// to display action responses to the user.
266
280
RoleDescriptor .IndicesPrivileges .builder ()
267
281
.indices (".logs-endpoint.action.responses-*" )
268
282
.privileges ("auto_configure" , "read" , "write" )
269
283
.build (),
270
- // Endpoint specific actions. Kibana reads and writes to this index to track new actions and display them.
284
+ // Endpoint specific actions. Kibana reads and writes to this index to track new
285
+ // actions and display them.
271
286
RoleDescriptor .IndicesPrivileges .builder ()
272
287
.indices (".logs-endpoint.actions-*" )
273
288
.privileges ("auto_configure" , "read" , "write" )
274
289
.build (),
275
- // Legacy Osquery manager specific action responses. Kibana reads from these to display responses to the user.
290
+ // Legacy Osquery manager specific action responses. Kibana reads from these to
291
+ // display responses to the user.
276
292
RoleDescriptor .IndicesPrivileges .builder ()
277
293
.indices (".logs-osquery_manager.action.responses-*" )
278
294
.privileges ("auto_configure" , "create_index" , "read" , "index" , "delete" )
279
295
.build (),
280
- // Osquery manager specific action responses. Kibana reads from these to display responses to the user.
296
+ // Osquery manager specific action responses. Kibana reads from these to display
297
+ // responses to the user.
281
298
RoleDescriptor .IndicesPrivileges .builder ()
282
299
.indices ("logs-osquery_manager.action.responses-*" )
283
300
.privileges ("read" , "view_index_metadata" )
284
301
.build (),
285
- // Osquery manager specific actions. Kibana reads and writes to this index to track new actions and display them.
302
+ // Osquery manager specific actions. Kibana reads and writes to this index to
303
+ // track new actions and display them.
286
304
RoleDescriptor .IndicesPrivileges .builder ()
287
305
.indices (".logs-osquery_manager.actions-*" )
288
306
.privileges ("auto_configure" , "create_index" , "read" , "index" , "write" , "delete" )
289
307
.build (),
290
308
291
- // Third party agent (that use non-Elastic Defend integrations) info logs indices.
309
+ // Third party agent (that use non-Elastic Defend integrations) info logs
310
+ // indices.
292
311
// Kibana reads from these to display agent status/info to the user.
293
- // These are indices that filebeat writes to, and the data in these indices are ingested by Fleet integrations
294
- // in order to provide support for response actions related to malicious events for such agents.
312
+ // These are indices that filebeat writes to, and the data in these indices are
313
+ // ingested by Fleet integrations
314
+ // in order to provide support for response actions related to malicious events
315
+ // for such agents.
295
316
RoleDescriptor .IndicesPrivileges .builder ().indices ("logs-sentinel_one.*" , "logs-crowdstrike.*" ).privileges ("read" ).build (),
296
- // For ILM policy for APM, Endpoint, & Synthetics packages that have delete action
317
+ // For ILM policy for APM, Endpoint, & Synthetics packages that have delete
318
+ // action
297
319
RoleDescriptor .IndicesPrivileges .builder ()
298
320
.indices (
299
321
".logs-endpoint.diagnostic.collection-*" ,
@@ -332,7 +354,8 @@ static RoleDescriptor kibanaSystem(String name) {
332
354
TransportUpdateSettingsAction .TYPE .name ()
333
355
)
334
356
.build (),
335
- // For destination indices of the Threat Intel (ti_*) packages that ships a transform for supporting IOC expiration
357
+ // For destination indices of the Threat Intel (ti_*) packages that ships a
358
+ // transform for supporting IOC expiration
336
359
RoleDescriptor .IndicesPrivileges .builder ()
337
360
.indices ("logs-ti_*_latest.*" )
338
361
.privileges (
@@ -346,7 +369,8 @@ static RoleDescriptor kibanaSystem(String name) {
346
369
TransportUpdateSettingsAction .TYPE .name ()
347
370
)
348
371
.build (),
349
- // For source indices of the Threat Intel (ti_*) packages that ships a transform for supporting IOC expiration
372
+ // For source indices of the Threat Intel (ti_*) packages that ships a transform
373
+ // for supporting IOC expiration
350
374
RoleDescriptor .IndicesPrivileges .builder ()
351
375
.indices ("logs-ti_*.*-*" )
352
376
.privileges (
@@ -370,7 +394,8 @@ static RoleDescriptor kibanaSystem(String name) {
370
394
TransportUpdateSettingsAction .TYPE .name ()
371
395
)
372
396
.build (),
373
- // For src/dest indices of the Cloud Security Posture packages that ships a transform
397
+ // For src/dest indices of the Cloud Security Posture packages that ships a
398
+ // transform
374
399
RoleDescriptor .IndicesPrivileges .builder ()
375
400
.indices ("logs-cloud_security_posture.findings-*" , "logs-cloud_security_posture.vulnerabilities-*" )
376
401
.privileges ("read" , "view_index_metadata" )
@@ -390,6 +415,27 @@ static RoleDescriptor kibanaSystem(String name) {
390
415
TransportUpdateSettingsAction .TYPE .name ()
391
416
)
392
417
.build (),
418
+ RoleDescriptor .IndicesPrivileges .builder ()
419
+ .indices ("logs-wiz.vulnerability-*" )
420
+ .privileges ("read" , "view_index_metadata" )
421
+ .build (),
422
+ RoleDescriptor .IndicesPrivileges .builder ()
423
+ // manage privilege required by the index alias
424
+ .indices ("security_solution-*.vulnerability_latest" )
425
+ .privileges ("manage" , TransportIndicesAliasesAction .NAME , TransportUpdateSettingsAction .TYPE .name ())
426
+ .build (),
427
+ RoleDescriptor .IndicesPrivileges .builder ()
428
+ .indices ("security_solution-*.vulnerability_latest-*" )
429
+ .privileges (
430
+ "create_index" ,
431
+ "index" ,
432
+ "manage" ,
433
+ "read" ,
434
+ "delete" ,
435
+ TransportIndicesAliasesAction .NAME ,
436
+ TransportUpdateSettingsAction .TYPE .name ()
437
+ )
438
+ .build (),
393
439
RoleDescriptor .IndicesPrivileges .builder ().indices ("risk-score.risk-*" ).privileges ("all" ).build (),
394
440
RoleDescriptor .IndicesPrivileges .builder ()
395
441
.indices (".asset-criticality.asset-criticality-*" )
@@ -403,7 +449,8 @@ static RoleDescriptor kibanaSystem(String name) {
403
449
// SLO observability solution internal indices
404
450
// Kibana system user uses them to read / write slo data.
405
451
RoleDescriptor .IndicesPrivileges .builder ().indices (".slo-observability.*" ).privileges ("all" ).build (),
406
- // Endpoint heartbeat. Kibana reads from these to determine metering/billing for endpoints.
452
+ // Endpoint heartbeat. Kibana reads from these to determine metering/billing for
453
+ // endpoints.
407
454
RoleDescriptor .IndicesPrivileges .builder ().indices (".logs-endpoint.heartbeat-*" ).privileges ("read" ).build (),
408
455
// For connectors telemetry. Will be removed once we switched to connectors API
409
456
RoleDescriptor .IndicesPrivileges .builder ().indices (".elastic-connectors*" ).privileges ("read" ).build () },
0 commit comments