-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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 Hosts Kpi to use Search Strategy #77606
Merged
patrykkopycinski
merged 14 commits into
elastic:master
from
patrykkopycinski:feat/hosts-kpi-search-strategy
Sep 22, 2020
Merged
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ada79e6
[Security Solution] Refactor Hosts Kpi to use Search Strategy
patrykkopycinski f990b63
Merge branch 'master' of github.com:elastic/kibana into feat/hosts-kp…
patrykkopycinski e9d956e
Merge branch 'master' of github.com:elastic/kibana into feat/hosts-kp…
patrykkopycinski 1722514
WIP
patrykkopycinski 9149cff
WIP
patrykkopycinski 9098e88
Merge branch 'master' of github.com:elastic/kibana into feat/hosts-kp…
patrykkopycinski f32f8bb
Merge branch 'master' of github.com:elastic/kibana into feat/hosts-kp…
patrykkopycinski 420ac24
Merge branch 'master' of github.com:elastic/kibana into feat/hosts-kp…
patrykkopycinski 79366d1
fix tests
patrykkopycinski cc8ef71
fix inspect
patrykkopycinski 845f947
Merge branch 'master' into feat/hosts-kpi-search-strategy
elasticmachine 6d81c7e
Merge branch 'master' of github.com:elastic/kibana into feat/hosts-kp…
patrykkopycinski 5a4f4eb
PR comments
patrykkopycinski e49a239
fix translations
patrykkopycinski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
24 changes: 24 additions & 0 deletions
24
...rity_solution/common/search_strategy/security_solution/hosts/kpi/authentications/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,24 @@ | ||
/* | ||
* 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 { RequestBasicOptions } from '../../..'; | ||
import { HostsKpiHistogramData } from '../common'; | ||
|
||
export interface HostsKpiAuthenticationsHistogramCount { | ||
doc_count: number; | ||
} | ||
|
||
export type HostsKpiAuthenticationsRequestOptions = RequestBasicOptions; | ||
|
||
export interface HostsKpiAuthenticationsStrategyResponse extends IEsSearchResponse { | ||
authenticationsSuccess: Maybe<number>; | ||
authenticationsSuccessHistogram: Maybe<HostsKpiHistogramData[]>; | ||
authenticationsFailure: Maybe<number>; | ||
authenticationsFailureHistogram: Maybe<HostsKpiHistogramData[]>; | ||
inspect?: Maybe<Inspect>; | ||
} |
29 changes: 29 additions & 0 deletions
29
...gins/security_solution/common/search_strategy/security_solution/hosts/kpi/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,29 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/* | ||
* 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 { Maybe } from '../../../../common'; | ||
|
||
export interface HostsKpiHistogramData { | ||
x?: Maybe<number>; | ||
y?: Maybe<number>; | ||
} | ||
|
||
export interface HostsKpiHistogram<T> { | ||
key_as_string: string; | ||
key: number; | ||
doc_count: number; | ||
count: T; | ||
} | ||
|
||
export interface HostsKpiGeneralHistogramCount { | ||
value: number; | ||
} |
18 changes: 18 additions & 0 deletions
18
...ugins/security_solution/common/search_strategy/security_solution/hosts/kpi/hosts/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,18 @@ | ||
/* | ||
* 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 { RequestBasicOptions } from '../../..'; | ||
import { HostsKpiHistogramData } from '../common'; | ||
|
||
export type HostsKpiHostsRequestOptions = RequestBasicOptions; | ||
|
||
export interface HostsKpiHostsStrategyResponse extends IEsSearchResponse { | ||
hosts: Maybe<number>; | ||
hostsHistogram: Maybe<HostsKpiHistogramData[]>; | ||
inspect?: Maybe<Inspect>; | ||
} |
25 changes: 25 additions & 0 deletions
25
x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts/kpi/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,25 @@ | ||
/* | ||
* 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 './authentications'; | ||
export * from './common'; | ||
export * from './hosts'; | ||
export * from './unique_ips'; | ||
|
||
import { HostsKpiAuthenticationsStrategyResponse } from './authentications'; | ||
import { HostsKpiHostsStrategyResponse } from './hosts'; | ||
import { HostsKpiUniqueIpsStrategyResponse } from './unique_ips'; | ||
|
||
export enum HostsKpiQueries { | ||
kpiAuthentications = 'hostsKpiAuthentications', | ||
kpiHosts = 'hostsKpiHosts', | ||
kpiUniqueIps = 'hostsKpiUniqueIps', | ||
} | ||
|
||
export type HostsKpiStrategyResponse = | ||
| Omit<HostsKpiAuthenticationsStrategyResponse, 'rawResponse'> | ||
| Omit<HostsKpiHostsStrategyResponse, 'rawResponse'> | ||
| Omit<HostsKpiUniqueIpsStrategyResponse, 'rawResponse'>; |
20 changes: 20 additions & 0 deletions
20
.../security_solution/common/search_strategy/security_solution/hosts/kpi/unique_ips/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,20 @@ | ||
/* | ||
* 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 { RequestBasicOptions } from '../../..'; | ||
import { HostsKpiHistogramData } from '../common'; | ||
|
||
export type HostsKpiUniqueIpsRequestOptions = RequestBasicOptions; | ||
|
||
export interface HostsKpiUniqueIpsStrategyResponse extends IEsSearchResponse { | ||
uniqueSourceIps: Maybe<number>; | ||
uniqueSourceIpsHistogram: Maybe<HostsKpiHistogramData[]>; | ||
uniqueDestinationIps: Maybe<number>; | ||
uniqueDestinationIpsHistogram: Maybe<HostsKpiHistogramData[]>; | ||
inspect?: Maybe<Inspect>; | ||
} |
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could we change this to
xpack.securitySolution.authenticationsTable.authentications
instead, as its default message is authentications.