Skip to content

Commit b5a755f

Browse files
CAWilson94claudekibanamachine
committed
[Entity Analytics] Add missing OpenAPI descriptions and examples to p… (#264778)
Closes: elastic/security-team#16463 Adds operation-level descriptions and request/response examples to 19 OpenAPI schema files across the entity analytics public API surface to improve documentation quality and developer experience. - **risk_engine:** add response examples to CleanUpRiskEngine, ScheduleRiskEngineNow; add request + response examples to ConfigureRiskEngineSavedObject - **monitoring/engine:** add descriptions and response examples to InitMonitoringEngine, DisableMonitoringEngine, DeleteMonitoringEngine, ScheduleMonitoringEngine - **monitoring/health:** add description and response example to PrivMonHealth - **monitoring/users:** add descriptions, request examples, and response examples to CreatePrivMonUser, DeletePrivMonUser, UpdatePrivMonUser, ListPrivMonUsers; add description to PrivmonBulkUploadUsersCSV - **monitoring/privileged_access_detection:** add descriptions and response examples to InstallPrivilegedAccessDetectionPackage and GetPrivilegedAccessDetectionPackageStatus - **watchlists:** add descriptions to CreateWatchlist, GetWatchlist, UpdateWatchlist, ListWatchlists - [x] `CleanUpRiskEngine` — response example - [x] `ConfigureRiskEngineSavedObject` — request example, response example - [x] `ScheduleRiskEngineNow` — response example - [x] `InitMonitoringEngine` — description, response example - [x] `DisableMonitoringEngine` — description, response example - [x] `DeleteMonitoringEngine` — description, response example - [x] `ScheduleMonitoringEngine` — description, response example - [x] `PrivMonHealth` — description, response example - [x] `CreatePrivMonUser` — description, request example, response example - [x] `DeletePrivMonUser` — description, response example - [x] `UpdatePrivMonUser` — description, request example, response example - [x] `ListPrivMonUsers` — description, response example - [x] `PrivmonBulkUploadUsersCSV` — description - [x] `InstallPrivilegedAccessDetectionPackage` — description, response example - [x] `GetPrivilegedAccessDetectionPackageStatus` — description, response example - [x] `CreateWatchlist` — description - [x] `GetWatchlist` — description - [x] `UpdateWatchlist` — description - [x] `ListWatchlists` — description --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit fda4179)
1 parent 1a66d6e commit b5a755f

23 files changed

Lines changed: 705 additions & 0 deletions

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

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@ If a record already exists for the specified entity, that record is overwritten
236236
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
237237
.send(props.body as object);
238238
},
239+
/**
240+
* Creates a new privileged user to be monitored by the Privilege Monitoring Engine.
241+
*/
239242
createPrivMonUser(props: CreatePrivMonUserProps, kibanaSpace: string = 'default') {
240243
return supertest
241244
.post(getRouteUrlForSpace('/api/entity_analytics/monitoring/users', kibanaSpace))
@@ -244,6 +247,9 @@ If a record already exists for the specified entity, that record is overwritten
244247
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
245248
.send(props.body as object);
246249
},
250+
/**
251+
* Creates a new entity analytics watchlist with an optional set of entity sources. Watchlists apply a risk score modifier to matched entities.
252+
*/
247253
createWatchlist(props: CreateWatchlistProps, kibanaSpace: string = 'default') {
248254
return supertest
249255
.post(getRouteUrlForSpace('/api/entity_analytics/watchlists', kibanaSpace))
@@ -318,6 +324,9 @@ If a record already exists for the specified entity, that record is overwritten
318324
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
319325
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana');
320326
},
327+
/**
328+
* Deletes the Privilege Monitoring Engine and optionally removes all associated privileged user data.
329+
*/
321330
deleteMonitoringEngine(props: DeleteMonitoringEngineProps, kibanaSpace: string = 'default') {
322331
return supertest
323332
.delete(getRouteUrlForSpace('/api/entity_analytics/monitoring/engine/delete', kibanaSpace))
@@ -326,6 +335,9 @@ If a record already exists for the specified entity, that record is overwritten
326335
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
327336
.query(props.query);
328337
},
338+
/**
339+
* Removes a privileged user from monitoring by their document ID.
340+
*/
329341
deletePrivMonUser(props: DeletePrivMonUserProps, kibanaSpace: string = 'default') {
330342
return supertest
331343
.delete(
@@ -388,6 +400,9 @@ The entity will be immediately deleted from the latest index. It will remain av
388400
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
389401
.send(props.body as object);
390402
},
403+
/**
404+
* Disables the Privilege Monitoring Engine, stopping all monitoring activity without removing data.
405+
*/
391406
disableMonitoringEngine(kibanaSpace: string = 'default') {
392407
return supertest
393408
.post(getRouteUrlForSpace('/api/entity_analytics/monitoring/engine/disable', kibanaSpace))
@@ -500,6 +515,9 @@ The entity will be immediately deleted from the latest index. It will remain av
500515
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
501516
.query(props.query);
502517
},
518+
/**
519+
* Returns the installation and ML module setup status of the privileged access detection package, along with the state of each associated ML job.
520+
*/
503521
getPrivilegedAccessDetectionPackageStatus(kibanaSpace: string = 'default') {
504522
return supertest
505523
.get(
@@ -522,6 +540,9 @@ The entity will be immediately deleted from the latest index. It will remain av
522540
.set(ELASTIC_HTTP_VERSION_HEADER, '1')
523541
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana');
524542
},
543+
/**
544+
* Retrieves the details of an entity analytics watchlist by its unique identifier.
545+
*/
525546
getWatchlist(props: GetWatchlistProps, kibanaSpace: string = 'default') {
526547
return supertest
527548
.get(
@@ -576,6 +597,9 @@ The entity will be immediately deleted from the latest index. It will remain av
576597
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
577598
.send(props.body as object);
578599
},
600+
/**
601+
* Initializes the Privilege Monitoring Engine, setting up the required resources and starting the engine.
602+
*/
579603
initMonitoringEngine(kibanaSpace: string = 'default') {
580604
return supertest
581605
.post(getRouteUrlForSpace('/api/entity_analytics/monitoring/engine/init', kibanaSpace))
@@ -593,6 +617,9 @@ The entity will be immediately deleted from the latest index. It will remain av
593617
.set(ELASTIC_HTTP_VERSION_HEADER, '1')
594618
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana');
595619
},
620+
/**
621+
* Installs the privileged access detection integration package and sets up the associated ML modules required for the Entity Analytics privileged user monitoring experience.
622+
*/
596623
installPrivilegedAccessDetectionPackage(kibanaSpace: string = 'default') {
597624
return supertest
598625
.post(
@@ -649,6 +676,9 @@ Each row will match up to 10,000 entities.
649676
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
650677
.query(props.query);
651678
},
679+
/**
680+
* Returns a list of all privileged users currently being monitored. Supports optional KQL filtering.
681+
*/
652682
listPrivMonUsers(props: ListPrivMonUsersProps, kibanaSpace: string = 'default') {
653683
return supertest
654684
.get(getRouteUrlForSpace('/api/entity_analytics/monitoring/users/list', kibanaSpace))
@@ -676,6 +706,9 @@ Each row will match up to 10,000 entities.
676706
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
677707
.query(props.query);
678708
},
709+
/**
710+
* Returns a list of all entity analytics watchlists.
711+
*/
679712
listWatchlists(kibanaSpace: string = 'default') {
680713
return supertest
681714
.get(getRouteUrlForSpace('/api/entity_analytics/watchlists/list', kibanaSpace))
@@ -694,13 +727,19 @@ Each row will match up to 10,000 entities.
694727
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
695728
.send(props.body as object);
696729
},
730+
/**
731+
* Bulk upserts privileged users by uploading a CSV file. Returns per-row errors and aggregate upload statistics.
732+
*/
697733
privmonBulkUploadUsersCsv(kibanaSpace: string = 'default') {
698734
return supertest
699735
.post(getRouteUrlForSpace('/api/entity_analytics/monitoring/users/_csv', kibanaSpace))
700736
.set('kbn-xsrf', 'true')
701737
.set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31')
702738
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana');
703739
},
740+
/**
741+
* Returns the current health status of the Privilege Monitoring Engine, including engine status, error details, and user count statistics.
742+
*/
704743
privMonHealth(kibanaSpace: string = 'default') {
705744
return supertest
706745
.get(getRouteUrlForSpace('/api/entity_analytics/monitoring/privileges/health', kibanaSpace))
@@ -741,6 +780,9 @@ Each row will match up to 10,000 entities.
741780
.set(ELASTIC_HTTP_VERSION_HEADER, '1')
742781
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana');
743782
},
783+
/**
784+
* Schedules the Privilege Monitoring Engine to run as soon as possible, triggering an immediate monitoring cycle.
785+
*/
744786
scheduleMonitoringEngine(kibanaSpace: string = 'default') {
745787
return supertest
746788
.post(
@@ -863,6 +905,9 @@ remain on the watchlist.
863905
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
864906
.send(props.body as object);
865907
},
908+
/**
909+
* Updates the details of an existing monitored privileged user by their document ID.
910+
*/
866911
updatePrivMonUser(props: UpdatePrivMonUserProps, kibanaSpace: string = 'default') {
867912
return supertest
868913
.put(
@@ -876,6 +921,9 @@ remain on the watchlist.
876921
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
877922
.send(props.body as object);
878923
},
924+
/**
925+
* Updates the name, description, risk modifier, or managed status of an existing entity analytics watchlist.
926+
*/
879927
updateWatchlist(props: UpdateWatchlistProps, kibanaSpace: string = 'default') {
880928
return supertest
881929
.put(

x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/monitoring/engine/delete.schema.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ paths:
1010
x-codegen-enabled: true
1111
operationId: DeleteMonitoringEngine
1212
summary: Delete the Privilege Monitoring Engine
13+
description: Deletes the Privilege Monitoring Engine and optionally removes all associated privileged user data.
1314
parameters:
1415
- in: query
1516
name: data
@@ -31,3 +32,8 @@ paths:
3132
type: boolean
3233
required:
3334
- deleted
35+
examples:
36+
DeleteMonitoringEngineResponse:
37+
summary: Engine deleted successfully
38+
value:
39+
deleted: true

x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/monitoring/engine/disable.schema.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ paths:
1010
x-codegen-enabled: true
1111
operationId: DisableMonitoringEngine
1212
summary: Disable the Privilege Monitoring Engine
13+
description: Disables the Privilege Monitoring Engine, stopping all monitoring activity without removing data.
1314

1415
responses:
1516
"200":
@@ -18,3 +19,8 @@ paths:
1819
application/json:
1920
schema:
2021
$ref: "../common.schema.yaml#/components/schemas/MonitoringEngineDescriptor"
22+
examples:
23+
DisableMonitoringEngineResponse:
24+
summary: Engine disabled successfully
25+
value:
26+
status: disabled

x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/monitoring/engine/init.schema.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ paths:
1010
x-codegen-enabled: true
1111
operationId: InitMonitoringEngine
1212
summary: Initialize the Privilege Monitoring Engine
13+
description: Initializes the Privilege Monitoring Engine, setting up the required resources and starting the engine.
1314

1415
responses:
1516
"200":
@@ -18,6 +19,11 @@ paths:
1819
application/json:
1920
schema:
2021
$ref: "../common.schema.yaml#/components/schemas/MonitoringEngineDescriptor"
22+
examples:
23+
InitMonitoringEngineResponse:
24+
summary: Engine initialized successfully
25+
value:
26+
status: started
2127
"500":
2228
description: Internal Server Error
2329
content:

x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/monitoring/engine/schedule_now.schema.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ paths:
1010
x-codegen-enabled: true
1111
operationId: ScheduleMonitoringEngine
1212
summary: Schedule the Privilege Monitoring Engine
13+
description: Schedules the Privilege Monitoring Engine to run as soon as possible, triggering an immediate monitoring cycle.
1314

1415
responses:
1516
"200":
@@ -22,6 +23,11 @@ paths:
2223
success:
2324
type: boolean
2425
description: Indicates the scheduling was successful
26+
examples:
27+
ScheduleMonitoringEngineResponse:
28+
summary: Engine scheduled successfully
29+
value:
30+
success: true
2531
"409":
2632
description: Conflict - Monitoring engine is already running
2733
content:

x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/monitoring/health.schema.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ paths:
1010
x-codegen-enabled: true
1111
operationId: PrivMonHealth
1212
summary: Health check on Privilege Monitoring
13+
description: Returns the current health status of the Privilege Monitoring Engine, including engine status, error details, and user count statistics.
1314

1415
responses:
1516
"200":
@@ -44,3 +45,11 @@ paths:
4445

4546
required:
4647
- status
48+
examples:
49+
PrivMonHealthResponse:
50+
summary: Healthy privilege monitoring engine
51+
value:
52+
status: started
53+
users:
54+
current_count: 42
55+
max_allowed: 1000

x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/monitoring/privileged_access_detection/install.schema.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ paths:
99
x-codegen-enabled: true
1010
operationId: InstallPrivilegedAccessDetectionPackage
1111
summary: Installs the privileged access detection package for the Entity Analytics privileged user monitoring experience
12+
description: Installs the privileged access detection integration package and sets up the associated ML modules required for the Entity Analytics privileged user monitoring experience.
1213

1314
responses:
1415
"200":
@@ -22,3 +23,8 @@ paths:
2223
properties:
2324
message:
2425
type: string
26+
examples:
27+
InstallPrivilegedAccessDetectionPackageResponse:
28+
summary: Package installed successfully
29+
value:
30+
message: Privileged access detection package installed successfully

x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/monitoring/privileged_access_detection/status.schema.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ paths:
99
x-codegen-enabled: true
1010
operationId: GetPrivilegedAccessDetectionPackageStatus
1111
summary: Gets the status of the privileged access detection package for the Entity Analytics privileged user monitoring experience
12+
description: Returns the installation and ML module setup status of the privileged access detection package, along with the state of each associated ML job.
1213

1314
responses:
1415
"200":
@@ -43,3 +44,16 @@ paths:
4344
state:
4445
type: string
4546
enum: [closing, closed, opened, failed, opening]
47+
examples:
48+
GetPrivilegedAccessDetectionPackageStatusResponse:
49+
summary: Package fully installed and running
50+
value:
51+
package_installation_status: complete
52+
ml_module_setup_status: complete
53+
jobs:
54+
- job_id: pad-high-risk-login
55+
description: Detects high-risk login patterns
56+
state: opened
57+
- job_id: pad-privilege-escalation
58+
description: Detects privilege escalation events
59+
state: opened

x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/monitoring/users/create.schema.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,24 @@ paths:
1010
x-codegen-enabled: true
1111
operationId: CreatePrivMonUser
1212
summary: Create a new monitored user
13+
description: Creates a new privileged user to be monitored by the Privilege Monitoring Engine.
1314
requestBody:
1415
required: true
1516
content:
1617
application/json:
1718
schema:
1819
$ref: "./common.schema.yaml#/components/schemas/UserName"
20+
examples:
21+
CreatePrivMonUserRequest:
22+
summary: Create a monitored user
23+
value:
24+
user:
25+
name: john.doe
26+
entity_analytics_monitoring:
27+
labels:
28+
- field: department
29+
value: IT
30+
source: api
1931

2032
responses:
2133
"200":
@@ -24,3 +36,19 @@ paths:
2436
application/json:
2537
schema:
2638
$ref: "./common.schema.yaml#/components/schemas/MonitoredUserDoc"
39+
examples:
40+
CreatePrivMonUserResponse:
41+
summary: Created monitored user
42+
value:
43+
id: user-abc-123
44+
user:
45+
name: john.doe
46+
is_privileged: true
47+
entity_analytics_monitoring:
48+
labels:
49+
- field: department
50+
value: IT
51+
source: api
52+
"@timestamp": "2026-01-28T12:00:00.000Z"
53+
event:
54+
ingested: "2026-01-28T12:00:00.000Z"

x-pack/solutions/security/plugins/security_solution/common/api/entity_analytics/monitoring/users/delete.schema.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ paths:
1010
x-codegen-enabled: true
1111
operationId: DeletePrivMonUser
1212
summary: Delete a monitored user
13+
description: Removes a privileged user from monitoring by their document ID.
1314
parameters:
1415
- name: id
1516
in: path
@@ -32,3 +33,9 @@ paths:
3233
message:
3334
type: string
3435
description: A message providing additional information about the deletion status
36+
examples:
37+
DeletePrivMonUserResponse:
38+
summary: User deleted successfully
39+
value:
40+
acknowledged: true
41+
message: User deleted successfully

0 commit comments

Comments
 (0)