forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
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 Network Top Countries to use Search Stra…
…tegy (elastic#76244)
- Loading branch information
1 parent
775359c
commit 8003bc0
Showing
26 changed files
with
800 additions
and
353 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
10 changes: 10 additions & 0 deletions
10
...lugins/security_solution/common/search_strategy/security_solution/network/common/index.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,10 @@ | ||
/* | ||
* 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 enum FlowTargetSourceDest { | ||
destination = 'destination', | ||
source = 'source', | ||
} |
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
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
98 changes: 98 additions & 0 deletions
98
...security_solution/common/search_strategy/security_solution/network/top_countries/index.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,98 @@ | ||
/* | ||
* 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 { GeoEcs } from '../../../../ecs/geo'; | ||
import { CursorType, Inspect, Maybe, PageInfoPaginated, RequestOptionsPaginated } from '../..'; | ||
import { FlowTargetSourceDest } from '../common'; | ||
|
||
export enum NetworkTopTablesFields { | ||
bytes_in = 'bytes_in', | ||
bytes_out = 'bytes_out', | ||
flows = 'flows', | ||
destination_ips = 'destination_ips', | ||
source_ips = 'source_ips', | ||
} | ||
|
||
export enum NetworkDnsFields { | ||
dnsName = 'dnsName', | ||
queryCount = 'queryCount', | ||
uniqueDomains = 'uniqueDomains', | ||
dnsBytesIn = 'dnsBytesIn', | ||
dnsBytesOut = 'dnsBytesOut', | ||
} | ||
|
||
export enum FlowTarget { | ||
client = 'client', | ||
destination = 'destination', | ||
server = 'server', | ||
source = 'source', | ||
} | ||
|
||
export interface GeoItem { | ||
geo?: Maybe<GeoEcs>; | ||
flowTarget?: Maybe<FlowTargetSourceDest>; | ||
} | ||
|
||
export interface TopCountriesItemSource { | ||
country?: Maybe<string>; | ||
destination_ips?: Maybe<number>; | ||
flows?: Maybe<number>; | ||
location?: Maybe<GeoItem>; | ||
source_ips?: Maybe<number>; | ||
} | ||
|
||
export interface NetworkTopCountriesRequestOptions | ||
extends RequestOptionsPaginated<NetworkTopTablesFields> { | ||
flowTarget: FlowTargetSourceDest; | ||
ip?: string; | ||
} | ||
|
||
export interface NetworkTopCountriesStrategyResponse extends IEsSearchResponse { | ||
edges: NetworkTopCountriesEdges[]; | ||
totalCount: number; | ||
pageInfo: PageInfoPaginated; | ||
inspect?: Maybe<Inspect>; | ||
} | ||
|
||
export interface NetworkTopCountriesEdges { | ||
node: NetworkTopCountriesItem; | ||
cursor: CursorType; | ||
} | ||
|
||
export interface NetworkTopCountriesItem { | ||
_id?: Maybe<string>; | ||
source?: Maybe<TopCountriesItemSource>; | ||
destination?: Maybe<TopCountriesItemDestination>; | ||
network?: Maybe<TopNetworkTablesEcsField>; | ||
} | ||
|
||
export interface TopCountriesItemDestination { | ||
country?: Maybe<string>; | ||
destination_ips?: Maybe<number>; | ||
flows?: Maybe<number>; | ||
location?: Maybe<GeoItem>; | ||
source_ips?: Maybe<number>; | ||
} | ||
|
||
export interface TopNetworkTablesEcsField { | ||
bytes_in?: Maybe<number>; | ||
bytes_out?: Maybe<number>; | ||
} | ||
|
||
export interface NetworkTopCountriesBuckets { | ||
country: string; | ||
key: string; | ||
bytes_in: { | ||
value: number; | ||
}; | ||
bytes_out: { | ||
value: number; | ||
}; | ||
flows: number; | ||
destination_ips: number; | ||
source_ips: number; | ||
} |
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
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
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
4 changes: 2 additions & 2 deletions
4
...n/public/network/components/network_top_countries_table/__snapshots__/index.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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.