-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Security Solution] add defend insights elastic assistant tool #198676
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
Merged
Merged
Changes from all commits
Commits
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
217 changes: 217 additions & 0 deletions
217
...ckages/kbn-elastic-assistant-common/impl/schemas/defend_insights/common_attributes.gen.ts
This file contains hidden or 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,217 @@ | ||
| /* | ||
| * 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. | ||
| */ | ||
|
|
||
| /* | ||
| * NOTICE: Do not edit this file manually. | ||
| * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. | ||
| * | ||
| * info: | ||
| * title: Common Defend Insights Attributes | ||
| * version: not applicable | ||
| */ | ||
|
|
||
| import { z } from '@kbn/zod'; | ||
|
|
||
| import { NonEmptyString, User } from '../common_attributes.gen'; | ||
| import { Replacements, ApiConfig } from '../conversations/common_attributes.gen'; | ||
|
|
||
| /** | ||
| * A Defend insight event | ||
| */ | ||
| export type DefendInsightEvent = z.infer<typeof DefendInsightEvent>; | ||
| export const DefendInsightEvent = z.object({ | ||
| /** | ||
| * The event's ID | ||
| */ | ||
| id: z.string(), | ||
| /** | ||
| * The endpoint's ID | ||
| */ | ||
| endpointId: z.string(), | ||
| /** | ||
| * The value of the event | ||
| */ | ||
| value: z.string(), | ||
| }); | ||
|
|
||
| /** | ||
| * The insight type (ie. incompatible_antivirus) | ||
| */ | ||
| export type DefendInsightType = z.infer<typeof DefendInsightType>; | ||
| export const DefendInsightType = z.enum(['incompatible_antivirus', 'noisy_process_tree']); | ||
| export type DefendInsightTypeEnum = typeof DefendInsightType.enum; | ||
| export const DefendInsightTypeEnum = DefendInsightType.enum; | ||
|
|
||
| /** | ||
| * A Defend insight generated from endpoint events | ||
| */ | ||
| export type DefendInsight = z.infer<typeof DefendInsight>; | ||
| export const DefendInsight = z.object({ | ||
| /** | ||
| * The group category of the events (ie. Windows Defender) | ||
| */ | ||
| group: z.string(), | ||
| /** | ||
| * An array of event objects | ||
| */ | ||
| events: z.array(DefendInsightEvent).optional(), | ||
| }); | ||
|
|
||
| /** | ||
| * Array of Defend insights | ||
| */ | ||
| export type DefendInsights = z.infer<typeof DefendInsights>; | ||
| export const DefendInsights = z.array(DefendInsight); | ||
|
|
||
| /** | ||
| * The status of the Defend insight. | ||
| */ | ||
| export type DefendInsightStatus = z.infer<typeof DefendInsightStatus>; | ||
| export const DefendInsightStatus = z.enum(['running', 'succeeded', 'failed', 'canceled']); | ||
| export type DefendInsightStatusEnum = typeof DefendInsightStatus.enum; | ||
| export const DefendInsightStatusEnum = DefendInsightStatus.enum; | ||
|
|
||
| /** | ||
| * Run durations for the Defend insight | ||
| */ | ||
| export type DefendInsightGenerationInterval = z.infer<typeof DefendInsightGenerationInterval>; | ||
| export const DefendInsightGenerationInterval = z.object({ | ||
| /** | ||
| * The time the Defend insight was generated | ||
| */ | ||
| date: z.string(), | ||
| /** | ||
| * The duration of the Defend insight generation | ||
| */ | ||
| durationMs: z.number().int(), | ||
| }); | ||
|
|
||
| export type DefendInsightsResponse = z.infer<typeof DefendInsightsResponse>; | ||
| export const DefendInsightsResponse = z.object({ | ||
| id: NonEmptyString, | ||
| timestamp: NonEmptyString.optional(), | ||
| /** | ||
| * The last time the Defend insight was updated. | ||
| */ | ||
| updatedAt: z.string(), | ||
| /** | ||
| * The last time the Defend insight was viewed in the browser. | ||
| */ | ||
| lastViewedAt: z.string(), | ||
| /** | ||
| * The number of events in the context. | ||
| */ | ||
| eventsContextCount: z.number().int().optional(), | ||
| /** | ||
| * The time the Defend insight was created. | ||
| */ | ||
| createdAt: z.string(), | ||
| replacements: Replacements.optional(), | ||
| users: z.array(User), | ||
| /** | ||
| * The status of the Defend insight. | ||
| */ | ||
| status: DefendInsightStatus, | ||
| endpointIds: z.array(NonEmptyString), | ||
| insightType: DefendInsightType, | ||
| /** | ||
| * The Defend insights. | ||
| */ | ||
| insights: DefendInsights, | ||
| /** | ||
| * LLM API configuration. | ||
| */ | ||
| apiConfig: ApiConfig, | ||
| /** | ||
| * Kibana space | ||
| */ | ||
| namespace: z.string(), | ||
| /** | ||
| * The backing index required for update requests. | ||
| */ | ||
| backingIndex: z.string(), | ||
| /** | ||
| * The most 5 recent generation intervals | ||
| */ | ||
| generationIntervals: z.array(DefendInsightGenerationInterval), | ||
| /** | ||
| * The average generation interval in milliseconds | ||
| */ | ||
| averageIntervalMs: z.number().int(), | ||
| /** | ||
| * The reason for a status of failed. | ||
| */ | ||
| failureReason: z.string().optional(), | ||
| }); | ||
|
|
||
| export type DefendInsightUpdateProps = z.infer<typeof DefendInsightUpdateProps>; | ||
| export const DefendInsightUpdateProps = z.object({ | ||
| id: NonEmptyString, | ||
| /** | ||
| * LLM API configuration. | ||
| */ | ||
| apiConfig: ApiConfig.optional(), | ||
| /** | ||
| * The number of events in the context. | ||
| */ | ||
| eventsContextCount: z.number().int().optional(), | ||
| /** | ||
| * The Defend insights. | ||
| */ | ||
| insights: DefendInsights.optional(), | ||
| /** | ||
| * The status of the Defend insight. | ||
| */ | ||
| status: DefendInsightStatus.optional(), | ||
| replacements: Replacements.optional(), | ||
| /** | ||
| * The most 5 recent generation intervals | ||
| */ | ||
| generationIntervals: z.array(DefendInsightGenerationInterval).optional(), | ||
| /** | ||
| * The backing index required for update requests. | ||
| */ | ||
| backingIndex: z.string(), | ||
| /** | ||
| * The reason for a status of failed. | ||
| */ | ||
| failureReason: z.string().optional(), | ||
| /** | ||
| * The last time the Defend insight was viewed in the browser. | ||
| */ | ||
| lastViewedAt: z.string().optional(), | ||
| }); | ||
|
|
||
| export type DefendInsightsUpdateProps = z.infer<typeof DefendInsightsUpdateProps>; | ||
| export const DefendInsightsUpdateProps = z.array(DefendInsightUpdateProps); | ||
|
|
||
| export type DefendInsightCreateProps = z.infer<typeof DefendInsightCreateProps>; | ||
| export const DefendInsightCreateProps = z.object({ | ||
| /** | ||
| * The Defend insight id. | ||
| */ | ||
| id: z.string().optional(), | ||
| /** | ||
| * The status of the Defend insight. | ||
| */ | ||
| status: DefendInsightStatus, | ||
| /** | ||
| * The number of events in the context. | ||
| */ | ||
| eventsContextCount: z.number().int().optional(), | ||
| endpointIds: z.array(NonEmptyString), | ||
| insightType: DefendInsightType, | ||
| /** | ||
| * The Defend insights. | ||
| */ | ||
| insights: DefendInsights, | ||
| /** | ||
| * LLM API configuration. | ||
| */ | ||
| apiConfig: ApiConfig, | ||
| replacements: Replacements.optional(), | ||
| }); | ||
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.
Uh oh!
There was an error while loading. Please reload this page.