mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
This commit is contained in:
parent
c8ef2e18f7
commit
a686ccc9b2
@ -183,7 +183,10 @@ public class ReservedRolesStore implements BiConsumer<Set<String>, ActionListene
|
||||
.privileges("read", "view_index_metadata").build(),
|
||||
RoleDescriptor.IndicesPrivileges.builder().indices("observability-annotations")
|
||||
.privileges("read", "view_index_metadata").build()
|
||||
}, null, MetadataUtils.DEFAULT_RESERVED_METADATA))
|
||||
}, new RoleDescriptor.ApplicationResourcePrivileges[] {
|
||||
RoleDescriptor.ApplicationResourcePrivileges.builder()
|
||||
.application("kibana-*").resources("*").privileges("reserved_ml_apm_user").build()
|
||||
}, null, null, MetadataUtils.DEFAULT_RESERVED_METADATA, null))
|
||||
.put("machine_learning_user", new RoleDescriptor("machine_learning_user", new String[] { "monitor_ml" },
|
||||
new RoleDescriptor.IndicesPrivileges[] {
|
||||
RoleDescriptor.IndicesPrivileges.builder().indices(".ml-anomalies*", ".ml-notifications*")
|
||||
|
@ -1205,6 +1205,18 @@ public class ReservedRolesStoreTests extends ESTestCase {
|
||||
assertOnlyReadAllowed(role, AnomalyDetectorsIndexFields.RESULTS_INDEX_PREFIX + AnomalyDetectorsIndexFields.RESULTS_INDEX_DEFAULT);
|
||||
|
||||
assertOnlyReadAllowed(role, "observability-annotations");
|
||||
|
||||
final String kibanaApplicationWithRandomIndex = "kibana-" + randomFrom(randomAlphaOfLengthBetween(8, 24), ".kibana");
|
||||
assertThat(role.application().grants(
|
||||
new ApplicationPrivilege(kibanaApplicationWithRandomIndex, "app-foo", "foo"), "*"), is(false));
|
||||
assertThat(role.application().grants(
|
||||
new ApplicationPrivilege(kibanaApplicationWithRandomIndex, "app-reserved_ml_apm_user", "reserved_ml_apm_user"), "*"), is(true));
|
||||
|
||||
final String otherApplication = "logstash-" + randomAlphaOfLengthBetween(8, 24);
|
||||
assertThat(role.application().grants(
|
||||
new ApplicationPrivilege(otherApplication, "app-foo", "foo"), "*"), is(false));
|
||||
assertThat(role.application().grants(
|
||||
new ApplicationPrivilege(otherApplication, "app-reserved_ml_apm_user", "reserved_ml_apm_user"), "*"), is(false));
|
||||
}
|
||||
|
||||
public void testMachineLearningAdminRole() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user