Skip to content

Fix OAS validation errors in entity analytics privilege monitoring APIs && Risk Score APIs #265470

Merged
CAWilson94 merged 14 commits intoelastic:mainfrom
CAWilson94:oas-examples
Apr 24, 2026
Merged

Fix OAS validation errors in entity analytics privilege monitoring APIs && Risk Score APIs #265470
CAWilson94 merged 14 commits intoelastic:mainfrom
CAWilson94:oas-examples

Conversation

@CAWilson94
Copy link
Copy Markdown
Contributor

@CAWilson94 CAWilson94 commented Apr 24, 2026

Summary

Adds missing examples and description fields to the privilege monitoring OpenAPI schemas to resolve 7 OAS validation errors (down to 0 for api/entity_analytics on both traditional and serverless).

Changes

  • engine/init — added example for 500 response
  • engine/schedule_now — added example for 409 conflict response
  • monitoring/privileges — fixed example:examples: (wrong key) on 200 response
  • users/_csv — added examples for multipart/form-data request body and 200 response
  • users/{id} delete + update — added description to the id path parameter

Also regenerates the bundled ESS and serverless schemas and updates oas_docs/output/kibana.yaml / kibana.serverless.yaml.

Testing and Validation:

I used the node script initially, and followed up with the 'validate-oas' skill in cursor, which then gave me some extra steps to share:

OAS (entity analytics + privileged user monitoring) Client Commands

  1. Node: Use v22.22.0 (Kibana scripts reject other versions), e.g. nvm use 22 if you use nvm.

  2. (Optional but CI-like) If your branch changes routes or the generated spec might be stale:

    • yarn kbn bootstrap
    • Regenerate captured snapshots and rebuild docs (match Buildkite’s --include-path list in .codex/skills/validate-oas/SKILL.md, and add --include-path /api/entity_analytics if you need that area in the snap):
      • node scripts/capture_oas_snapshot … (see the skill for the full list)
      • cd oas_docs && make api-docs
  3. Scoped validate (fast pass/fail for your APIs):

    node ./scripts/validate_oas_docs.js --only traditional --skip-printing-issues \
      --path /api/entity_analytics \
      --path /api/entity_analytics/privileged_user_monitoring
      
    

Using the validate-oas skill:

  • The 'Cursor/Claude, do this for me' option! But I think its good to do both 👍
image

- Added detailed examples for error responses in the monitoring engine initialization and scheduling endpoints, including `InitMonitoringEngineError` and `ScheduleMonitoringEngineConflict`.
- Updated privilege response examples to use the `examples` field instead of `example` for consistency across the API documentation.
- Included CSV upload request and response examples for bulk user operations, improving clarity on expected input and output formats.
- Enhanced parameter descriptions for user deletion and update operations to specify the document ID context.
@CAWilson94 CAWilson94 requested review from a team as code owners April 24, 2026 08:24
@CAWilson94 CAWilson94 requested a review from ymao1 April 24, 2026 08:24
@CAWilson94 CAWilson94 self-assigned this Apr 24, 2026
@CAWilson94 CAWilson94 added release_note:skip Skip the PR/issue when compiling release notes Team:Entity Analytics Security Entity Analytics Team backport:version Backport to applied version labels v9.4.0 labels Apr 24, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-entity-analytics (Team:Entity Analytics)

@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod Bot requested a review from a team as a code owner April 24, 2026 09:49
@CAWilson94 CAWilson94 enabled auto-merge (squash) April 24, 2026 15:45
CAWilson94 and others added 3 commits April 24, 2026 16:55
…ponse examples

- Added examples for Task Manager unavailability and error responses in `engine_cleanup_route`, `engine_configure_saved_object_route`, and `engine_schedule_now_route` schemas.
- Enhanced documentation for better clarity on expected responses, including specific error messages and status codes.
- Updated bundled OpenAPI schema files to reflect these changes for both ESS and serverless environments.
@CAWilson94 CAWilson94 changed the title Fix OAS validation errors in entity analytics privilege monitoring APIs Fix OAS validation errors in entity analytics privilege monitoring APIs && Risk Score APIs Apr 24, 2026
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod Bot requested a review from a team as a code owner April 24, 2026 17:34
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 12.0MB 12.0MB +41.0B

History

cc @CAWilson94

@CAWilson94 CAWilson94 removed the request for review from ymao1 April 24, 2026 20:39
Copy link
Copy Markdown
Contributor

@hammad-nasir-elastic hammad-nasir-elastic left a comment

Choose a reason for hiding this comment

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

Core changes LGTM

Copy link
Copy Markdown
Member

@spong spong left a comment

Choose a reason for hiding this comment

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

Single Security Solution change in quickstart_client.gen.ts LGTM 👍

@kibanamachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 12.0MB 12.0MB +41.0B

cc @CAWilson94

@CAWilson94 CAWilson94 merged commit 664b52b into elastic:main Apr 24, 2026
17 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.4

https://github.com/elastic/kibana/actions/runs/24912465854

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
9.4 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 265470

Questions ?

Please refer to the Backport tool documentation

rbrtj pushed a commit to walterra/kibana that referenced this pull request Apr 27, 2026
SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Apr 27, 2026
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Apr 28, 2026
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 265470 locally
cc: @CAWilson94

1 similar comment
@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 265470 locally
cc: @CAWilson94

@kibanamachine
Copy link
Copy Markdown
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 265470 locally
cc: @CAWilson94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport missing Added to PRs automatically when the are determined to be missing a backport. backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Entity Analytics Security Entity Analytics Team v9.4.0 v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants