Skip to content

Commit

Permalink
remove CCS patterns and update test
Browse files Browse the repository at this point in the history
  • Loading branch information
dhurley14 committed May 11, 2021
1 parent d91f39b commit bfe416a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@

public class ReservedRolesStore implements BiConsumer<Set<String>, ActionListener<RoleRetrievalResult>> {
public static final String LEGACY_ALERTS_INDEX = ".siem-signals*";
public static final String LEGACY_ALERTS_INDEX_CCS = "*:.siem-signals*";
public static final String ALERTS_INDEX = ".alerts*";
public static final String ALERTS_INDEX_CCS = "*:.alerts*";

public static final RoleDescriptor SUPERUSER_ROLE_DESCRIPTOR = new RoleDescriptor("superuser",
new String[] { "all" },
Expand Down Expand Up @@ -185,15 +183,7 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() {
// Kibana user will read / write to these indices
RoleDescriptor.IndicesPrivileges.builder()
.indices(ReservedRolesStore.ALERTS_INDEX)
.privileges("all").build(),
// Legacy "Alerts as data" CCS
RoleDescriptor.IndicesPrivileges.builder()
.indices(ReservedRolesStore.LEGACY_ALERTS_INDEX_CCS)
.privileges("all").build(),
// Legacy "Alerts as data" CCS
RoleDescriptor.IndicesPrivileges.builder()
.indices(ReservedRolesStore.ALERTS_INDEX_CCS)
.privileges("all").build(),
.privileges("all").build()
},
null,
new ConfigurableClusterPrivilege[] { new ManageApplicationPrivileges(Collections.singleton("kibana-*")) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,8 @@ public void testKibanaSystemRole() {
".reporting-" + randomAlphaOfLength(randomIntBetween(0, 13)),
".apm-agent-configuration",
".apm-custom-link",
ReservedRolesStore.LEGACY_ALERTS_INDEX,
ReservedRolesStore.ALERTS_INDEX,
ReservedRolesStore.LEGACY_ALERTS_INDEX_CCS,
ReservedRolesStore.ALERTS_INDEX_CCS
ReservedRolesStore.LEGACY_ALERTS_INDEX + randomAlphaOfLength(randomIntBetween(0, 13)),
ReservedRolesStore.ALERTS_INDEX + randomAlphaOfLength(randomIntBetween(0, 13))
).forEach((index) -> {
logger.info("index name [{}]", index);
assertThat(kibanaRole.indices().allowedIndicesMatcher("indices:foo").test(mockIndexAbstraction(index)), is(true));
Expand Down

0 comments on commit bfe416a

Please sign in to comment.