Skip to content
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] Refactor timeline details to use search strategy #75591

Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
38c708d
add security solution search strategy on server side
XavierM Aug 14, 2020
c3d37ca
Merge branch 'master' of github.com:elastic/kibana into securiy-solut…
XavierM Aug 17, 2020
5d80f40
Merge branch 'master' of github.com:elastic/kibana into securiy-solut…
XavierM Aug 17, 2020
0fdc5d6
get security solution search strategy in the public app for all host
XavierM Aug 19, 2020
e6b0a35
Merge branch 'master' of github.com:elastic/kibana into securiy-solut…
XavierM Aug 19, 2020
9756431
fix types
XavierM Aug 19, 2020
819e0ca
fix Check core API changes
XavierM Aug 19, 2020
6309135
thank you cypress test
XavierM Aug 19, 2020
aeb5779
Merge branch 'master' into securiy-solution-search-strategy
elasticmachine Aug 20, 2020
8cc574e
Remove any by the right type IESearchRequest
XavierM Aug 20, 2020
6a59240
Merge branch 'master' of github.com:elastic/kibana into securiy-solut…
XavierM Aug 20, 2020
0b66d2a
add translation and filter error when we abort the query
XavierM Aug 20, 2020
9accea5
pr review
XavierM Aug 20, 2020
8731418
fix translation
XavierM Aug 20, 2020
cd70a76
init
patrykkopycinski Aug 20, 2020
a2c7e4e
Merge branch 'master' into securiy-solution-search-strategy
elasticmachine Aug 20, 2020
d8ab560
Merge branch 'securiy-solution-search-strategy' of github.com:XavierM…
patrykkopycinski Aug 20, 2020
4ee7bf9
update types
patrykkopycinski Aug 23, 2020
a63facf
Merge branch 'master' of github.com:elastic/kibana into feat/timeline…
patrykkopycinski Aug 24, 2020
8234506
revert api docs
patrykkopycinski Aug 24, 2020
9c682f6
Merge branch 'master' of github.com:elastic/kibana into feat/timeline…
patrykkopycinski Sep 2, 2020
2e36ea0
imports
patrykkopycinski Sep 2, 2020
72e6f2e
Merge branch 'master' into feat/timeline-details-search-strategy
elasticmachine Sep 2, 2020
e512f1d
PR comments
patrykkopycinski Sep 3, 2020
3370520
fix test
patrykkopycinski Sep 3, 2020
c3d82a8
Merge branch 'master' of github.com:elastic/kibana into feat/timeline…
patrykkopycinski Sep 3, 2020
a055a5b
Fix types
patrykkopycinski Sep 3, 2020
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
24 changes: 0 additions & 24 deletions x-pack/plugins/security_solution/common/ecs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,52 +27,28 @@ import { SystemEcs } from './system';

export interface Ecs {
_id: string;

_index?: string;

auditd?: AuditdEcs;

destination?: DestinationEcs;

dns?: DnsEcs;

endgame?: EndgameEcs;

event?: EventEcs;

geo?: GeoEcs;

host?: HostEcs;

network?: NetworkEcs;

rule?: RuleEcs;

signal?: SignalEcs;

source?: SourceEcs;

suricata?: SuricataEcs;

tls?: TlsEcs;

zeek?: ZeekEcs;

http?: HttpEcs;

url?: UrlEcs;

timestamp?: string;

message?: string[];

user?: UserEcs;

winlog?: WinlogEcs;

process?: ProcessEcs;

file?: File;

system?: SystemEcs;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { IEsSearchResponse } from '../../../../../../src/plugins/data/common';

export type Maybe<T> = T | null;

export type SearchHit = IEsSearchResponse<object>['rawResponse']['hits']['hits'][0];

export interface TotalValue {
value: number;
relation: string;
}

export interface Inspect {
dsl: string[];
}

export interface PageInfoPaginated {
activePage: number;
fakeTotalCount: number;
showMorePagesIndicator: boolean;
}

export interface CursorType {
value?: Maybe<string>;
tiebreaker?: Maybe<string>;
}

export enum Direction {
asc = 'asc',
desc = 'desc',
}

export interface SortField<Field = string> {
field: Field;
direction: Direction;
}

export interface TimerangeInput {
/** The interval string to use for last bucket. The format is '{value}{unit}'. For example '5m' would return the metrics for the last 5 minutes of the timespan. */
interval: string;
/** The end of the timerange */
to: string;
/** The beginning of the timerange */
from: string;
}

export interface PaginationInput {
/** The limit parameter allows you to configure the maximum amount of items to be returned */
limit: number;
/** The cursor parameter defines the next result you want to fetch */
cursor?: Maybe<string>;
/** The tiebreaker parameter allow to be more precise to fetch the next item */
tiebreaker?: Maybe<string>;
}

export interface PaginationInputPaginated {
/** The activePage parameter defines the page of results you want to fetch */
activePage: number;
/** The cursorStart parameter defines the start of the results to be displayed */
cursorStart: number;
/** The fakePossibleCount parameter determines the total count in order to show 5 additional pages */
fakePossibleCount: number;
/** The querySize parameter is the number of items to be returned */
querySize: number;
}

export interface DocValueFields {
field: string;
format: string;
}

export interface Explanation {
value: number;
description: string;
details: Explanation[];
}

export interface TotalValue {
value: number;
relation: string;
}
export interface ShardsResponse {
total: number;
successful: number;
failed: number;
skipped: number;
}

export interface TotalHit {
value: number;
relation: string;
}

export interface Hit {
_index: string;
_type: string;
_id: string;
_score: number | null;
}

export interface Hits<T, U> {
hits: {
total: T;
max_score: number | null;
hits: U[];
};
}

export interface GenericBuckets {
key: string;
doc_count: number;
}

export type StringOrNumber = string | number;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

export * from './common';
export * from './security_solution';
export * from './timeline';
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { IEsSearchRequest, IEsSearchResponse } from '../../../../../../src/plugins/data/common';
import { IEsSearchRequest } from '../../../../../../src/plugins/data/common';
import { ESQuery } from '../../typed_json';
import {
HostOverviewStrategyResponse,
Expand All @@ -26,116 +26,20 @@ import {
NetworkHttpStrategyResponse,
NetworkHttpRequestOptions,
} from './network';
import {
DocValueFields,
TimerangeInput,
SortField,
PaginationInput,
PaginationInputPaginated,
} from '../common';

export * from './hosts';
export * from './network';
export type Maybe<T> = T | null;
export * from '../common';

export type FactoryQueryTypes = HostsQueries | NetworkQueries;

export type SearchHit = IEsSearchResponse<object>['rawResponse']['hits']['hits'][0];

export interface TotalValue {
value: number;
relation: string;
}

export interface Inspect {
dsl: string[];
}

export interface PageInfoPaginated {
activePage: number;
fakeTotalCount: number;
showMorePagesIndicator: boolean;
}

export interface CursorType {
value?: Maybe<string>;
tiebreaker?: Maybe<string>;
}

export enum Direction {
asc = 'asc',
desc = 'desc',
}

export interface SortField<Field = string> {
field: Field;
direction: Direction;
}

export interface TimerangeInput {
/** The interval string to use for last bucket. The format is '{value}{unit}'. For example '5m' would return the metrics for the last 5 minutes of the timespan. */
interval: string;
/** The end of the timerange */
to: string;
/** The beginning of the timerange */
from: string;
}

export interface PaginationInput {
/** The limit parameter allows you to configure the maximum amount of items to be returned */
limit: number;
/** The cursor parameter defines the next result you want to fetch */
cursor?: Maybe<string>;
/** The tiebreaker parameter allow to be more precise to fetch the next item */
tiebreaker?: Maybe<string>;
}

export interface PaginationInputPaginated {
/** The activePage parameter defines the page of results you want to fetch */
activePage: number;
/** The cursorStart parameter defines the start of the results to be displayed */
cursorStart: number;
/** The fakePossibleCount parameter determines the total count in order to show 5 additional pages */
fakePossibleCount: number;
/** The querySize parameter is the number of items to be returned */
querySize: number;
}

export interface DocValueFields {
field: string;
format: string;
}

export interface Explanation {
value: number;
description: string;
details: Explanation[];
}

export interface TotalValue {
value: number;
relation: string;
}
export interface ShardsResponse {
total: number;
successful: number;
failed: number;
skipped: number;
}

export interface TotalHit {
value: number;
relation: string;
}

export interface Hit {
_index: string;
_type: string;
_id: string;
_score: number | null;
}

export interface Hits<T, U> {
hits: {
total: T;
max_score: number | null;
hits: U[];
};
}

export interface RequestBasicOptions extends IEsSearchRequest {
timerange: TimerangeInput;
filterQuery: ESQuery | string | undefined;
Expand Down Expand Up @@ -183,10 +87,3 @@ export type StrategyRequestType<T extends FactoryQueryTypes> = T extends HostsQu
: T extends NetworkQueries.http
? NetworkHttpRequestOptions
: never;

export type StringOrNumber = string | number;

export interface GenericBuckets {
key: string;
doc_count: number;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import { IEsSearchResponse } from '../../../../../../../src/plugins/data/common';
import { Inspect, Maybe } from '../../common';
import { TimelineRequestOptionsPaginated } from '..';

export interface DetailItem {
field: string;
values?: Maybe<string[]>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
originalValue?: Maybe<any>;
}

export interface TimelineDetailsStrategyResponse extends IEsSearchResponse {
data?: Maybe<DetailItem[]>;
inspect?: Maybe<Inspect>;
}

export interface TimelineDetailsRequestOptions extends Partial<TimelineRequestOptionsPaginated> {
defaultIndex: string[];
executeQuery: boolean;
indexName: string;
eventId: string;
}
Loading