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: Shaunak Kashyap <[email protected]>
  • Loading branch information
albertzaharovits and ycombinator authored Jun 15, 2020
1 parent 7f6598d commit eef0154
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 eef0154

Please sign in to comment.