-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] Refactor NetworkTopNFlow to use Search Strategy
- Loading branch information
1 parent
9e52ca6
commit de38d64
Showing
15 changed files
with
922 additions
and
383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
x-pack/plugins/security_solution/common/search_strategy/security_solution/network/common.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* 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 { GeoEcs } from '../../../ecs/geo'; | ||
import { Maybe } from '..'; | ||
|
||
export enum NetworkTopTablesFields { | ||
bytes_in = 'bytes_in', | ||
bytes_out = 'bytes_out', | ||
flows = 'flows', | ||
destination_ips = 'destination_ips', | ||
source_ips = 'source_ips', | ||
} | ||
|
||
export interface NetworkTopTablesSortField { | ||
field: NetworkTopTablesFields; | ||
direction: Direction; | ||
} | ||
|
||
export enum FlowTargetSourceDest { | ||
destination = 'destination', | ||
source = 'source', | ||
} | ||
|
||
export enum Direction { | ||
asc = 'asc', | ||
desc = 'desc', | ||
} | ||
|
||
export interface GeoItem { | ||
geo?: Maybe<GeoEcs>; | ||
flowTarget?: Maybe<FlowTargetSourceDest>; | ||
} | ||
|
||
export interface TopNetworkTablesEcsField { | ||
bytes_in?: Maybe<number>; | ||
bytes_out?: Maybe<number>; | ||
} |
71 changes: 71 additions & 0 deletions
71
x-pack/plugins/security_solution/common/search_strategy/security_solution/network/http.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* 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 { Direction } from './common'; | ||
import { | ||
CursorType, | ||
GenericBuckets, | ||
Inspect, | ||
Maybe, | ||
PageInfoPaginated, | ||
RequestOptionsPaginated, | ||
} from '..'; | ||
|
||
export interface NetworkHttpRequestOptions extends RequestOptionsPaginated { | ||
ip?: string; | ||
networkHttpSort: NetworkHttpSortField; | ||
defaultIndex: string[]; | ||
} | ||
|
||
export interface NetworkHttpStrategyResponse extends IEsSearchResponse { | ||
edges: NetworkHttpEdges[]; | ||
totalCount: number; | ||
pageInfo: PageInfoPaginated; | ||
inspect?: Maybe<Inspect>; | ||
} | ||
|
||
export interface NetworkHttpSortField { | ||
direction: Direction; | ||
} | ||
|
||
export interface NetworkHttpData { | ||
edges: NetworkHttpEdges[]; | ||
totalCount: number; | ||
pageInfo: PageInfoPaginated; | ||
inspect?: Maybe<Inspect>; | ||
} | ||
|
||
export interface NetworkHttpEdges { | ||
node: NetworkHttpItem; | ||
cursor: CursorType; | ||
} | ||
|
||
export interface NetworkHttpItem { | ||
_id?: Maybe<string>; | ||
domains: string[]; | ||
lastHost?: Maybe<string>; | ||
lastSourceIp?: Maybe<string>; | ||
methods: string[]; | ||
path?: Maybe<string>; | ||
requestCount?: Maybe<number>; | ||
statuses: string[]; | ||
} | ||
|
||
export interface NetworkHttpBuckets { | ||
key: string; | ||
doc_count: number; | ||
domains: { | ||
buckets: GenericBuckets[]; | ||
}; | ||
methods: { | ||
buckets: GenericBuckets[]; | ||
}; | ||
source: object; | ||
status: { | ||
buckets: GenericBuckets[]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.