-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[EDR Workflows] Add Cancel response action to MDE #230399
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
Changes from 81 commits
8b9160f
024e578
d5fb0b2
4fd5a03
5eb0e99
a6c07cb
8e1433c
0692b0e
adc3f2e
5c5483b
85058c4
326d47b
037f35d
0693cf3
2bdd440
c34e71d
a87f7e0
bd19683
eeda23f
ee82367
1a81edf
1a37767
135abff
eb30707
26c1979
3e950f5
b7d9a13
f25b51b
a8af013
68eb9ef
ae2990e
d3f62d0
2f6e1fb
9672ff0
1fb89f6
6b4b4d4
19871a6
7e45f27
2fed030
8a5850f
2ff53c4
3eae5c9
230aff0
e3b8d81
047dedb
1391baf
e230944
ffd4456
bc23eee
a540e59
57e2ebf
20d4b6a
563e2cc
2aeca36
ac0cc18
e92c47b
f4a67e1
7ccb1e0
f69e1a7
53550b0
7cfec25
0320c4e
4dde129
e6912ff
a18ef3d
fab40f8
c3ed137
f1af933
09bdcfd
0072149
97004dd
f89ea8b
c6ba998
d3ef218
9107840
792124d
253cca9
4ac6615
fbc6408
66992dc
017aaaa
8599491
6b9a91e
376245d
b5a5528
87743fa
26ec947
9678d61
16102bb
14b8b4b
9d27ccc
e95b974
4b28cb3
63bceac
4d62d48
4279af8
6b71b3f
797a86e
a9b94dc
34025cf
cac0dbf
3a226d0
ae82a96
f07f4cf
d075a6c
9bc4e36
b10913c
d01c278
c24ca44
376b3c3
afdbdbc
134f43a
71a0428
a1844bf
b7392fb
1069a3f
150143d
3015d18
0cfb3f3
e6b1ae0
d3688bf
096c686
3ebd5e8
8a5da4a
2b49af6
c4da081
46292b4
df6ee6f
235ce10
1725ae9
41ad88d
966d8ca
e37dbf8
b51ffdb
a33603c
a51ac19
22a5265
b49c790
63d8c8f
fecf640
cd99c18
a69afe1
b2c515e
e2849bd
70798db
c29f7af
61a47b4
151b279
49a508c
76fe0ee
3a2d495
9ec9073
8008ffd
6b23319
902ffd7
7ddf79a
b4a4c10
524dcc4
1737e09
d8fd9a2
83bb54b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| /* | ||
| * 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: Cancel Action Schema | ||
| * version: 2023-10-31 | ||
| */ | ||
|
|
||
| import { z } from '@kbn/zod'; | ||
|
|
||
| import { ResponseActionCreateSuccessResponse } from '../../../model/schema/common.gen'; | ||
|
|
||
| export type CancelRouteRequestBody = z.infer<typeof CancelRouteRequestBody>; | ||
| export const CancelRouteRequestBody = z | ||
| .object({ | ||
| /** | ||
| * A list of endpoint IDs whose hosts will be isolated | ||
| */ | ||
| endpoint_ids: z.array(z.string().min(1)).min(1).optional(), | ||
| /** | ||
| * If defined, any case associated with the given IDs will be updated | ||
| */ | ||
| alert_ids: z.array(z.string().min(1)).min(1).optional(), | ||
| /** | ||
| * Case IDs to be updated | ||
| */ | ||
| case_ids: z.array(z.string().min(1)).min(1).optional(), | ||
| /** | ||
| * Optional comment explaining the reason for canceling the action | ||
| */ | ||
| comment: z.string().optional(), | ||
| /** | ||
| * The agent type to target for the action | ||
| */ | ||
| agent_type: z | ||
| .enum(['endpoint', 'sentinel_one', 'crowdstrike', 'microsoft_defender_endpoint']) | ||
| .optional() | ||
| .default('endpoint'), | ||
| }) | ||
| .merge( | ||
| z.object({ | ||
| /** | ||
| * ID of the response action to cancel | ||
| */ | ||
| action_id: z.string().min(1), | ||
| }) | ||
| ); | ||
|
|
||
| export type CancelActionRequestBody = z.infer<typeof CancelActionRequestBody>; | ||
| export const CancelActionRequestBody = CancelRouteRequestBody; | ||
| export type CancelActionRequestBodyInput = z.input<typeof CancelActionRequestBody>; | ||
|
|
||
| export type CancelActionResponse = z.infer<typeof CancelActionResponse>; | ||
| export const CancelActionResponse = ResponseActionCreateSuccessResponse; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| openapi: 3.0.0 | ||
| info: | ||
| title: Cancel Action Schema | ||
| version: '2023-10-31' | ||
| description: Schema for canceling response actions | ||
| paths: | ||
| /api/endpoint/action/cancel: | ||
| post: | ||
| summary: Cancel a response action | ||
| operationId: CancelAction | ||
| description: Cancel a running or pending response action (Applies only to some agent types). | ||
| x-codegen-enabled: true | ||
| x-labels: [ ess, serverless ] | ||
| requestBody: | ||
| required: true | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '#/components/schemas/CancelRouteRequestBody' | ||
| responses: | ||
| '200': | ||
| description: Successfully cancelled the response action | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: '../../../model/schema/common.schema.yaml#/components/schemas/ResponseActionCreateSuccessResponse' | ||
| components: | ||
| schemas: | ||
| CancelRouteRequestBody: | ||
| allOf: | ||
| - type: object | ||
|
||
| properties: | ||
| # Base action request properties would be referenced here if base schema existed | ||
| endpoint_ids: | ||
| type: array | ||
| items: | ||
| type: string | ||
| minLength: 1 | ||
| minItems: 1 | ||
| description: A list of endpoint IDs whose hosts will be isolated | ||
| alert_ids: | ||
| type: array | ||
| items: | ||
| type: string | ||
| minLength: 1 | ||
| minItems: 1 | ||
| description: If defined, any case associated with the given IDs will be updated | ||
| case_ids: | ||
| type: array | ||
| items: | ||
| type: string | ||
| minLength: 1 | ||
| minItems: 1 | ||
| description: Case IDs to be updated | ||
| comment: | ||
| type: string | ||
| description: Optional comment explaining the reason for canceling the action | ||
| agent_type: | ||
| type: string | ||
| enum: [ endpoint, sentinel_one, crowdstrike, microsoft_defender_endpoint ] | ||
| default: endpoint | ||
| description: The agent type to target for the action | ||
| - type: object | ||
| required: | ||
| - action_id | ||
| properties: | ||
| action_id: | ||
| type: string | ||
| minLength: 1 | ||
| description: ID of the response action to cancel | ||
| example: '7f8c9b2a-4d3e-4f5a-8b1c-2e3f4a5b6c7d' | ||
|
|
||
| examples: | ||
| CancelActionRequestExample: | ||
| summary: Cancel a response action | ||
| value: | ||
| action_id: '7f8c9b2a-4d3e-4f5a-8b1c-2e3f4a5b6c7d' | ||
| endpoint_ids: [ '2f8e9c3a-5d4e-4f5a-9b1c-3e4f5a6b7c8d' ] | ||
| comment: 'Cancelling action due to change in requirements' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /* | ||
| * 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 { TypeOf } from '@kbn/config-schema'; | ||
| import { schema } from '@kbn/config-schema'; | ||
| import { BaseActionRequestSchema } from '../../common/base'; | ||
|
|
||
| const CancelActionRequestBodySchema = schema.object({ | ||
| ...BaseActionRequestSchema, | ||
| action_id: schema.string({ | ||
|
||
| minLength: 1, | ||
| validate: (value) => { | ||
| if (!value.trim().length) { | ||
| return 'action_id cannot be an empty string'; | ||
| } | ||
| }, | ||
| }), | ||
| }); | ||
|
|
||
| export const CancelActionRequestSchema = { | ||
| body: CancelActionRequestBodySchema, | ||
| }; | ||
|
|
||
| export type CancelActionRequestBody = TypeOf<typeof CancelActionRequestSchema.body>; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| /* | ||
| * 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. | ||
| */ | ||
|
|
||
| export * from './cancel'; |
Uh oh!
There was an error while loading. Please reload this page.