Skip to content

Commit

Permalink
Add ILM policy PUT and GET for remote_monitoring_agent built-in role (#…
Browse files Browse the repository at this point in the history
…57963)

Without this fix, users who try to use Metricbeat for Stack Monitoring today
see the following error repeatedly in their Metricbeat log. Due to this error
Metricbeat is unwilling to proceed further and, thus, no Stack Monitoring
data is indexed into the Elasticsearch cluster.

Co-authored-by: Albert Zaharovits <[email protected]>
  • Loading branch information
ycombinator and albertzaharovits committed Jun 15, 2020
1 parent 9be89e8 commit 5e2faad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() {
.put("remote_monitoring_agent", new RoleDescriptor("remote_monitoring_agent",
new String[] {
"manage_index_templates", "manage_ingest_pipelines", "monitor",
GetLifecycleAction.NAME, PutLifecycleAction.NAME,
"cluster:monitor/xpack/watcher/watch/get",
"cluster:admin/xpack/watcher/watch/put",
"cluster:admin/xpack/watcher/watch/delete",
"cluster:admin/xpack/watcher/watch/delete"
},
new RoleDescriptor.IndicesPrivileges[] {
RoleDescriptor.IndicesPrivileges.builder().indices(".monitoring-*").privileges("all").build(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,9 @@ public void testRemoteMonitoringAgentRole() {
assertThat(remoteMonitoringAgentRole.cluster().check(ActivateWatchAction.NAME, request, authentication), is(false));
assertThat(remoteMonitoringAgentRole.cluster().check(WatcherServiceAction.NAME, request, authentication), is(false));
assertThat(remoteMonitoringAgentRole.cluster().check(DelegatePkiAuthenticationAction.NAME, request, authentication), is(false));
// ILM
assertThat(remoteMonitoringAgentRole.cluster().check(GetLifecycleAction.NAME, request, authentication), is(true));
assertThat(remoteMonitoringAgentRole.cluster().check(PutLifecycleAction.NAME, request, authentication), is(true));

// we get this from the cluster:monitor privilege
assertThat(remoteMonitoringAgentRole.cluster().check(WatcherStatsAction.NAME, request, authentication), is(true));
Expand Down

0 comments on commit 5e2faad

Please sign in to comment.