-
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
Merged
Merged
Changes from 109 commits
Commits
Show all changes
161 commits
Select commit
Hold shift + click to select a range
8b9160f
cancel wip
tomsonpl 024e578
cancelled is not an error, fix ts
tomsonpl d5fb0b2
fix error messgae
tomsonpl 4fd5a03
feature flag
tomsonpl 5eb0e99
Merge branch 'main' into mde-cancel-action
tomsonpl a6c07cb
refactor api to use actionId, add picker
tomsonpl 8e1433c
refactor argument selectors
tomsonpl 0692b0e
fix types
tomsonpl adc3f2e
Merge branch 'refs/heads/main' into mde-cancel-action
tomsonpl 5c5483b
changes after merge
tomsonpl 85058c4
remove pending actions endpoint and use lists
tomsonpl 326d47b
fix types and mark cancel action as success
tomsonpl 037f35d
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine 0693cf3
command privilege check
tomsonpl 2bdd440
fix i18n
tomsonpl c34e71d
fix tests
tomsonpl a87f7e0
Merge branch 'main' into mde-cancel-action
tomsonpl bd19683
rename id to action
tomsonpl eeda23f
fix permission check
tomsonpl ee82367
fix tests
tomsonpl 1a81edf
add more tests
tomsonpl 1a37767
fix schema
tomsonpl 135abff
[CI] Auto-commit changed files from 'yarn openapi:bundle'
kibanamachine eb30707
[CI] Auto-commit changed files from 'yarn openapi:generate'
kibanamachine 26c1979
[CI] Auto-commit changed files from 'make api-docs'
kibanamachine 3e950f5
Merge branch 'main' into mde-cancel-action
tomsonpl b7d9a13
change options labels
tomsonpl f25b51b
Merge remote-tracking branch 'origin/mde-cancel-action' into mde-canc…
tomsonpl a8af013
check privileges on options
tomsonpl 68eb9ef
comment
tomsonpl ae2990e
Merge branch 'main' into mde-cancel-action
tomsonpl d3f62d0
turn off FF
tomsonpl 2f6e1fb
remove redundant code
tomsonpl 9672ff0
[CI] Auto-commit changed files from 'yarn openapi:generate'
kibanamachine 1fb89f6
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine 6b4b4d4
fix authz import
tomsonpl 19871a6
fix cancel gen
tomsonpl 7e45f27
Merge remote-tracking branch 'origin/mde-cancel-action' into mde-canc…
tomsonpl 2fed030
fix types
tomsonpl 8a5850f
schema
tomsonpl 2ff53c4
[CI] Auto-commit changed files from 'yarn openapi:bundle'
kibanamachine 3eae5c9
[CI] Auto-commit changed files from 'make api-docs'
kibanamachine 230aff0
fix types and fix bug with timestamp
tomsonpl e3b8d81
Merge remote-tracking branch 'origin/mde-cancel-action' into mde-canc…
tomsonpl 047dedb
fix some tests
tomsonpl 1391baf
fix tests and temporary enable ff
tomsonpl e230944
fix tests
tomsonpl ffd4456
lint
tomsonpl bc23eee
type fix
tomsonpl a540e59
Merge branch 'main' into mde-cancel-action
tomsonpl 57e2ebf
add check for already canceled action
tomsonpl 20d4b6a
tests
tomsonpl 563e2cc
simplify
tomsonpl 2aeca36
revert runscript changes
tomsonpl ac0cc18
[CI] Auto-commit changed files from 'yarn openapi:bundle'
kibanamachine e92c47b
[CI] Auto-commit changed files from 'make api-docs'
kibanamachine f4a67e1
Merge branch 'main' into mde-cancel-action
tomsonpl 7ccb1e0
Merge branch 'main' into mde-cancel-action
tomsonpl f69e1a7
Merge remote-tracking branch 'origin/mde-cancel-action' into mde-canc…
tomsonpl 53550b0
Merge branch 'main' into mde-cancel-action
tomsonpl 7cfec25
skip validation for cancel
tomsonpl 0320c4e
remove redundant change
tomsonpl 4dde129
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine e6912ff
Revert "remove redundant change"
tomsonpl a18ef3d
Merge remote-tracking branch 'origin/mde-cancel-action' into mde-canc…
tomsonpl fab40f8
fix ts
tomsonpl c3ed137
Merge branch 'main' into mde-cancel-action
tomsonpl f1af933
Merge branch 'main' into mde-cancel-action
tomsonpl 09bdcfd
apply cr comments re privilege check
tomsonpl 0072149
missing file
tomsonpl 97004dd
Merge branch 'main' into mde-cancel-action
tomsonpl f89ea8b
[CI] Auto-commit changed files from 'yarn openapi:bundle'
kibanamachine c6ba998
[CI] Auto-commit changed files from 'make api-docs'
kibanamachine d3ef218
[CI] Auto-commit changed files from 'yarn openapi:generate'
kibanamachine 9107840
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine 792124d
fix type
tomsonpl 253cca9
Merge remote-tracking branch 'origin/mde-cancel-action' into mde-canc…
tomsonpl 4ac6615
Merge branch 'refs/heads/main' into mde-cancel-action
tomsonpl fbc6408
fix
tomsonpl 66992dc
[CI] Auto-commit changed files from 'yarn openapi:bundle'
kibanamachine 017aaaa
[CI] Auto-commit changed files from 'make api-docs'
kibanamachine 8599491
[CI] Auto-commit changed files from 'yarn openapi:generate'
kibanamachine 6b9a91e
fix tests
tomsonpl 376245d
Merge remote-tracking branch 'origin/mde-cancel-action' into mde-canc…
tomsonpl b5a5528
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine 87743fa
fix tests
tomsonpl 26ec947
Merge remote-tracking branch 'origin/mde-cancel-action' into mde-canc…
tomsonpl 9678d61
fix
tomsonpl 16102bb
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine 14b8b4b
fix
tomsonpl 9d27ccc
Merge remote-tracking branch 'origin/mde-cancel-action' into mde-canc…
tomsonpl e95b974
Merge branch 'main' into mde-cancel-action
tomsonpl 4b28cb3
Merge branch 'main' into mde-cancel-action
tomsonpl 63bceac
pass action_id as parameter and fix schema
tomsonpl 4d62d48
fix authz
tomsonpl 4279af8
fix types
tomsonpl 6b71b3f
fix types and i18n
tomsonpl 797a86e
removed base selector, used two components
tomsonpl a9b94dc
timestamp, usePendingActionsOptions, useIsMounted
tomsonpl 34025cf
fix description
tomsonpl cac0dbf
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine 3a226d0
remove redundant change
tomsonpl ae82a96
Merge remote-tracking branch 'origin/mde-cancel-action' into mde-canc…
tomsonpl f07f4cf
Merge branch 'main' into mde-cancel-action
tomsonpl d075a6c
clean up after merge
tomsonpl 9bc4e36
fix and tests
tomsonpl b10913c
fix
tomsonpl d01c278
clean up
tomsonpl c24ca44
clean up
tomsonpl 376b3c3
fix tests
tomsonpl afdbdbc
fix test
tomsonpl 134f43a
Merge branch 'main' into mde-cancel-action
tomsonpl 71a0428
remove meta, and protected methods on base class, fix endpoint auth
tomsonpl a1844bf
revert canReadSecuritySolution as baseline, use canAccessResponseConsole
tomsonpl b7392fb
rename logger
tomsonpl 1069a3f
add return type
tomsonpl 150143d
add test when ff is disabled
tomsonpl 3015d18
change protected into private function
tomsonpl 0cfb3f3
get rid of resolveExternalActionId
tomsonpl e6b1ae0
fix
tomsonpl d3688bf
move cancel validation to validateRequest
tomsonpl 096c686
reuse existing methods
tomsonpl 3ebd5e8
fixes
tomsonpl 8a5da4a
fix output type
tomsonpl 2b49af6
remove getpendingactions, use useGetEndpointActionList
tomsonpl c4da081
add tests
tomsonpl 46292b4
fix
tomsonpl df6ee6f
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine 235ce10
Merge branch 'main' into mde-cancel-action
tomsonpl 1725ae9
remove cancelActionHandler
tomsonpl 41ad88d
revert ff
tomsonpl 966d8ca
Merge remote-tracking branch 'origin/mde-cancel-action' into mde-canc…
tomsonpl e37dbf8
fix ts
tomsonpl b51ffdb
remove checkForAlreadyCanceledAction
tomsonpl a33603c
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine a51ac19
fix tests
tomsonpl 22a5265
Merge remote-tracking branch 'origin/mde-cancel-action' into mde-canc…
tomsonpl b49c790
Merge branch 'main' into mde-cancel-action
tomsonpl 63d8c8f
apply server changes
tomsonpl fecf640
[CI] Auto-commit changed files from 'yarn openapi:bundle'
kibanamachine cd99c18
[CI] Auto-commit changed files from 'make api-docs'
kibanamachine a69afe1
change disabled tooltip
tomsonpl b2c515e
Merge remote-tracking branch 'origin/mde-cancel-action' into mde-canc…
tomsonpl e2849bd
[CI] Auto-commit changed files from 'yarn openapi:generate'
kibanamachine 70798db
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine c29f7af
refactor tests
tomsonpl 61a47b4
Merge remote-tracking branch 'origin/mde-cancel-action' into mde-canc…
tomsonpl 151b279
fix
tomsonpl 49a508c
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine 76fe0ee
Merge branch 'main' into mde-cancel-action
tomsonpl 3a2d495
refactored canAccessResponseConsole to canAccessCancelAction
tomsonpl 9ec9073
Merge remote-tracking branch 'origin/mde-cancel-action' into mde-canc…
tomsonpl 8008ffd
expect ts error
tomsonpl 6b23319
[CI] Auto-commit changed files from 'node scripts/eslint_all_files --…
kibanamachine 902ffd7
Merge branch 'main' into mde-cancel-action
tomsonpl 7ddf79a
Merge branch 'main' into mde-cancel-action
tomsonpl b4a4c10
Merge branch 'main' into mde-cancel-action
tomsonpl 524dcc4
Merge branch 'main' into mde-cancel-action
tomsonpl 1737e09
Merge branch 'main' into mde-cancel-action
tomsonpl d8fd9a2
Merge branch 'main' into mde-cancel-action
tomsonpl 83bb54b
Merge branch 'main' into mde-cancel-action
tomsonpl 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
41 changes: 41 additions & 0 deletions
41
...ugins/security_solution/common/api/endpoint/actions/response_actions/cancel/cancel.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,41 @@ | ||
| /* | ||
| * 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, | ||
| BaseActionSchema, | ||
| } from '../../../model/schema/common.gen'; | ||
|
|
||
| export type CancelRouteRequestBody = z.infer<typeof CancelRouteRequestBody>; | ||
| export const CancelRouteRequestBody = BaseActionSchema.merge( | ||
| z.object({ | ||
| parameters: 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; |
55 changes: 55 additions & 0 deletions
55
.../security_solution/common/api/endpoint/actions/response_actions/cancel/cancel.schema.yaml
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,55 @@ | ||
| 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' | ||
| examples: | ||
| MicrosoftDefenderEndpoint: | ||
| summary: Cancel a response action on a Microsoft Defender for Endpoint host | ||
| value: | ||
| endpoint_ids: | ||
| - 'ed518850-681a-4d60-bb98-e22640cae2a8' | ||
| agent_type: 'microsoft_defender_endpoint' | ||
| parameters: | ||
| action_id: '7f8c9b2a-4d3e-4f5a-8b1c-2e3f4a5b6c7d' | ||
| comment: 'Cancelling action due to change in requirements' | ||
| 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: | ||
| - $ref: '../../../model/schema/common.schema.yaml#/components/schemas/BaseActionSchema' | ||
| - type: object | ||
| required: | ||
| - parameters | ||
| properties: | ||
| parameters: | ||
| required: | ||
| - action_id | ||
| type: object | ||
| properties: | ||
| action_id: | ||
| type: string | ||
| minLength: 1 | ||
| description: ID of the response action to cancel | ||
| example: '7f8c9b2a-4d3e-4f5a-8b1c-2e3f4a5b6c7d' | ||
30 changes: 30 additions & 0 deletions
30
...y/plugins/security_solution/common/api/endpoint/actions/response_actions/cancel/cancel.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,30 @@ | ||
| /* | ||
| * 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, | ||
| parameters: schema.object({ | ||
| 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>; | ||
8 changes: 8 additions & 0 deletions
8
...ty/plugins/security_solution/common/api/endpoint/actions/response_actions/cancel/index.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,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'; |
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
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.