-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Security Solution] Use session view plugin to render session viewer in alerts, events and timeline #127520
[Security Solution] Use session view plugin to render session viewer in alerts, events and timeline #127520
Changes from 20 commits
af077cd
0abc22b
821c0c2
21889d3
86aa348
c3e7708
d7cbe6a
dd9452c
19ad8df
fa00f8b
b6d2b49
c811902
8e9c818
a8d9d13
608f7c8
638bcfe
9b18ccd
ebe4d56
63d2a5d
e99a71b
9b592b5
169e9d0
794efea
545cddd
83502cd
678fdc6
5293a14
bf284c6
bac80f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,12 @@ import styled from 'styled-components'; | |
import type { Filter } from '@kbn/es-query'; | ||
import { inputsModel, State } from '../../store'; | ||
import { inputsActions } from '../../store/actions'; | ||
import { ControlColumnProps, RowRenderer, TimelineId } from '../../../../common/types/timeline'; | ||
import { | ||
ControlColumnProps, | ||
RowRenderer, | ||
TimelineId, | ||
TimelineTabs, | ||
} from '../../../../common/types/timeline'; | ||
import { APP_ID, APP_UI_ID } from '../../../../common/constants'; | ||
import { timelineActions } from '../../../timelines/store/timeline'; | ||
import type { SubsetTimelineModel } from '../../../timelines/store/timeline/model'; | ||
|
@@ -24,7 +29,6 @@ import { SourcererScopeName } from '../../store/sourcerer/model'; | |
import { useSourcererDataView } from '../../containers/sourcerer'; | ||
import type { EntityType } from '../../../../../timelines/common'; | ||
import { TGridCellAction } from '../../../../../timelines/common/types'; | ||
import { DetailsPanel } from '../../../timelines/components/side_panel'; | ||
import { CellValueElementProps } from '../../../timelines/components/timeline/cell_rendering'; | ||
import { FIELDS_WITHOUT_CELL_ACTIONS } from '../../lib/cell_actions/constants'; | ||
import { useGetUserCasesPermissions, useKibana } from '../../lib/kibana'; | ||
|
@@ -33,6 +37,7 @@ import { | |
useFieldBrowserOptions, | ||
FieldEditorActions, | ||
} from '../../../timelines/components/fields_browser'; | ||
import { useDetailPanel } from '../../../timelines/components/side_panel/hooks/use_detail_panel'; | ||
|
||
const EMPTY_CONTROL_COLUMNS: ControlColumnProps[] = []; | ||
|
||
|
@@ -105,6 +110,7 @@ const StatefulEventsViewerComponent: React.FC<Props> = ({ | |
itemsPerPage, | ||
itemsPerPageOptions, | ||
kqlMode, | ||
sessionViewId, | ||
showCheckboxes, | ||
sort, | ||
} = defaultModel, | ||
|
@@ -155,11 +161,22 @@ const StatefulEventsViewerComponent: React.FC<Props> = ({ | |
|
||
const globalFilters = useMemo(() => [...filters, ...(pageFilters ?? [])], [filters, pageFilters]); | ||
const trailingControlColumns: ControlColumnProps[] = EMPTY_CONTROL_COLUMNS; | ||
const graphOverlay = useMemo( | ||
() => | ||
graphEventId != null && graphEventId.length > 0 ? <GraphOverlay timelineId={id} /> : null, | ||
[graphEventId, id] | ||
); | ||
|
||
const { openDetailsPanel, DetailsPanel } = useDetailPanel({ | ||
isFlyoutView: true, | ||
entityType, | ||
sourcererScope: SourcererScopeName.timeline, | ||
timelineId: id, | ||
tabType: TimelineTabs.query, | ||
}); | ||
|
||
const graphOverlay = useMemo(() => { | ||
const shouldShowOverlay = | ||
(graphEventId != null && graphEventId.length > 0) || sessionViewId !== null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we unify the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm nervous to change it, for whatever reason, graph event id is set to empty string sometimes and is undefined at other times |
||
return shouldShowOverlay ? ( | ||
<GraphOverlay timelineId={id} openDetailsPanel={openDetailsPanel} /> | ||
) : null; | ||
}, [graphEventId, id, sessionViewId, openDetailsPanel]); | ||
const setQuery = useCallback( | ||
(inspect, loading, refetch) => { | ||
dispatch(inputsActions.setQuery({ id, inputId: 'global', inspect, loading, refetch })); | ||
|
@@ -239,14 +256,7 @@ const StatefulEventsViewerComponent: React.FC<Props> = ({ | |
})} | ||
</InspectButtonContainer> | ||
</FullScreenContainer> | ||
<DetailsPanel | ||
browserFields={browserFields} | ||
entityType={entityType} | ||
docValueFields={docValueFields} | ||
isFlyoutView | ||
runtimeMappings={runtimeMappings} | ||
timelineId={id} | ||
/> | ||
{DetailsPanel} | ||
</CasesContext> | ||
</> | ||
); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might add the unit test later(follow up PR?) for checking the buttons count on dependency if the session view is enabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ya no problem, once someone confirms if we are keeping the flag or not 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @kqualters-elastic, we can drop the Feature Flag, we will only have the
sessions
flag for capturing sessions data from Endpoint, and won't have a Feature flag for hiding Session View UIcc @qcorporation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @opauloh for cc.ing me. I can confirm we want to keep the empty state.
I remember we had originally talked about having a Kibana flag that would turn off Session View within the initial integration discussions but there's value in having an empty state.
visibility: @norrietaylor @snehsach19