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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10990,6 +10990,39 @@ paths:
x-metaTags:
- content: Kibana, Elastic Cloud Serverless
name: product_name
/api/endpoint/action/cancel:
post:
description: Cancel a running or pending response action (Applies only to some agent types).
operationId: CancelAction
requestBody:
content:
application/json:
examples:
MicrosoftDefenderEndpoint:
summary: Cancel a response action on a Microsoft Defender for Endpoint host
value:
agent_type: microsoft_defender_endpoint
comment: Cancelling action due to change in requirements
endpoint_ids:
- ed518850-681a-4d60-bb98-e22640cae2a8
parameters:
action_id: 7f8c9b2a-4d3e-4f5a-8b1c-2e3f4a5b6c7d
schema:
$ref: '#/components/schemas/Security_Endpoint_Management_API_CancelRouteRequestBody'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Security_Endpoint_Management_API_ResponseActionCreateSuccessResponse'
description: Successfully cancelled the response action
summary: Cancel a response action
tags:
- Security Endpoint Management API
x-metaTags:
- content: Kibana, Elastic Cloud Serverless
name: product_name
/api/endpoint/action/execute:
post:
description: Run a shell command on an endpoint.
Expand Down Expand Up @@ -69371,6 +69404,54 @@ components:
- microsoft_defender_endpoint
example: endpoint
type: string
Security_Endpoint_Management_API_CancelRouteRequestBody:
allOf:
- type: object
properties:
agent_type:
$ref: '#/components/schemas/Security_Endpoint_Management_API_AgentTypes'
alert_ids:
description: If this action is associated with any alerts, they can be specified here. The action will be logged in any cases associated with the specified alerts.
example:
- alert-id-1
- alert-id-2
items:
minLength: 1
type: string
minItems: 1
type: array
case_ids:
description: The IDs of cases where the action taken will be logged.
example:
- case-id-1
- case-id-2
items:
minLength: 1
type: string
minItems: 1
type: array
comment:
$ref: '#/components/schemas/Security_Endpoint_Management_API_Comment'
endpoint_ids:
$ref: '#/components/schemas/Security_Endpoint_Management_API_EndpointIds'
parameters:
$ref: '#/components/schemas/Security_Endpoint_Management_API_Parameters'
required:
- endpoint_ids
- type: object
properties:
parameters:
type: object
properties:
action_id:
description: ID of the response action to cancel
example: 7f8c9b2a-4d3e-4f5a-8b1c-2e3f4a5b6c7d
minLength: 1
type: string
required:
- action_id
required:
- parameters
Security_Endpoint_Management_API_CloudFileScriptParameters:
type: object
properties:
Expand Down
88 changes: 88 additions & 0 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13975,6 +13975,46 @@ paths:
x-metaTags:
- content: Kibana
name: product_name
/api/endpoint/action/cancel:
post:
description: |-
**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/endpoint/action/cancel</span></div>

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Cancel a running or pending response action (Applies only to some agent types).
operationId: CancelAction
requestBody:
content:
application/json:
examples:
MicrosoftDefenderEndpoint:
summary: Cancel a response action on a Microsoft Defender for Endpoint host
value:
agent_type: microsoft_defender_endpoint
comment: Cancelling action due to change in requirements
endpoint_ids:
- ed518850-681a-4d60-bb98-e22640cae2a8
parameters:
action_id: 7f8c9b2a-4d3e-4f5a-8b1c-2e3f4a5b6c7d
schema:
$ref: '#/components/schemas/Security_Endpoint_Management_API_CancelRouteRequestBody'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Security_Endpoint_Management_API_ResponseActionCreateSuccessResponse'
description: Successfully cancelled the response action
summary: Cancel a response action
tags:
- Security Endpoint Management API
x-metaTags:
- content: Kibana
name: product_name
/api/endpoint/action/execute:
post:
description: |-
Expand Down Expand Up @@ -82406,6 +82446,54 @@ components:
- microsoft_defender_endpoint
example: endpoint
type: string
Security_Endpoint_Management_API_CancelRouteRequestBody:
allOf:
- type: object
properties:
agent_type:
$ref: '#/components/schemas/Security_Endpoint_Management_API_AgentTypes'
alert_ids:
description: If this action is associated with any alerts, they can be specified here. The action will be logged in any cases associated with the specified alerts.
example:
- alert-id-1
- alert-id-2
items:
minLength: 1
type: string
minItems: 1
type: array
case_ids:
description: The IDs of cases where the action taken will be logged.
example:
- case-id-1
- case-id-2
items:
minLength: 1
type: string
minItems: 1
type: array
comment:
$ref: '#/components/schemas/Security_Endpoint_Management_API_Comment'
endpoint_ids:
$ref: '#/components/schemas/Security_Endpoint_Management_API_EndpointIds'
parameters:
$ref: '#/components/schemas/Security_Endpoint_Management_API_Parameters'
required:
- endpoint_ids
- type: object
properties:
parameters:
type: object
properties:
action_id:
description: ID of the response action to cancel
example: 7f8c9b2a-4d3e-4f5a-8b1c-2e3f4a5b6c7d
minLength: 1
type: string
required:
- action_id
required:
- parameters
Security_Endpoint_Management_API_CloudFileScriptParameters:
type: object
properties:
Expand Down
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;
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'
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({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not match what we groomed (see API issue). Was there another discussion that changed it from id to action_id?

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';
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export * from './actions/response_actions/execute';
export * from './actions/response_actions/upload';
export * from './actions/response_actions/scan';
export * from './actions/response_actions/run_script';
export * from './actions/response_actions/cancel';

export * from './metadata';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ import type {
EndpointGetActionsListRequestQueryInput,
EndpointGetActionsListResponse,
} from './endpoint/actions/list/list.gen';
import type {
CancelActionRequestBodyInput,
CancelActionResponse,
} from './endpoint/actions/response_actions/cancel/cancel.gen';
import type {
EndpointExecuteActionRequestBodyInput,
EndpointExecuteActionResponse,
Expand Down Expand Up @@ -564,6 +568,22 @@ If asset criticality records already exist for the specified entities, those rec
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Cancel a running or pending response action (Applies only to some agent types).
*/
async cancelAction(props: CancelActionProps) {
this.log.info(`${new Date().toISOString()} Calling API CancelAction`);
return this.kbnClient
.request<CancelActionResponse>({
path: '/api/endpoint/action/cancel',
headers: {
[ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31',
},
method: 'POST',
body: props.body,
})
.catch(catchAxiosErrorFormatAndThrow);
}
/**
* Create a clean draft Timeline or Timeline template for the current user.
> info
Expand Down Expand Up @@ -3045,6 +3065,9 @@ export interface AlertsMigrationCleanupProps {
export interface BulkUpsertAssetCriticalityRecordsProps {
body: BulkUpsertAssetCriticalityRecordsRequestBodyInput;
}
export interface CancelActionProps {
body: CancelActionRequestBodyInput;
}
export interface CleanDraftTimelinesProps {
body: CleanDraftTimelinesRequestBodyInput;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export const EXECUTE_ROUTE = `${BASE_ENDPOINT_ACTION_ROUTE}/execute`;
export const UPLOAD_ROUTE = `${BASE_ENDPOINT_ACTION_ROUTE}/upload`;
export const SCAN_ROUTE = `${BASE_ENDPOINT_ACTION_ROUTE}/scan`;
export const RUN_SCRIPT_ROUTE = `${BASE_ENDPOINT_ACTION_ROUTE}/run_script`;
export const CANCEL_ROUTE = `${BASE_ENDPOINT_ACTION_ROUTE}/cancel`;
export const CUSTOM_SCRIPTS_ROUTE = `${BASE_INTERNAL_ENDPOINT_ACTION_ROUTE}/custom_scripts`;

/** Endpoint Actions Routes */
Expand Down
Loading