Skip to content

Commit 80c9680

Browse files
legregoelasticsearchmachine
andauthored
Change reporting_user role to leverage reserved kibana privileges (#132766) (#133079)
* 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 2de3769 commit 80c9680

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
@@ -324,23 +324,13 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() {
324324
null,
325325
new RoleDescriptor.ApplicationResourcePrivileges[] {
326326
RoleDescriptor.ApplicationResourcePrivileges.builder()
327-
.application("kibana-.kibana")
327+
.application("kibana-*")
328328
.resources("*")
329-
.privileges(
330-
"feature_discover.minimal_read",
331-
"feature_discover.generate_report",
332-
"feature_dashboard.minimal_read",
333-
"feature_dashboard.generate_report",
334-
"feature_dashboard.download_csv_report",
335-
"feature_canvas.minimal_read",
336-
"feature_canvas.generate_report",
337-
"feature_visualize.minimal_read",
338-
"feature_visualize.generate_report"
339-
)
329+
.privileges("reserved_reporting_user")
340330
.build() },
341331
null,
342332
null,
343-
MetadataUtils.DEFAULT_RESERVED_METADATA,
333+
MetadataUtils.getDeprecatedReservedMetadata("Please grant access via Kibana privileges instead."),
344334
null,
345335
null,
346336
null,
@@ -349,7 +339,7 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() {
349339
+ "including generating and downloading reports. "
350340
+ "This role implicitly grants access to all Kibana reporting features, "
351341
+ "with each user having access only to their own reports. Note that reporting users should also be assigned "
352-
+ "additional roles that grant read access to the indices that will be used to generate reports."
342+
+ "additional roles that grant read access to Kibana, and the indices that will be used to generate reports."
353343
)
354344
),
355345
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
@@ -2762,20 +2762,11 @@ public void testReportingUserRole() {
27622762
RoleDescriptor roleDescriptor = ReservedRolesStore.roleDescriptor("reporting_user");
27632763
assertNotNull(roleDescriptor);
27642764
assertThat(roleDescriptor.getMetadata(), hasEntry("_reserved", true));
2765+
assertThat(roleDescriptor.getMetadata(), hasEntry("_deprecated", true));
27652766

27662767
final String applicationName = "kibana-.kibana";
27672768

2768-
final Set<String> applicationPrivilegeNames = Set.of(
2769-
"feature_discover.minimal_read",
2770-
"feature_discover.generate_report",
2771-
"feature_dashboard.minimal_read",
2772-
"feature_dashboard.generate_report",
2773-
"feature_dashboard.download_csv_report",
2774-
"feature_canvas.minimal_read",
2775-
"feature_canvas.generate_report",
2776-
"feature_visualize.minimal_read",
2777-
"feature_visualize.generate_report"
2778-
);
2769+
final Set<String> applicationPrivilegeNames = Set.of("reserved_reporting_user");
27792770

27802771
final Set<String> allowedApplicationActionPatterns = Set.of(
27812772
"login:",

0 commit comments

Comments
 (0)