diff --git a/src/test/java/org/elasticsearch/shield/authz/store/FileRolesStoreTests.java b/src/test/java/org/elasticsearch/shield/authz/store/FileRolesStoreTests.java index d6c7b14f7f1..93eed0a3a37 100644 --- a/src/test/java/org/elasticsearch/shield/authz/store/FileRolesStoreTests.java +++ b/src/test/java/org/elasticsearch/shield/authz/store/FileRolesStoreTests.java @@ -103,7 +103,7 @@ public class FileRolesStoreTests extends ElasticsearchTestCase { Path path = Paths.get(getClass().getResource("default_roles.yml").toURI()); Map roles = FileRolesStore.parseFile(path, logger, mock(AuthorizationService.class)); assertThat(roles, notNullValue()); - assertThat(roles.size(), is(6)); + assertThat(roles.size(), is(8)); assertThat(roles, hasKey("admin")); assertThat(roles, hasKey("power_user")); @@ -111,6 +111,8 @@ public class FileRolesStoreTests extends ElasticsearchTestCase { assertThat(roles, hasKey("kibana3")); assertThat(roles, hasKey("kibana4")); assertThat(roles, hasKey("logstash")); + assertThat(roles, hasKey("marvel_user")); + assertThat(roles, hasKey("marvel_agent")); } @Test diff --git a/src/test/resources/org/elasticsearch/shield/authz/store/default_roles.yml b/src/test/resources/org/elasticsearch/shield/authz/store/default_roles.yml index 59ede13072c..08816b21821 100644 --- a/src/test/resources/org/elasticsearch/shield/authz/store/default_roles.yml +++ b/src/test/resources/org/elasticsearch/shield/authz/store/default_roles.yml @@ -20,17 +20,29 @@ kibana3: cluster: cluster:monitor/nodes/info indices: '*': indices:data/read/search, indices:data/read/get, indices:admin/get - 'kibana-int': indices:data/read/get, indices:data/read/search, indices:data/write/delete, indices:data/write/index, create_index + 'kibana-int': indices:data/read/search, indices:data/read/get, indices:data/write/delete, indices:data/write/index, create_index # The required role for kibana 4 users kibana4: cluster: cluster:monitor/nodes/info indices: '*': indices:data/read/search, indices:data/read/get, indices:admin/get - '.kibana': indices:data/read/get, indices:data/read/search, indices:data/write/delete, indices:data/write/index, create_index + '.kibana': indices:data/read/search, indices:data/read/get, indices:data/write/delete, indices:data/write/index, create_index # The required role for logstash users logstash: cluster: indices:admin/template/get, indices:admin/template/put indices: - 'logstash-*': indices:data/write/bulk, indices:data/write/delete, indices:data/write/update, create_index \ No newline at end of file + 'logstash-*': indices:data/write/bulk, indices:data/write/delete, indices:data/write/update, create_index + +# Marvel role, allowing all operations +# on the marvel indices +marvel_user: + indices: + '.marvel-*': all + +# Marvel Agent users +marvel_agent: + cluster: indices:admin/template/get, indices:admin/template/put + indices: + '.marvel-*': indices:data/write/bulk, create_index