Skip to content

Commit 2bc2899

Browse files
committed
Add cluster:monitor/xpack/info privilege to built-in monitoring_user role
This is required for the Monitoring UI to call the GET _xpack API on the Monitoring Cluster. It needs to do this in order to determine the license of the Monitoring Cluster, which further determines whether Cluster Alerts are shown to the user or not.
1 parent 2229e72 commit 2bc2899

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() {
5353
null, null,
5454
MetadataUtils.DEFAULT_RESERVED_METADATA, null))
5555
.put("monitoring_user", new RoleDescriptor("monitoring_user",
56-
new String[] { "cluster:monitor/main" },
56+
new String[] { "cluster:monitor/main", "cluster:monitor/xpack/info" },
5757
new RoleDescriptor.IndicesPrivileges[] {
5858
RoleDescriptor.IndicesPrivileges.builder()
5959
.indices(".monitoring-*").privileges("read", "read_cross_cluster").build()

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import org.elasticsearch.common.util.set.Sets;
4848
import org.elasticsearch.test.ESTestCase;
4949
import org.elasticsearch.transport.TransportRequest;
50+
import org.elasticsearch.xpack.core.action.XPackInfoAction;
5051
import org.elasticsearch.xpack.core.ml.MlMetaIndex;
5152
import org.elasticsearch.xpack.core.ml.action.CloseJobAction;
5253
import org.elasticsearch.xpack.core.ml.action.DeleteCalendarAction;
@@ -405,6 +406,7 @@ public void testMonitoringUserRole() {
405406

406407
Role monitoringUserRole = Role.builder(roleDescriptor, null).build();
407408
assertThat(monitoringUserRole.cluster().check(MainAction.NAME, request), is(true));
409+
assertThat(monitoringUserRole.cluster().check(XPackInfoAction.NAME, request), is(true));
408410
assertThat(monitoringUserRole.cluster().check(ClusterHealthAction.NAME, request), is(false));
409411
assertThat(monitoringUserRole.cluster().check(ClusterStateAction.NAME, request), is(false));
410412
assertThat(monitoringUserRole.cluster().check(ClusterStatsAction.NAME, request), is(false));

0 commit comments

Comments
 (0)