Skip to content

[Entity Store] Add matched entity limit to resolution CSV upload#260475

Merged
maxcold merged 3 commits intomainfrom
worktree-csv-upload-batch-limit
Apr 1, 2026
Merged

[Entity Store] Add matched entity limit to resolution CSV upload#260475
maxcold merged 3 commits intomainfrom
worktree-csv-upload-batch-limit

Conversation

@maxcold
Copy link
Copy Markdown
Contributor

@maxcold maxcold commented Mar 31, 2026

Summary

Adds a 1,000 entity match limit per CSV row in the entity resolution CSV upload to prevent memory issues from overly broad identity field matches.

  • Adds MAX_MATCHED_ENTITIES = 1000 breaker in the pagination loop of findMatchingEntities
  • Rows exceeding the limit return an actionable error: "Matched more than 1000 entities. Narrow your identifying fields to be more specific."
  • Aligns behavior with the similar breaker in asset criticality CSV upload

Addresses: #260006 (comment)

Checklist

  • 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.

Identify risks

Low risk — adds a safety breaker to an existing pagination loop. No behavioral change for rows matching fewer than 1,000 entities.

Add a 1000 entity match limit per CSV row in the entity resolution
upload to prevent memory issues from overly broad identity field
matches. Aligns with the similar breaker in asset criticality CSV
upload. Rows exceeding the limit return an actionable error message.

Relates: #260006
@maxcold maxcold added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Cloud Security Cloud Security team related labels Mar 31, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-csv-upload-batch-limit
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Comment @coderabbitai help to get the list of available commands and usage tips.

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Mar 31, 2026

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Serverless Detection Engine - Security Solution Cypress Tests #5 / Add rule attachment to chat button should show the "Add to chat" button on the rule creation page should show the "Add to chat" button on the rule creation page
  • [job] [logs] Detection Engine - Security Solution Cypress Tests #1 / Add rule attachment to chat button should show the "Add to chat" button on the rule creation page should show the "Add to chat" button on the rule creation page
  • [job] [logs] Serverless Detection Engine - Security Solution Cypress Tests #5 / Add rule attachment to chat button should show the "Add to chat" button on the rule creation page should show the "Add to chat" button on the rule creation page
  • [job] [logs] Detection Engine - Security Solution Cypress Tests #1 / Add rule attachment to chat button should show the "Add to chat" button on the rule creation page should show the "Add to chat" button on the rule creation page
  • [job] [logs] Serverless Detection Engine - Security Solution Cypress Tests #5 / Add rule attachment to chat button should show the "Add to chat" button on the rule details page should show the "Add to chat" button on the rule details page
  • [job] [logs] Detection Engine - Security Solution Cypress Tests #1 / Add rule attachment to chat button should show the "Add to chat" button on the rule details page should show the "Add to chat" button on the rule details page
  • [job] [logs] Serverless Detection Engine - Security Solution Cypress Tests #5 / Add rule attachment to chat button should show the "Add to chat" button on the rule details page should show the "Add to chat" button on the rule details page
  • [job] [logs] Detection Engine - Security Solution Cypress Tests #1 / Add rule attachment to chat button should show the "Add to chat" button on the rule details page should show the "Add to chat" button on the rule details page
  • [job] [logs] Serverless Detection Engine - Security Solution Cypress Tests #5 / Add rule attachment to chat button should show the "Add to chat" button on the rule editing page should show the "Add to chat" button on the rule editing page
  • [job] [logs] Detection Engine - Security Solution Cypress Tests #1 / Add rule attachment to chat button should show the "Add to chat" button on the rule editing page should show the "Add to chat" button on the rule editing page
  • [job] [logs] Serverless Detection Engine - Security Solution Cypress Tests #5 / Add rule attachment to chat button should show the "Add to chat" button on the rule editing page should show the "Add to chat" button on the rule editing page
  • [job] [logs] Detection Engine - Security Solution Cypress Tests #1 / Add rule attachment to chat button should show the "Add to chat" button on the rule editing page should show the "Add to chat" button on the rule editing page
  • [job] [logs] FTR Configs #122 / Entity Analytics - Entity Resolution @ess @serverless @skipInServerlessMKI Entity Resolution CSV Upload should link matching entities to a target
  • [job] [logs] FTR Configs #66 / serverless security UI Security ML Trained models list page navigation renders trained models list

Metrics [docs]

✅ unchanged

History

maxcold added 2 commits March 31, 2026 17:42
Change >= to > so exactly 1000 matches is allowed. The limit
now triggers at 1001+, consistent with the error message
"Matched more than 1000 entities."
@maxcold maxcold marked this pull request as ready for review March 31, 2026 20:33
@maxcold maxcold requested a review from a team as a code owner March 31, 2026 20:33
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/contextual-security-apps (Team:Cloud Security)

@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Mar 31, 2026

Approvability

Verdict: Needs human review

This PR adds a simple defensive limit check for entity resolution CSV uploads, which is low-risk and straightforward. However, the author does not own these files—they belong to @elastic/security-entity-analytics—so the designated code owners should review and approve the changes.

You can customize Macroscope's approvability policy. Learn more.

Copy link
Copy Markdown
Contributor

@hop-dev hop-dev left a comment

Choose a reason for hiding this comment

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

🚀 Nice thanks for this

@maxcold maxcold merged commit 2852ce9 into main Apr 1, 2026
23 checks passed
@maxcold maxcold deleted the worktree-csv-upload-batch-limit branch April 1, 2026 12:42
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
…stic#260475)

## Summary

Adds a 1,000 entity match limit per CSV row in the entity resolution CSV
upload to prevent memory issues from overly broad identity field
matches.

- Adds `MAX_MATCHED_ENTITIES = 1000` breaker in the pagination loop of
`findMatchingEntities`
- Rows exceeding the limit return an actionable error: *"Matched more
than 1000 entities. Narrow your identifying fields to be more
specific."*
- Aligns behavior with the similar breaker in asset criticality CSV
upload

Addresses:
elastic#260006 (comment)

### Checklist

- [x] 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)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [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
- [x] 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
- [x] 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)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Low risk — adds a safety breaker to an existing pagination loop. No
behavioral change for rows matching fewer than 1,000 entities.
eokoneyo pushed a commit to davismcphee/kibana that referenced this pull request Apr 2, 2026
…stic#260475)

## Summary

Adds a 1,000 entity match limit per CSV row in the entity resolution CSV
upload to prevent memory issues from overly broad identity field
matches.

- Adds `MAX_MATCHED_ENTITIES = 1000` breaker in the pagination loop of
`findMatchingEntities`
- Rows exceeding the limit return an actionable error: *"Matched more
than 1000 entities. Narrow your identifying fields to be more
specific."*
- Aligns behavior with the similar breaker in asset criticality CSV
upload

Addresses:
elastic#260006 (comment)

### Checklist

- [x] 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)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [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
- [x] 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
- [x] 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)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Low risk — adds a safety breaker to an existing pagination loop. No
behavioral change for rows matching fewer than 1,000 entities.
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
…stic#260475)

## Summary

Adds a 1,000 entity match limit per CSV row in the entity resolution CSV
upload to prevent memory issues from overly broad identity field
matches.

- Adds `MAX_MATCHED_ENTITIES = 1000` breaker in the pagination loop of
`findMatchingEntities`
- Rows exceeding the limit return an actionable error: *"Matched more
than 1000 entities. Narrow your identifying fields to be more
specific."*
- Aligns behavior with the similar breaker in asset criticality CSV
upload

Addresses:
elastic#260006 (comment)

### Checklist

- [x] 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)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [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
- [x] 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
- [x] 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)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Low risk — adds a safety breaker to an existing pagination loop. No
behavioral change for rows matching fewer than 1,000 entities.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Cloud Security Cloud Security team related v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants