Skip to content

[Entity Analytics] Fix host details page for hosts in the entity store#268272

Open
ymao1 wants to merge 1 commit intoelastic:mainfrom
ymao1:fix-host-details-page
Open

[Entity Analytics] Fix host details page for hosts in the entity store#268272
ymao1 wants to merge 1 commit intoelastic:mainfrom
ymao1:fix-host-details-page

Conversation

@ymao1
Copy link
Copy Markdown
Contributor

@ymao1 ymao1 commented May 7, 2026

Summary

Followup to #267728, this PR fixes the host details page to correctly generate the queries used to populate the page components

To Verify

  1. Start ES and Kibana with all the V2 feature flags
  2. Verify the entity store is enabled and generate some source data using yarn start org-data --size medium
  3. Wait for the entity store to get some entities
  4. Create a detection rule that queries the default security indices and generates alerts
  5. Manually kick off the risk engine so that some entity store entities have risk scores
  6. Modify the following file so that clicking a host from the All Hosts page navigates to the host details page:
--- a/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/hosts_table/columns.tsx
+++ b/x-pack/solutions/security/plugins/security_solution/public/explore/hosts/components/hosts_table/columns.tsx
@@ -56,7 +56,7 @@ export const getHostsColumns = (
               field: 'host.name',
             }}
           >
-            <HostDetailsLink hostName={name} entityId={entityId} onClick={onClick} />
+            <HostDetailsLink hostName={name} entityId={entityId} />
           </SecurityCellActions>

Verify No Regressions in Explore Hosts Page

  1. Navigate to Explore -> Hosts and verify that all the tabs are correctly populated (some may be empty depending on what test data you have). There should be no regressions on this page from this PR

Verify Host Details page for Host in Entity Store is populated

  1. From the All Hosts tab, click on a host to go to the host details page
  2. At a minimum, the events tab should have some events. Depending on your source data, you may have data in the Authentications tab. If the host has a risk score, there should be risk score inputs in the Host Risk tab and alerts shown in the alerts components. Inspecting the queries, the DSL queries should include a EUID DSL filter (sometimes the EUID DSL filter will just be a host.name filter but you may also see host.id filters.
Screen.Recording.2026-05-07.at.1.31.50.PM.mov

Verify No Regressions for Host Details page for Host not in Entity Store

  1. From the Alerts page, find a host that is not in the entity store and navigate to their details page. Inspect the queries on this page. They should all use the host.name fallback since this host is not in the entity store.
Screen.Recording.2026-05-07.at.1.32.20.PM.mov

@ymao1 ymao1 changed the title Fix host details page [Entity Analytics] Fix host details page for hosts in the entity store May 7, 2026
@ymao1 ymao1 self-assigned this May 7, 2026
@ymao1 ymao1 added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Entity Analytics Security Entity Analytics Team v9.5.0 labels May 7, 2026
@ymao1 ymao1 force-pushed the fix-host-details-page branch from e86522c to 384a4de Compare May 7, 2026 21:15
@ymao1 ymao1 marked this pull request as ready for review May 7, 2026 21:16
@ymao1 ymao1 requested a review from a team as a code owner May 7, 2026 21:16
@ymao1 ymao1 requested a review from hop-dev May 7, 2026 21:16
@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

Pinging @elastic/security-entity-analytics (Team:Entity Analytics)

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 9400 9401 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 12.0MB 12.0MB -263.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
securitySolution 153.4KB 153.4KB +1.0B

History

cc @ymao1

@ymao1 ymao1 added backport:version Backport to applied version labels v9.4.1 and removed backport:skip This PR does not require backporting labels May 7, 2026
import type { Filter } from '@kbn/es-query';
import type { QueryDslQueryContainer } from '@kbn/data-views-plugin/common/types';

export const euidDslFilterToPageFilters = (dsl: QueryDslQueryContainer | undefined): Filter[] => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

euidDslFilterToPageFilters was moved to explore/helpers.ts, but the original definition still lives in users/pages/details/helpers.ts and it's no longer imported anywhere. Can we remove it?

signalIndexName={signalIndexName}
entityFilter={entityFilter}
entityType={EntityType.host}
entityRecord={entityStoreV2Enabled ? observedHost.entityRecord : undefined}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

small suggestion: I see that entityType and entityRecord props were introduced in #267728, but I think it could be useful to have a comment on AlertsByStatusProps saying when entityType + entityRecord is preferred over entityFilter, or not sure if entityFilter will be deprecated afterwards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Entity Analytics Security Entity Analytics Team v9.4.1 v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants