Skip to content

[ExtraHop][Qualys GAV] - Fix Cannot execute ILM policy delete step #132387

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 5 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
6 changes: 6 additions & 0 deletions docs/changelog/132387.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pr: 132387
summary: "[ExtraHop & QualysGAV] Add `manage`, `create_index`, `read`, `index`, `write`, `delete`, permission for third party agent indices `kibana_system`"
area: Authorization
type: enhancement
issues:
- 131825
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,24 @@ static RoleDescriptor kibanaSystem(String name) {
)
.privileges("read", "view_index_metadata")
.build(),
// For ExtraHop and QualysGAV specific actions. Kibana reads, writes and manages this index
// for configured ILM policies.
RoleDescriptor.IndicesPrivileges.builder()
.indices("logs-extrahop.investigation-*", "logs-qualys_gav.asset-*")
.privileges(
"manage",
"create_index",
"read",
"index",
"write",
"delete",
// Require "delete_index" to perform ILM policy actions
Copy link
Contributor

@slobodanadamovic slobodanadamovic Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note: I'm assuming you also need rollover, but that is already covered by logs-* pattern here:

"logs-*",
"synthetics-*",
"traces-*",
"/metrics-.*&~(metrics-endpoint\\.metadata_current_default.*)/",
".logs-endpoint.action.responses-*",
".logs-endpoint.diagnostic.collection-*",
".logs-endpoint.actions-*",
".logs-endpoint.heartbeat-*",
".logs-osquery_manager.actions-*",
".logs-osquery_manager.action.responses-*",
"logs-osquery_manager.action.responses-*",
"profiling-*"
)
.privileges(
TransportUpdateSettingsAction.TYPE.name(),
TransportPutMappingAction.TYPE.name(),
RolloverAction.NAME,
"indices:admin/data_stream/lifecycle/put"
)

Given the above privileges, the TransportUpdateSettingsAction.TYPE.name() is redundant.

TransportDeleteIndexAction.TYPE.name(),
TransportIndicesAliasesAction.NAME,
TransportUpdateSettingsAction.TYPE.name(),
TransportAutoPutMappingAction.TYPE.name()
)
.build(),
// For alias indices of the Cloud Detection & Response (CDR) packages that ships a
// transform
RoleDescriptor.IndicesPrivileges.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1887,6 +1887,53 @@ public void testKibanaSystemRole() {
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportPutMappingAction.TYPE.name()).test(indexAbstraction), is(true));
assertThat(kibanaRole.indices().allowedIndicesMatcher(RolloverAction.NAME).test(indexAbstraction), is(true));
});

// Tests for third-party agent indices (ExtraHop, QualysGAV) that `kibana_system` has full management access to
// This includes read, write, create, delete, and all ILM-related management actions.
Arrays.asList(
"logs-extrahop.investigation-" + randomAlphaOfLength(randomIntBetween(1, 10)),
"logs-qualys_gav.asset-" + randomAlphaOfLength(randomIntBetween(1, 10))
).forEach((index) -> {
final IndexAbstraction indexAbstraction = mockIndexAbstraction(index);

// Assert Read Actions (Allowed by "read")
assertThat(kibanaRole.indices().allowedIndicesMatcher(GetIndexAction.NAME).test(indexAbstraction), is(true));
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportSearchAction.TYPE.name()).test(indexAbstraction), is(true));
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportGetAction.TYPE.name()).test(indexAbstraction), is(true));

// Assert Write & Delete Document Actions (Allowed by "write", "index", "delete")
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportIndexAction.NAME).test(indexAbstraction), is(true));
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportDeleteAction.NAME).test(indexAbstraction), is(true));
// The "update" action is also implicitly part of "write"
assertThat(kibanaRole.indices().allowedIndicesMatcher(UpdateAction.NAME).test(indexAbstraction), is(true));

// Assert Index Management Actions (Allowed by "create_index", "delete_index", and "manage")
// Allowed by the explicit "create_index" privilege
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportCreateIndexAction.TYPE.name()).test(indexAbstraction), is(true));
// Allowed by the explicit TransportDeleteIndexAction
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportDeleteIndexAction.TYPE.name()).test(indexAbstraction), is(true));

// Assert ILM Actions (Allowed by "manage" and explicit transport actions)
// Allowed due to the "manage" privilege and explicit TransportUpdateSettingsAction
assertThat(
kibanaRole.indices().allowedIndicesMatcher(TransportUpdateSettingsAction.TYPE.name()).test(indexAbstraction),
is(true)
);
// Allowed due to the "manage" privilege and explicit TransportAutoPutMappingAction
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportPutMappingAction.TYPE.name()).test(indexAbstraction), is(true));
// Allowed due to the explicit TransportIndicesAliasesAction
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportIndicesAliasesAction.NAME).test(indexAbstraction), is(true));
// Rollover requires 'manage' on the alias and 'create_index', both of which are granted.
assertThat(kibanaRole.indices().allowedIndicesMatcher(RolloverAction.NAME).test(indexAbstraction), is(true));

// Assert Denied Actions
// This role should not have cross-cluster permissions on these indices
assertThat(kibanaRole.indices().allowedIndicesMatcher(READ_CROSS_CLUSTER_NAME).test(indexAbstraction), is(false));

// A check against a completely different index should fail
final IndexAbstraction otherIndex = mockIndexAbstraction("some-unrelated-index");
assertThat(kibanaRole.indices().allowedIndicesMatcher(TransportSearchAction.TYPE.name()).test(otherIndex), is(false));
});
}

public void testKibanaAdminRole() {
Expand Down