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] workflow insights service CRUD methods (elastic#2…
…01724) ## Summary Add implementation of create, update, and fetch methods for the `SecurityWorkflowInsightsService`. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios Co-authored-by: Konrad Szwarc <[email protected]>
- Loading branch information
1 parent
82de734
commit 2ba067e
Showing
6 changed files
with
419 additions
and
29 deletions.
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
x-pack/plugins/security_solution/common/endpoint/types/workflow_insights.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,78 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { Moment } from 'moment'; | ||
|
||
import type { DefendInsightType } from '@kbn/elastic-assistant-common'; | ||
import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types'; | ||
|
||
export enum Category { | ||
Endpoint = 'endpoint', | ||
} | ||
|
||
export enum SourceType { | ||
LlmConnector = 'llm-connector', | ||
} | ||
|
||
export enum TargetType { | ||
Endpoint = 'endpoint', | ||
} | ||
|
||
export enum ActionType { | ||
Refreshed = 'refreshed', // new or refreshed | ||
Remediated = 'remediated', | ||
Suppressed = 'suppressed', // temporarily supressed, can be refreshed | ||
Dismissed = 'dismissed', // "permanently" dismissed, cannot be normally refreshed | ||
} | ||
|
||
export type ExceptionListRemediationType = Pick< | ||
ExceptionListItemSchema, | ||
'list_id' | 'name' | 'description' | 'entries' | 'tags' | 'os_types' | ||
>; | ||
|
||
export interface SecurityWorkflowInsight { | ||
id?: string; | ||
'@timestamp': Moment; | ||
message: string; | ||
category: Category; | ||
type: DefendInsightType; | ||
source: { | ||
type: SourceType; | ||
id: string; | ||
data_range_start: Moment; | ||
data_range_end: Moment; | ||
}; | ||
target: { | ||
type: TargetType; | ||
ids: string[]; | ||
}; | ||
action: { | ||
type: ActionType; | ||
timestamp: Moment; | ||
}; | ||
value: string; | ||
remediation: { | ||
exception_list_items?: ExceptionListRemediationType[]; | ||
}; | ||
metadata: { | ||
notes?: Record<string, string>; | ||
message_variables?: string[]; | ||
}; | ||
} | ||
|
||
export interface SearchParams { | ||
size?: number; | ||
from?: number; | ||
ids?: string[]; | ||
categories?: Category[]; | ||
types?: DefendInsightType[]; | ||
sourceTypes?: SourceType[]; | ||
sourceIds?: string[]; | ||
targetTypes?: TargetType[]; | ||
targetIds?: string[]; | ||
actionTypes: ActionType[]; | ||
} |
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.