Skip to content

[Security Solution] Anomalies Table data fix#225757

Merged
abhishekbhatia1710 merged 3 commits intoelastic:mainfrom
abhishekbhatia1710:ea-privmon-flyout-error
Jul 1, 2025
Merged

[Security Solution] Anomalies Table data fix#225757
abhishekbhatia1710 merged 3 commits intoelastic:mainfrom
abhishekbhatia1710:ea-privmon-flyout-error

Conversation

@abhishekbhatia1710
Copy link
Contributor

@abhishekbhatia1710 abhishekbhatia1710 commented Jun 30, 2025

Summary

The privileged user monitoring dashboard was recently released as Technical preview as part of 9.1 feature freeze.
The flyout, when accessed from the privileged user table, gave an error as below :

Screenshot 2025-06-25 at 1 11 06 PM

Screenshot 2025-06-25 at 1 11 34 PM

Screen.Recording.2025-06-26.at.7.09.50.PM.mov

Following the ML platform changes in PR #221081, the API endpoint /internal/ml/results/anomalies_table_data was updated to accept the [threshold] field as an array of [SeverityThreshold] objects instead of a single number. This change was part of a larger refactoring to support more sophisticated anomaly severity filtering with minimum and maximum threshold ranges.

However, the Security Solution's anomalies table data integration was still sending the old format, causing a 400 Bad Request error:

[request body.threshold]: expected value of type [array] but got [number]

Root Cause

Backend expectation (new): [threshold: [{ min: number, max?: number }]]
Frontend sending (old): [threshold: number]

The ML backend schema was updated in [results_service_schema.ts]

threshold: schema.number(),

threshold: schema.arrayOf(severityThresholdSchema),

Fix

  1. Updated type definitions [anomalies_table_data.ts]
  2. Updated API call [use_anomalies_table_data.ts]

Testing Steps :

  1. Check out the main branch of security-documents-generator.
  2. Run: yarn start privileged-user-monitoring
  3. After this completes, a CSV file should be generated.
  4. Navigate to the Privileged User Monitoring dashboard page.
  5. Click "Import file", or if you’ve already imported data before, click "Manage data sources" and then "Import file".
  6. Select the CSV file generated in step 3.
  7. On the dashboard, scroll down to the table titled "Privileged Users".
  8. Click the double-headed arrow next to any user name — this should open a flyout.
  9. Ensure that no errors appear when the flyout opens.
  10. Alternatively, open your browser’s DevTools Network tab and verify that the API call to
    /internal/ml/results/anomalies_table_data does not return a 400 status code.

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.
@abhishekbhatia1710 abhishekbhatia1710 self-assigned this Jun 30, 2025
@abhishekbhatia1710 abhishekbhatia1710 requested a review from a team as a code owner June 30, 2025 07:03
@abhishekbhatia1710 abhishekbhatia1710 added backport:version Backport to applied version labels v9.1.0 labels Jun 30, 2025
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@jaredburgettelastic jaredburgettelastic left a comment

Choose a reason for hiding this comment

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

LGTM! Also desk tested. 🚢

As unit tests could not have caught this, @hop-dev we should add a basic e2e test case for opening the flyout as part of privileged user monitoring Cypress tests in order to catch this in the future.

@jaredburgettelastic jaredburgettelastic added release_note:skip Skip the PR/issue when compiling release notes and removed release_note:fix labels Jun 30, 2025
@abhishekbhatia1710 abhishekbhatia1710 merged commit 5d2f0f8 into elastic:main Jul 1, 2025
13 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.1

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

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.1

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 1, 2025
…ileged User Monitoring Dashboard flyout error fix (elastic#225757)

## Summary

The privileged user monitoring dashboard was recently released as
Technical preview as part of 9.1 feature freeze.
The flyout, when accessed from the privileged user table, gave an error
as below :

![Screenshot 2025-06-25 at 1 11
06 PM](https://github.com/user-attachments/assets/c0f0a226-f367-4ee6-959e-e91f79f36bdb)

![Screenshot 2025-06-25 at 1 11
34 PM](https://github.com/user-attachments/assets/f6db3e1a-8c55-41be-b21b-69996c686479)

https://github.com/user-attachments/assets/f5882e74-7088-4f4f-86d2-ec0f2988a96c

Following the ML platform changes in PR elastic#221081, the API endpoint
`/internal/ml/results/anomalies_table_data` was updated to accept the
[threshold] field as an array of [SeverityThreshold] objects instead of
a single number. This change was part of a larger refactoring to support
more sophisticated anomaly severity filtering with minimum and maximum
threshold ranges.

However, the Security Solution's anomalies table data integration was
still sending the old format, causing a 400 Bad Request error:
```
[request body.threshold]: expected value of type [array] but got [number]
```

### Root Cause
Backend expectation (new): [threshold: [{ min: number, max?: number }]]
Frontend sending (old): [threshold: number]

The ML backend schema was updated in [results_service_schema.ts]

threshold: schema.number(),

threshold: schema.arrayOf(severityThresholdSchema),

### Fix
1. Updated type definitions [anomalies_table_data.ts]
2. Updated API call [use_anomalies_table_data.ts]

### Testing Steps :

1. Check out the main branch of
[security-documents-generator](https://github.com/elastic/security-documents-generator).
3. Run: `yarn start privileged-user-monitoring`
4. After this completes, a CSV file should be generated.
5. Navigate to the Privileged User Monitoring dashboard page.
6. Click "Import file", or if you’ve already imported data before, click
"Manage data sources" and then "Import file".
7. Select the CSV file generated in step 3.
8. On the dashboard, scroll down to the table titled "Privileged Users".
9. Click the double-headed arrow next to any user name — this should
open a flyout.
10. Ensure that no errors appear when the flyout opens.
11. Alternatively, open your browser’s DevTools Network tab and verify
that the API call to
`/internal/ml/results/anomalies_table_data` does not return a 400 status
code.

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

(cherry picked from commit 5d2f0f8)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 1, 2025
…ileged User Monitoring Dashboard flyout error fix (elastic#225757)

## Summary

The privileged user monitoring dashboard was recently released as
Technical preview as part of 9.1 feature freeze.
The flyout, when accessed from the privileged user table, gave an error
as below :

![Screenshot 2025-06-25 at 1 11
06 PM](https://github.com/user-attachments/assets/c0f0a226-f367-4ee6-959e-e91f79f36bdb)

![Screenshot 2025-06-25 at 1 11
34 PM](https://github.com/user-attachments/assets/f6db3e1a-8c55-41be-b21b-69996c686479)

https://github.com/user-attachments/assets/f5882e74-7088-4f4f-86d2-ec0f2988a96c

Following the ML platform changes in PR elastic#221081, the API endpoint
`/internal/ml/results/anomalies_table_data` was updated to accept the
[threshold] field as an array of [SeverityThreshold] objects instead of
a single number. This change was part of a larger refactoring to support
more sophisticated anomaly severity filtering with minimum and maximum
threshold ranges.

However, the Security Solution's anomalies table data integration was
still sending the old format, causing a 400 Bad Request error:
```
[request body.threshold]: expected value of type [array] but got [number]
```

### Root Cause
Backend expectation (new): [threshold: [{ min: number, max?: number }]]
Frontend sending (old): [threshold: number]

The ML backend schema was updated in [results_service_schema.ts]

threshold: schema.number(),

threshold: schema.arrayOf(severityThresholdSchema),

### Fix
1. Updated type definitions [anomalies_table_data.ts]
2. Updated API call [use_anomalies_table_data.ts]

### Testing Steps :

1. Check out the main branch of
[security-documents-generator](https://github.com/elastic/security-documents-generator).
3. Run: `yarn start privileged-user-monitoring`
4. After this completes, a CSV file should be generated.
5. Navigate to the Privileged User Monitoring dashboard page.
6. Click "Import file", or if you’ve already imported data before, click
"Manage data sources" and then "Import file".
7. Select the CSV file generated in step 3.
8. On the dashboard, scroll down to the table titled "Privileged Users".
9. Click the double-headed arrow next to any user name — this should
open a flyout.
10. Ensure that no errors appear when the flyout opens.
11. Alternatively, open your browser’s DevTools Network tab and verify
that the API call to
`/internal/ml/results/anomalies_table_data` does not return a 400 status
code.

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

(cherry picked from commit 5d2f0f8)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 1, 2025
…g]Privileged User Monitoring Dashboard flyout error fix (#225757) (#225955)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Security Solution][Entity Analytics][Privileged User
Monitoring]Privileged User Monitoring Dashboard flyout error fix
(#225757)](#225757)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Abhishek
Bhatia","email":"117628830+abhishekbhatia1710@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-07-01T08:42:08Z","message":"[Security
Solution][Entity Analytics][Privileged User Monitoring]Privileged User
Monitoring Dashboard flyout error fix (#225757)\n\n## Summary\n\n\nThe
privileged user monitoring dashboard was recently released as\nTechnical
preview as part of 9.1 feature freeze.\nThe flyout, when accessed from
the privileged user table, gave an error\nas below :\n\n![Screenshot
2025-06-25 at 1
11\n06 PM](https://github.com/user-attachments/assets/c0f0a226-f367-4ee6-959e-e91f79f36bdb)\n\n![Screenshot
2025-06-25 at 1
11\n34 PM](https://github.com/user-attachments/assets/f6db3e1a-8c55-41be-b21b-69996c686479)\n\n\nhttps://github.com/user-attachments/assets/f5882e74-7088-4f4f-86d2-ec0f2988a96c\n\nFollowing
the ML platform changes in PR #221081, the API
endpoint\n`/internal/ml/results/anomalies_table_data` was updated to
accept the\n[threshold] field as an array of [SeverityThreshold] objects
instead of\na single number. This change was part of a larger
refactoring to support\nmore sophisticated anomaly severity filtering
with minimum and maximum\nthreshold ranges.\n\nHowever, the Security
Solution's anomalies table data integration was\nstill sending the old
format, causing a 400 Bad Request error:\n```\n[request body.threshold]:
expected value of type [array] but got [number]\n```\n\n### Root
Cause\nBackend expectation (new): [threshold: [{ min: number, max?:
number }]]\nFrontend sending (old): [threshold: number]\n\nThe ML
backend schema was updated in [results_service_schema.ts]\n\nthreshold:
schema.number(),\n\nthreshold:
schema.arrayOf(severityThresholdSchema),\n\n### Fix\n1. Updated type
definitions [anomalies_table_data.ts]\n2. Updated API call
[use_anomalies_table_data.ts]\n\n### Testing Steps : \n\n1. Check out
the main branch
of\n[security-documents-generator](https://github.com/elastic/security-documents-generator).\n3.
Run: `yarn start privileged-user-monitoring`\n4. After this completes, a
CSV file should be generated.\n5. Navigate to the Privileged User
Monitoring dashboard page.\n6. Click \"Import file\", or if you’ve
already imported data before, click\n\"Manage data sources\" and then
\"Import file\".\n7. Select the CSV file generated in step 3.\n8. On the
dashboard, scroll down to the table titled \"Privileged Users\".\n9.
Click the double-headed arrow next to any user name — this should\nopen
a flyout.\n10. Ensure that no errors appear when the flyout opens.\n11.
Alternatively, open your browser’s DevTools Network tab and verify\nthat
the API call to\n`/internal/ml/results/anomalies_table_data` does not
return a 400 status\ncode.\n\n### Checklist\n\nCheck the PR satisfies
following conditions. \n\nReviewers should verify this PR satisfies this
list as well.\n\n- [ ] Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[ ] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"5d2f0f8621724219dd1b9d91bc7444a1ec722456","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Entity
Analytics","backport:version","v9.1.0","v9.2.0"],"title":"[Security
Solution][Entity Analytics][Privileged User Monitoring]Privileged User
Monitoring Dashboard flyout error
fix","number":225757,"url":"https://github.com/elastic/kibana/pull/225757","mergeCommit":{"message":"[Security
Solution][Entity Analytics][Privileged User Monitoring]Privileged User
Monitoring Dashboard flyout error fix (#225757)\n\n## Summary\n\n\nThe
privileged user monitoring dashboard was recently released as\nTechnical
preview as part of 9.1 feature freeze.\nThe flyout, when accessed from
the privileged user table, gave an error\nas below :\n\n![Screenshot
2025-06-25 at 1
11\n06 PM](https://github.com/user-attachments/assets/c0f0a226-f367-4ee6-959e-e91f79f36bdb)\n\n![Screenshot
2025-06-25 at 1
11\n34 PM](https://github.com/user-attachments/assets/f6db3e1a-8c55-41be-b21b-69996c686479)\n\n\nhttps://github.com/user-attachments/assets/f5882e74-7088-4f4f-86d2-ec0f2988a96c\n\nFollowing
the ML platform changes in PR #221081, the API
endpoint\n`/internal/ml/results/anomalies_table_data` was updated to
accept the\n[threshold] field as an array of [SeverityThreshold] objects
instead of\na single number. This change was part of a larger
refactoring to support\nmore sophisticated anomaly severity filtering
with minimum and maximum\nthreshold ranges.\n\nHowever, the Security
Solution's anomalies table data integration was\nstill sending the old
format, causing a 400 Bad Request error:\n```\n[request body.threshold]:
expected value of type [array] but got [number]\n```\n\n### Root
Cause\nBackend expectation (new): [threshold: [{ min: number, max?:
number }]]\nFrontend sending (old): [threshold: number]\n\nThe ML
backend schema was updated in [results_service_schema.ts]\n\nthreshold:
schema.number(),\n\nthreshold:
schema.arrayOf(severityThresholdSchema),\n\n### Fix\n1. Updated type
definitions [anomalies_table_data.ts]\n2. Updated API call
[use_anomalies_table_data.ts]\n\n### Testing Steps : \n\n1. Check out
the main branch
of\n[security-documents-generator](https://github.com/elastic/security-documents-generator).\n3.
Run: `yarn start privileged-user-monitoring`\n4. After this completes, a
CSV file should be generated.\n5. Navigate to the Privileged User
Monitoring dashboard page.\n6. Click \"Import file\", or if you’ve
already imported data before, click\n\"Manage data sources\" and then
\"Import file\".\n7. Select the CSV file generated in step 3.\n8. On the
dashboard, scroll down to the table titled \"Privileged Users\".\n9.
Click the double-headed arrow next to any user name — this should\nopen
a flyout.\n10. Ensure that no errors appear when the flyout opens.\n11.
Alternatively, open your browser’s DevTools Network tab and verify\nthat
the API call to\n`/internal/ml/results/anomalies_table_data` does not
return a 400 status\ncode.\n\n### Checklist\n\nCheck the PR satisfies
following conditions. \n\nReviewers should verify this PR satisfies this
list as well.\n\n- [ ] Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[ ] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"5d2f0f8621724219dd1b9d91bc7444a1ec722456"}},"sourceBranch":"main","suggestedTargetBranches":["9.1"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225757","number":225757,"mergeCommit":{"message":"[Security
Solution][Entity Analytics][Privileged User Monitoring]Privileged User
Monitoring Dashboard flyout error fix (#225757)\n\n## Summary\n\n\nThe
privileged user monitoring dashboard was recently released as\nTechnical
preview as part of 9.1 feature freeze.\nThe flyout, when accessed from
the privileged user table, gave an error\nas below :\n\n![Screenshot
2025-06-25 at 1
11\n06 PM](https://github.com/user-attachments/assets/c0f0a226-f367-4ee6-959e-e91f79f36bdb)\n\n![Screenshot
2025-06-25 at 1
11\n34 PM](https://github.com/user-attachments/assets/f6db3e1a-8c55-41be-b21b-69996c686479)\n\n\nhttps://github.com/user-attachments/assets/f5882e74-7088-4f4f-86d2-ec0f2988a96c\n\nFollowing
the ML platform changes in PR #221081, the API
endpoint\n`/internal/ml/results/anomalies_table_data` was updated to
accept the\n[threshold] field as an array of [SeverityThreshold] objects
instead of\na single number. This change was part of a larger
refactoring to support\nmore sophisticated anomaly severity filtering
with minimum and maximum\nthreshold ranges.\n\nHowever, the Security
Solution's anomalies table data integration was\nstill sending the old
format, causing a 400 Bad Request error:\n```\n[request body.threshold]:
expected value of type [array] but got [number]\n```\n\n### Root
Cause\nBackend expectation (new): [threshold: [{ min: number, max?:
number }]]\nFrontend sending (old): [threshold: number]\n\nThe ML
backend schema was updated in [results_service_schema.ts]\n\nthreshold:
schema.number(),\n\nthreshold:
schema.arrayOf(severityThresholdSchema),\n\n### Fix\n1. Updated type
definitions [anomalies_table_data.ts]\n2. Updated API call
[use_anomalies_table_data.ts]\n\n### Testing Steps : \n\n1. Check out
the main branch
of\n[security-documents-generator](https://github.com/elastic/security-documents-generator).\n3.
Run: `yarn start privileged-user-monitoring`\n4. After this completes, a
CSV file should be generated.\n5. Navigate to the Privileged User
Monitoring dashboard page.\n6. Click \"Import file\", or if you’ve
already imported data before, click\n\"Manage data sources\" and then
\"Import file\".\n7. Select the CSV file generated in step 3.\n8. On the
dashboard, scroll down to the table titled \"Privileged Users\".\n9.
Click the double-headed arrow next to any user name — this should\nopen
a flyout.\n10. Ensure that no errors appear when the flyout opens.\n11.
Alternatively, open your browser’s DevTools Network tab and verify\nthat
the API call to\n`/internal/ml/results/anomalies_table_data` does not
return a 400 status\ncode.\n\n### Checklist\n\nCheck the PR satisfies
following conditions. \n\nReviewers should verify this PR satisfies this
list as well.\n\n- [ ] Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[ ] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"5d2f0f8621724219dd1b9d91bc7444a1ec722456"}}]}]
BACKPORT-->

Co-authored-by: Abhishek Bhatia <117628830+abhishekbhatia1710@users.noreply.github.com>
@jaredburgettelastic jaredburgettelastic changed the title [Security Solution][Entity Analytics][Privileged User Monitoring]Privileged User Monitoring Dashboard flyout error fix Jul 1, 2025
@jaredburgettelastic
Copy link
Contributor

Updated the PR title to clearly describe that this was a generic fix across multiple areas, although it happened to fix the specific issue for privileged user monitoring.

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

Labels

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.1.0 v9.2.0

4 participants