Skip to content

Commit 3a42af7

Browse files
legregoelasticsearchmachine
andauthored
Change reporting_user role to leverage reserved kibana privileges (#132766) (#133078)
* Change reporting_user role to leverage reserved kibana privileges * [CI] Auto commit changes from spotless * Mark reporting_user role as deprecated * Update docs/changelog/132766.yaml * Update release notes --------- Co-authored-by: elasticsearchmachine <[email protected]>
1 parent c6e6537 commit 3a42af7

File tree

3 files changed

+16
-25
lines changed

3 files changed

+16
-25
lines changed

docs/changelog/132766.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pr: 132766
2+
summary: Change `reporting_user` role to leverage reserved kibana privileges
3+
area: Authorization
4+
type: deprecation
5+
issues: []
6+
deprecation:
7+
title: Deprecate the built-in `reporting_user` role.
8+
area: Authorization
9+
details: The `reporting_user` role is deprecated. Administrators should manage access to Kibana's reporting features via custom roles which grant the necessary privileges.
10+
impact: This role will be removed in a future version. Administrators should migrate to custom roles to avoid interruption.

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -314,23 +314,13 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() {
314314
null,
315315
new RoleDescriptor.ApplicationResourcePrivileges[] {
316316
RoleDescriptor.ApplicationResourcePrivileges.builder()
317-
.application("kibana-.kibana")
317+
.application("kibana-*")
318318
.resources("*")
319-
.privileges(
320-
"feature_discover.minimal_read",
321-
"feature_discover.generate_report",
322-
"feature_dashboard.minimal_read",
323-
"feature_dashboard.generate_report",
324-
"feature_dashboard.download_csv_report",
325-
"feature_canvas.minimal_read",
326-
"feature_canvas.generate_report",
327-
"feature_visualize.minimal_read",
328-
"feature_visualize.generate_report"
329-
)
319+
.privileges("reserved_reporting_user")
330320
.build() },
331321
null,
332322
null,
333-
MetadataUtils.DEFAULT_RESERVED_METADATA,
323+
MetadataUtils.getDeprecatedReservedMetadata("Please grant access via Kibana privileges instead."),
334324
null,
335325
null,
336326
null,
@@ -339,7 +329,7 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() {
339329
+ "including generating and downloading reports. "
340330
+ "This role implicitly grants access to all Kibana reporting features, "
341331
+ "with each user having access only to their own reports. Note that reporting users should also be assigned "
342-
+ "additional roles that grant read access to the indices that will be used to generate reports."
332+
+ "additional roles that grant read access to Kibana, and the indices that will be used to generate reports."
343333
)
344334
),
345335
entry(KibanaSystemUser.ROLE_NAME, kibanaSystemRoleDescriptor(KibanaSystemUser.ROLE_NAME)),

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStoreTests.java

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2728,20 +2728,11 @@ public void testReportingUserRole() {
27282728
RoleDescriptor roleDescriptor = ReservedRolesStore.roleDescriptor("reporting_user");
27292729
assertNotNull(roleDescriptor);
27302730
assertThat(roleDescriptor.getMetadata(), hasEntry("_reserved", true));
2731+
assertThat(roleDescriptor.getMetadata(), hasEntry("_deprecated", true));
27312732

27322733
final String applicationName = "kibana-.kibana";
27332734

2734-
final Set<String> applicationPrivilegeNames = Set.of(
2735-
"feature_discover.minimal_read",
2736-
"feature_discover.generate_report",
2737-
"feature_dashboard.minimal_read",
2738-
"feature_dashboard.generate_report",
2739-
"feature_dashboard.download_csv_report",
2740-
"feature_canvas.minimal_read",
2741-
"feature_canvas.generate_report",
2742-
"feature_visualize.minimal_read",
2743-
"feature_visualize.generate_report"
2744-
);
2735+
final Set<String> applicationPrivilegeNames = Set.of("reserved_reporting_user");
27452736

27462737
final Set<String> allowedApplicationActionPatterns = Set.of(
27472738
"login:",

0 commit comments

Comments
 (0)