-
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 Host uncommon processes to use Search St…
…rategy (#76539) * add search strategy of uncommon processes * fixup * fix host.name * remove comment * review * revert path for libs * fix path * revert * remove additional lines * remove comment
- Loading branch information
Showing
20 changed files
with
746 additions
and
193 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
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
86 changes: 86 additions & 0 deletions
86
...urity_solution/common/search_strategy/security_solution/hosts/uncommon_processes/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,86 @@ | ||
/* | ||
* 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 { HostEcs } from '../../../../ecs/host'; | ||
import { UserEcs } from '../../../../ecs/user'; | ||
import { | ||
RequestOptionsPaginated, | ||
SortField, | ||
CursorType, | ||
Inspect, | ||
Maybe, | ||
PageInfoPaginated, | ||
Hit, | ||
TotalHit, | ||
StringOrNumber, | ||
Hits, | ||
} from '../../..'; | ||
|
||
export interface HostUncommonProcessesRequestOptions extends RequestOptionsPaginated { | ||
sort: SortField; | ||
defaultIndex: string[]; | ||
} | ||
|
||
export interface HostUncommonProcessesStrategyResponse extends IEsSearchResponse { | ||
edges: UncommonProcessesEdges[]; | ||
totalCount: number; | ||
pageInfo: PageInfoPaginated; | ||
inspect?: Maybe<Inspect>; | ||
} | ||
|
||
export interface UncommonProcessesEdges { | ||
node: UncommonProcessItem; | ||
cursor: CursorType; | ||
} | ||
|
||
export interface UncommonProcessItem { | ||
_id: string; | ||
instances: number; | ||
process: ProcessEcsFields; | ||
hosts: HostEcs[]; | ||
user?: Maybe<UserEcs>; | ||
} | ||
|
||
export interface ProcessEcsFields { | ||
hash?: Maybe<ProcessHashData>; | ||
pid?: Maybe<number[]>; | ||
name?: Maybe<string[]>; | ||
ppid?: Maybe<number[]>; | ||
args?: Maybe<string[]>; | ||
entity_id?: Maybe<string[]>; | ||
executable?: Maybe<string[]>; | ||
title?: Maybe<string[]>; | ||
thread?: Maybe<Thread>; | ||
working_directory?: Maybe<string[]>; | ||
} | ||
|
||
export interface ProcessHashData { | ||
md5?: Maybe<string[]>; | ||
sha1?: Maybe<string[]>; | ||
sha256?: Maybe<string[]>; | ||
} | ||
|
||
export interface Thread { | ||
id?: Maybe<number[]>; | ||
start?: Maybe<string[]>; | ||
} | ||
|
||
export interface UncommonProcessHit extends Hit { | ||
total: TotalHit; | ||
host: Array<{ | ||
id: string[] | undefined; | ||
name: string[] | undefined; | ||
}>; | ||
_source: { | ||
'@timestamp': string; | ||
process: ProcessEcsFields; | ||
}; | ||
cursor: string; | ||
sort: StringOrNumber[]; | ||
} | ||
|
||
export type ProcessHits = Hits<TotalHit, UncommonProcessHit>; |
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.