From 86c0390de779c538ff9037cb70cdb084a38f79e2 Mon Sep 17 00:00:00 2001 From: Jan Monschke Date: Mon, 16 May 2022 11:56:19 +0200 Subject: [PATCH] feat: add session id to highlighted fields --- .../common/components/event_details/__mocks__/index.ts | 6 ++++++ .../event_details/alert_summary_view.test.tsx | 10 +++++++++- .../event_details/get_alert_summary_rows.tsx | 1 + .../common/components/event_details/translations.ts | 4 ++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/__mocks__/index.ts b/x-pack/plugins/security_solution/public/common/components/event_details/__mocks__/index.ts index 4183f12eec72a..17435e71a94b2 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/public/common/components/event_details/__mocks__/index.ts @@ -9,6 +9,12 @@ export const mockAlertDetailsData = [ { category: 'process', field: 'process.name', values: ['-'], originalValue: '-' }, { category: 'process', field: 'process.pid', values: [0], originalValue: 0 }, { category: 'process', field: 'process.executable', values: ['-'], originalValue: '-' }, + { + category: 'process', + field: 'process.entry_leader.entity_id', + values: ['2938b3f873b4f3n84f938'], + originalValue: '2938b3f873b4f3n84f938', + }, { category: 'agent', field: 'agent.hostname', diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/alert_summary_view.test.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/alert_summary_view.test.tsx index fe8a3d00a6364..2e7763c169d0d 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/alert_summary_view.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/alert_summary_view.test.tsx @@ -16,6 +16,7 @@ import { useRuleWithFallback } from '../../../detections/containers/detection_en import { TestProviders, TestProvidersComponent } from '../../mock'; import { TimelineId } from '../../../../common/types'; import { mockBrowserFields } from '../../containers/source/mock'; +import * as i18n from './translations'; jest.mock('../../lib/kibana'); @@ -68,7 +69,14 @@ describe('AlertSummaryView', () => { ); - ['host.name', 'user.name', 'Rule type', 'query', 'Source event id'].forEach((fieldId) => { + [ + 'host.name', + 'user.name', + i18n.RULE_TYPE, + 'query', + i18n.SOURCE_EVENT_ID, + i18n.SESSION_ID, + ].forEach((fieldId) => { expect(getByText(fieldId)); }); }); diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx b/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx index f2180ea2565e3..278323738d2e9 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx +++ b/x-pack/plugins/security_solution/public/common/components/event_details/get_alert_summary_rows.tsx @@ -38,6 +38,7 @@ const alwaysDisplayedFields: EventSummaryField[] = [ { id: 'user.name' }, { id: ALERT_RULE_TYPE, label: i18n.RULE_TYPE }, { id: 'kibana.alert.original_event.id', label: i18n.SOURCE_EVENT_ID }, + { id: 'process.entry_leader.entity_id', label: i18n.SESSION_ID }, ]; /** diff --git a/x-pack/plugins/security_solution/public/common/components/event_details/translations.ts b/x-pack/plugins/security_solution/public/common/components/event_details/translations.ts index 6e32beb7da02a..8ecc0e4665ba9 100644 --- a/x-pack/plugins/security_solution/public/common/components/event_details/translations.ts +++ b/x-pack/plugins/security_solution/public/common/components/event_details/translations.ts @@ -156,3 +156,7 @@ export const VIEW_RULE_DETAIL_PAGE = i18n.translate( export const VIEW_ALL_FIELDS = i18n.translate('xpack.securitySolution.eventDetails.viewAllFields', { defaultMessage: 'View all fields in table', }); + +export const SESSION_ID = i18n.translate('xpack.securitySolution.eventDetails.sessionId', { + defaultMessage: 'Session ID', +});