Skip to content

Commit c0db3d0

Browse files
Merge branch '9.4' into backport/9.4/pr-271948
2 parents 1574eb5 + 64f0cef commit c0db3d0

8 files changed

Lines changed: 126 additions & 113 deletions

File tree

oas_docs/output/kibana.serverless.yaml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19344,42 +19344,12 @@ paths:
1934419344
x-metaTags:
1934519345
- content: Kibana, Elastic Cloud Serverless
1934619346
name: product_name
19347-
/api/endpoint/action/running_procs:
19348-
post:
19349-
description: |-
19350-
**Spaces method and path for this operation:**
19351-
19352-
<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/endpoint/action/running_procs</span></div>
19353-
19354-
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
19355-
19356-
Get a list of all processes running on an endpoint.
19357-
operationId: EndpointGetProcessesAction
19358-
requestBody:
19359-
content:
19360-
application/json:
19361-
schema:
19362-
$ref: '#/components/schemas/Security_Endpoint_Management_API_GetProcessesRouteRequestBody'
19363-
required: true
19364-
responses:
19365-
'200':
19366-
content:
19367-
application/json:
19368-
schema:
19369-
$ref: '#/components/schemas/Security_Endpoint_Management_API_GetProcessesRouteResponse'
19370-
description: OK
19371-
summary: Get running processes
19372-
tags:
19373-
- Security Endpoint Management API
19374-
x-metaTags:
19375-
- content: Kibana, Elastic Cloud Serverless
19376-
name: product_name
19377-
/api/endpoint/action/runscript:
19347+
/api/endpoint/action/run_script:
1937819348
post:
1937919349
description: |-
1938019350
**Spaces method and path for this operation:**
1938119351

19382-
<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/endpoint/action/runscript</span></div>
19352+
<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/endpoint/action/run_script</span></div>
1938319353

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

@@ -19435,6 +19405,36 @@ paths:
1943519405
x-metaTags:
1943619406
- content: Kibana, Elastic Cloud Serverless
1943719407
name: product_name
19408+
/api/endpoint/action/running_procs:
19409+
post:
19410+
description: |-
19411+
**Spaces method and path for this operation:**
19412+
19413+
<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/endpoint/action/running_procs</span></div>
19414+
19415+
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
19416+
19417+
Get a list of all processes running on an endpoint.
19418+
operationId: EndpointGetProcessesAction
19419+
requestBody:
19420+
content:
19421+
application/json:
19422+
schema:
19423+
$ref: '#/components/schemas/Security_Endpoint_Management_API_GetProcessesRouteRequestBody'
19424+
required: true
19425+
responses:
19426+
'200':
19427+
content:
19428+
application/json:
19429+
schema:
19430+
$ref: '#/components/schemas/Security_Endpoint_Management_API_GetProcessesRouteResponse'
19431+
description: OK
19432+
summary: Get running processes
19433+
tags:
19434+
- Security Endpoint Management API
19435+
x-metaTags:
19436+
- content: Kibana, Elastic Cloud Serverless
19437+
name: product_name
1943819438
/api/endpoint/action/scan:
1943919439
post:
1944019440
description: |-

oas_docs/output/kibana.yaml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21986,42 +21986,12 @@ paths:
2198621986
x-metaTags:
2198721987
- content: Kibana
2198821988
name: product_name
21989-
/api/endpoint/action/running_procs:
21990-
post:
21991-
description: |-
21992-
**Spaces method and path for this operation:**
21993-
21994-
<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/endpoint/action/running_procs</span></div>
21995-
21996-
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
21997-
21998-
Get a list of all processes running on an endpoint.
21999-
operationId: EndpointGetProcessesAction
22000-
requestBody:
22001-
content:
22002-
application/json:
22003-
schema:
22004-
$ref: '#/components/schemas/Security_Endpoint_Management_API_GetProcessesRouteRequestBody'
22005-
required: true
22006-
responses:
22007-
'200':
22008-
content:
22009-
application/json:
22010-
schema:
22011-
$ref: '#/components/schemas/Security_Endpoint_Management_API_GetProcessesRouteResponse'
22012-
description: OK
22013-
summary: Get running processes
22014-
tags:
22015-
- Security Endpoint Management API
22016-
x-metaTags:
22017-
- content: Kibana
22018-
name: product_name
22019-
/api/endpoint/action/runscript:
21989+
/api/endpoint/action/run_script:
2202021990
post:
2202121991
description: |-
2202221992
**Spaces method and path for this operation:**
2202321993

22024-
<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/endpoint/action/runscript</span></div>
21994+
<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/endpoint/action/run_script</span></div>
2202521995

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

@@ -22077,6 +22047,36 @@ paths:
2207722047
x-metaTags:
2207822048
- content: Kibana
2207922049
name: product_name
22050+
/api/endpoint/action/running_procs:
22051+
post:
22052+
description: |-
22053+
**Spaces method and path for this operation:**
22054+
22055+
<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/endpoint/action/running_procs</span></div>
22056+
22057+
Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.
22058+
22059+
Get a list of all processes running on an endpoint.
22060+
operationId: EndpointGetProcessesAction
22061+
requestBody:
22062+
content:
22063+
application/json:
22064+
schema:
22065+
$ref: '#/components/schemas/Security_Endpoint_Management_API_GetProcessesRouteRequestBody'
22066+
required: true
22067+
responses:
22068+
'200':
22069+
content:
22070+
application/json:
22071+
schema:
22072+
$ref: '#/components/schemas/Security_Endpoint_Management_API_GetProcessesRouteResponse'
22073+
description: OK
22074+
summary: Get running processes
22075+
tags:
22076+
- Security Endpoint Management API
22077+
x-metaTags:
22078+
- content: Kibana
22079+
name: product_name
2208022080
/api/endpoint/action/scan:
2208122081
post:
2208222082
description: |-

src/platform/plugins/shared/embeddable/server/embeddable_transforms/registry.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,26 @@
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
99

10-
import type { ObjectType } from '@kbn/config-schema';
10+
import type { ObjectType, Type } from '@kbn/config-schema';
1111
import type { getDrilldownRegistry } from '../drilldowns/registry';
1212
import type { EmbeddableServerDefinition } from './types';
1313

1414
export function getEmbeddableServerRegistry(
1515
drilldownRegistry: ReturnType<typeof getDrilldownRegistry>
1616
) {
1717
const registry: { [key: string]: EmbeddableServerDefinition<any, any> } = {};
18+
const schemaCache: Record<string, Type<object> | undefined> = {};
19+
20+
function getCachedSchema(type: string) {
21+
if (schemaCache[type]) {
22+
return schemaCache[type];
23+
}
24+
25+
const { getSchema } = registry[type] ?? {};
26+
const schema = getSchema?.(drilldownRegistry.getSchema);
27+
schemaCache[type] = schema;
28+
return schema;
29+
}
1830

1931
return {
2032
registerEmbeddableServerDefinition: (
@@ -30,7 +42,7 @@ export function getEmbeddableServerRegistry(
3042
getAllEmbeddableSchemas: () => {
3143
const schemas: { [key: string]: { schema: ObjectType; title: string } } = {};
3244
Object.entries(registry).forEach(([type, definition]) => {
33-
const schema = definition?.getSchema?.(drilldownRegistry.getSchema);
45+
const schema = getCachedSchema(type);
3446
if (schema) {
3547
schemas[type] = {
3648
schema: schema as ObjectType,
@@ -41,10 +53,11 @@ export function getEmbeddableServerRegistry(
4153
return schemas;
4254
},
4355
getEmbeddableTransforms: (type: string) => {
44-
const { getTransforms, getSchema, throwOnUnmappedPanel } = registry[type] ?? {};
56+
const { getTransforms, throwOnUnmappedPanel } = registry[type] ?? {};
57+
const schema = getCachedSchema(type);
4558
return {
4659
...getTransforms?.(drilldownRegistry.transforms),
47-
...(getSchema ? { schema: getSchema(drilldownRegistry.getSchema) } : {}),
60+
...(schema ? { schema } : {}),
4861
...(typeof throwOnUnmappedPanel === 'boolean' ? { throwOnUnmappedPanel } : {}),
4962
};
5063
},

x-pack/solutions/security/packages/test-api-clients/supertest/endpoint_management.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ const securitySolutionApiServiceFactory = (supertest: SuperTest.Agent) => ({
357357
*/
358358
runScriptAction(props: RunScriptActionProps, kibanaSpace: string = 'default') {
359359
return supertest
360-
.post(getRouteUrlForSpace('/api/endpoint/action/runscript', kibanaSpace))
360+
.post(getRouteUrlForSpace('/api/endpoint/action/run_script', kibanaSpace))
361361
.set('kbn-xsrf', 'true')
362362
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
363363
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')

x-pack/solutions/security/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ info:
33
title: RunScript Action Schema
44
version: '2023-10-31'
55
paths:
6-
/api/endpoint/action/runscript:
6+
/api/endpoint/action/run_script:
77
post:
88
summary: Run a script
99
operationId: RunScriptAction

x-pack/solutions/security/plugins/security_solution/common/api/quickstart_client.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3043,7 +3043,7 @@ The difference between the `id` and `rule_id` is that the `id` is a unique rule
30433043
this.log.info(`${new Date().toISOString()} Calling API RunScriptAction`);
30443044
return this.kbnClient
30453045
.request<RunScriptActionResponse>({
3046-
path: '/api/endpoint/action/runscript',
3046+
path: '/api/endpoint/action/run_script',
30473047
headers: {
30483048
[ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31',
30493049
},

x-pack/solutions/security/plugins/security_solution/docs/openapi/ess/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -468,27 +468,7 @@ paths:
468468
summary: Generate a memory dump from the host machine
469469
tags:
470470
- Security Endpoint Management API
471-
/api/endpoint/action/running_procs:
472-
post:
473-
description: Get a list of all processes running on an endpoint.
474-
operationId: EndpointGetProcessesAction
475-
requestBody:
476-
content:
477-
application/json:
478-
schema:
479-
$ref: '#/components/schemas/GetProcessesRouteRequestBody'
480-
required: true
481-
responses:
482-
'200':
483-
content:
484-
application/json:
485-
schema:
486-
$ref: '#/components/schemas/GetProcessesRouteResponse'
487-
description: OK
488-
summary: Get running processes
489-
tags:
490-
- Security Endpoint Management API
491-
/api/endpoint/action/runscript:
471+
/api/endpoint/action/run_script:
492472
post:
493473
description: Run a script on a host. Currently supported only for some agent types.
494474
operationId: RunScriptAction
@@ -541,6 +521,26 @@ paths:
541521
summary: Run a script
542522
tags:
543523
- Security Endpoint Management API
524+
/api/endpoint/action/running_procs:
525+
post:
526+
description: Get a list of all processes running on an endpoint.
527+
operationId: EndpointGetProcessesAction
528+
requestBody:
529+
content:
530+
application/json:
531+
schema:
532+
$ref: '#/components/schemas/GetProcessesRouteRequestBody'
533+
required: true
534+
responses:
535+
'200':
536+
content:
537+
application/json:
538+
schema:
539+
$ref: '#/components/schemas/GetProcessesRouteResponse'
540+
description: OK
541+
summary: Get running processes
542+
tags:
543+
- Security Endpoint Management API
544544
/api/endpoint/action/scan:
545545
post:
546546
description: Scan a specific file or directory on an endpoint for malware.

x-pack/solutions/security/plugins/security_solution/docs/openapi/serverless/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -468,27 +468,7 @@ paths:
468468
summary: Generate a memory dump from the host machine
469469
tags:
470470
- Security Endpoint Management API
471-
/api/endpoint/action/running_procs:
472-
post:
473-
description: Get a list of all processes running on an endpoint.
474-
operationId: EndpointGetProcessesAction
475-
requestBody:
476-
content:
477-
application/json:
478-
schema:
479-
$ref: '#/components/schemas/GetProcessesRouteRequestBody'
480-
required: true
481-
responses:
482-
'200':
483-
content:
484-
application/json:
485-
schema:
486-
$ref: '#/components/schemas/GetProcessesRouteResponse'
487-
description: OK
488-
summary: Get running processes
489-
tags:
490-
- Security Endpoint Management API
491-
/api/endpoint/action/runscript:
471+
/api/endpoint/action/run_script:
492472
post:
493473
description: Run a script on a host. Currently supported only for some agent types.
494474
operationId: RunScriptAction
@@ -541,6 +521,26 @@ paths:
541521
summary: Run a script
542522
tags:
543523
- Security Endpoint Management API
524+
/api/endpoint/action/running_procs:
525+
post:
526+
description: Get a list of all processes running on an endpoint.
527+
operationId: EndpointGetProcessesAction
528+
requestBody:
529+
content:
530+
application/json:
531+
schema:
532+
$ref: '#/components/schemas/GetProcessesRouteRequestBody'
533+
required: true
534+
responses:
535+
'200':
536+
content:
537+
application/json:
538+
schema:
539+
$ref: '#/components/schemas/GetProcessesRouteResponse'
540+
description: OK
541+
summary: Get running processes
542+
tags:
543+
- Security Endpoint Management API
544544
/api/endpoint/action/scan:
545545
post:
546546
description: Scan a specific file or directory on an endpoint for malware.

0 commit comments

Comments
 (0)