Skip to content

update kibana_system to grant it access to .chat-* system index #131419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ public class KibanaPlugin extends Plugin implements SystemIndexPlugin {
.setAllowedElasticProductOrigins(KIBANA_PRODUCT_ORIGIN)
.build();

public static final SystemIndexDescriptor ONECHAT_INDEX_DESCRIPTOR = SystemIndexDescriptor.builder()
.setIndexPattern(".chat-*")
.setDescription("Onechat system index")
.setType(Type.EXTERNAL_UNMANAGED)
.setAllowedElasticProductOrigins(KIBANA_PRODUCT_ORIGIN)
.build();

public static final SystemIndexDescriptor APM_AGENT_CONFIG_INDEX_DESCRIPTOR = SystemIndexDescriptor.builder()
.setIndexPattern(".apm-agent-configuration*")
.setDescription("system index for APM agent configuration")
Expand All @@ -57,6 +64,7 @@ public Collection<SystemIndexDescriptor> getSystemIndexDescriptors(Settings sett
return List.of(
KIBANA_INDEX_DESCRIPTOR,
REPORTING_INDEX_DESCRIPTOR,
ONECHAT_INDEX_DESCRIPTOR,
APM_AGENT_CONFIG_INDEX_DESCRIPTOR,
APM_CUSTOM_LINK_INDEX_DESCRIPTOR
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class KibanaPluginTests extends ESTestCase {
public void testKibanaIndexNames() {
assertThat(
new KibanaPlugin().getSystemIndexDescriptors(Settings.EMPTY).stream().map(SystemIndexDescriptor::getIndexPattern).toList(),
contains(".kibana_*", ".reporting-*", ".apm-agent-configuration*", ".apm-custom-link*")
contains(".kibana_*", ".reporting-*", ".chat-*", ".apm-agent-configuration*", ".apm-custom-link*")
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static RoleDescriptor kibanaSystem(String name) {
new RoleDescriptor.IndicesPrivileges[] {
// System indices defined in KibanaPlugin
RoleDescriptor.IndicesPrivileges.builder()
.indices(".kibana*", ".reporting-*")
.indices(".kibana*", ".reporting-*", ".chat-*")
.privileges("all")
.allowRestrictedIndices(true)
.build(),
Expand Down