-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Entity Store] Bugfix: Double nested arrays #197589
Conversation
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/security-entity-analytics (Team:Entity Analytics) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice find.
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]
History
cc @hop-dev |
Starting backport for target branches: 8.16, 8.x https://github.com/elastic/kibana/actions/runs/11503130723 |
## Summary Entities were appearing in the entity store with double nested arrays like below. The issue was that the arrays changed from `List` to `Set` type and the code only checked for lists. Using `Collection` has fixed this. ``` "_index": ".entities.v1.latest.security_host_default", "_id": "c03w7AZsMkm_obWF2HZEirgAAAAAAAAA", "_score": 1, "_source": { "host": { "hostname": [ [ "small-host-1.example.small.com" ] ], "domain": [ [ "example.small.com" ] ], "ip": [ [ "192.168.1.1", "192.168.1.0", "192.168.1.3", "192.168.1.2", "192.168.1.9", "192.168.1.8", "192.168.1.5", "192.168.1.4", "192.168.1.7", "192.168.1.6" ] ], ``` --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 855456b)
## Summary Entities were appearing in the entity store with double nested arrays like below. The issue was that the arrays changed from `List` to `Set` type and the code only checked for lists. Using `Collection` has fixed this. ``` "_index": ".entities.v1.latest.security_host_default", "_id": "c03w7AZsMkm_obWF2HZEirgAAAAAAAAA", "_score": 1, "_source": { "host": { "hostname": [ [ "small-host-1.example.small.com" ] ], "domain": [ [ "example.small.com" ] ], "ip": [ [ "192.168.1.1", "192.168.1.0", "192.168.1.3", "192.168.1.2", "192.168.1.9", "192.168.1.8", "192.168.1.5", "192.168.1.4", "192.168.1.7", "192.168.1.6" ] ], ``` --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 855456b)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.16`: - [[Entity Store] Bugfix: Double nested arrays (#197589)](#197589) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Mark Hopkin","email":"mark.hopkin@elastic.co"},"sourceCommit":{"committedDate":"2024-10-24T16:05:09Z","message":"[Entity Store] Bugfix: Double nested arrays (#197589)\n\n## Summary\r\n\r\nEntities were appearing in the entity store with double nested arrays\r\nlike below.\r\n\r\nThe issue was that the arrays changed from `List` to `Set` type and the\r\ncode only checked for lists. Using `Collection` has fixed this.\r\n\r\n```\r\n \"_index\": \".entities.v1.latest.security_host_default\",\r\n \"_id\": \"c03w7AZsMkm_obWF2HZEirgAAAAAAAAA\",\r\n \"_score\": 1,\r\n \"_source\": {\r\n \"host\": {\r\n \"hostname\": [\r\n [\r\n \"small-host-1.example.small.com\"\r\n ]\r\n ],\r\n \"domain\": [\r\n [\r\n \"example.small.com\"\r\n ]\r\n ],\r\n \"ip\": [\r\n [\r\n \"192.168.1.1\",\r\n \"192.168.1.0\",\r\n \"192.168.1.3\",\r\n \"192.168.1.2\",\r\n \"192.168.1.9\",\r\n \"192.168.1.8\",\r\n \"192.168.1.5\",\r\n \"192.168.1.4\",\r\n \"192.168.1.7\",\r\n \"192.168.1.6\"\r\n ]\r\n ],\r\n ```\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"855456b3bf26204c9a32008a1bc538d9c63b5190","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Team: SecuritySolution","Team:Entity Analytics","v8.16.0","backport:version","v8.17.0"],"title":"[Entity Store] Bugfix: Double nested arrays","number":197589,"url":"https://github.com/elastic/kibana/pull/197589","mergeCommit":{"message":"[Entity Store] Bugfix: Double nested arrays (#197589)\n\n## Summary\r\n\r\nEntities were appearing in the entity store with double nested arrays\r\nlike below.\r\n\r\nThe issue was that the arrays changed from `List` to `Set` type and the\r\ncode only checked for lists. Using `Collection` has fixed this.\r\n\r\n```\r\n \"_index\": \".entities.v1.latest.security_host_default\",\r\n \"_id\": \"c03w7AZsMkm_obWF2HZEirgAAAAAAAAA\",\r\n \"_score\": 1,\r\n \"_source\": {\r\n \"host\": {\r\n \"hostname\": [\r\n [\r\n \"small-host-1.example.small.com\"\r\n ]\r\n ],\r\n \"domain\": [\r\n [\r\n \"example.small.com\"\r\n ]\r\n ],\r\n \"ip\": [\r\n [\r\n \"192.168.1.1\",\r\n \"192.168.1.0\",\r\n \"192.168.1.3\",\r\n \"192.168.1.2\",\r\n \"192.168.1.9\",\r\n \"192.168.1.8\",\r\n \"192.168.1.5\",\r\n \"192.168.1.4\",\r\n \"192.168.1.7\",\r\n \"192.168.1.6\"\r\n ]\r\n ],\r\n ```\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"855456b3bf26204c9a32008a1bc538d9c63b5190"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197589","number":197589,"mergeCommit":{"message":"[Entity Store] Bugfix: Double nested arrays (#197589)\n\n## Summary\r\n\r\nEntities were appearing in the entity store with double nested arrays\r\nlike below.\r\n\r\nThe issue was that the arrays changed from `List` to `Set` type and the\r\ncode only checked for lists. Using `Collection` has fixed this.\r\n\r\n```\r\n \"_index\": \".entities.v1.latest.security_host_default\",\r\n \"_id\": \"c03w7AZsMkm_obWF2HZEirgAAAAAAAAA\",\r\n \"_score\": 1,\r\n \"_source\": {\r\n \"host\": {\r\n \"hostname\": [\r\n [\r\n \"small-host-1.example.small.com\"\r\n ]\r\n ],\r\n \"domain\": [\r\n [\r\n \"example.small.com\"\r\n ]\r\n ],\r\n \"ip\": [\r\n [\r\n \"192.168.1.1\",\r\n \"192.168.1.0\",\r\n \"192.168.1.3\",\r\n \"192.168.1.2\",\r\n \"192.168.1.9\",\r\n \"192.168.1.8\",\r\n \"192.168.1.5\",\r\n \"192.168.1.4\",\r\n \"192.168.1.7\",\r\n \"192.168.1.6\"\r\n ]\r\n ],\r\n ```\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"855456b3bf26204c9a32008a1bc538d9c63b5190"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
# Backport This will backport the following commits from `main` to `8.x`: - [[Entity Store] Bugfix: Double nested arrays (#197589)](#197589) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Mark Hopkin","email":"mark.hopkin@elastic.co"},"sourceCommit":{"committedDate":"2024-10-24T16:05:09Z","message":"[Entity Store] Bugfix: Double nested arrays (#197589)\n\n## Summary\r\n\r\nEntities were appearing in the entity store with double nested arrays\r\nlike below.\r\n\r\nThe issue was that the arrays changed from `List` to `Set` type and the\r\ncode only checked for lists. Using `Collection` has fixed this.\r\n\r\n```\r\n \"_index\": \".entities.v1.latest.security_host_default\",\r\n \"_id\": \"c03w7AZsMkm_obWF2HZEirgAAAAAAAAA\",\r\n \"_score\": 1,\r\n \"_source\": {\r\n \"host\": {\r\n \"hostname\": [\r\n [\r\n \"small-host-1.example.small.com\"\r\n ]\r\n ],\r\n \"domain\": [\r\n [\r\n \"example.small.com\"\r\n ]\r\n ],\r\n \"ip\": [\r\n [\r\n \"192.168.1.1\",\r\n \"192.168.1.0\",\r\n \"192.168.1.3\",\r\n \"192.168.1.2\",\r\n \"192.168.1.9\",\r\n \"192.168.1.8\",\r\n \"192.168.1.5\",\r\n \"192.168.1.4\",\r\n \"192.168.1.7\",\r\n \"192.168.1.6\"\r\n ]\r\n ],\r\n ```\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"855456b3bf26204c9a32008a1bc538d9c63b5190","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Team: SecuritySolution","Team:Entity Analytics","v8.16.0","backport:version","v8.17.0"],"title":"[Entity Store] Bugfix: Double nested arrays","number":197589,"url":"https://github.com/elastic/kibana/pull/197589","mergeCommit":{"message":"[Entity Store] Bugfix: Double nested arrays (#197589)\n\n## Summary\r\n\r\nEntities were appearing in the entity store with double nested arrays\r\nlike below.\r\n\r\nThe issue was that the arrays changed from `List` to `Set` type and the\r\ncode only checked for lists. Using `Collection` has fixed this.\r\n\r\n```\r\n \"_index\": \".entities.v1.latest.security_host_default\",\r\n \"_id\": \"c03w7AZsMkm_obWF2HZEirgAAAAAAAAA\",\r\n \"_score\": 1,\r\n \"_source\": {\r\n \"host\": {\r\n \"hostname\": [\r\n [\r\n \"small-host-1.example.small.com\"\r\n ]\r\n ],\r\n \"domain\": [\r\n [\r\n \"example.small.com\"\r\n ]\r\n ],\r\n \"ip\": [\r\n [\r\n \"192.168.1.1\",\r\n \"192.168.1.0\",\r\n \"192.168.1.3\",\r\n \"192.168.1.2\",\r\n \"192.168.1.9\",\r\n \"192.168.1.8\",\r\n \"192.168.1.5\",\r\n \"192.168.1.4\",\r\n \"192.168.1.7\",\r\n \"192.168.1.6\"\r\n ]\r\n ],\r\n ```\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"855456b3bf26204c9a32008a1bc538d9c63b5190"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197589","number":197589,"mergeCommit":{"message":"[Entity Store] Bugfix: Double nested arrays (#197589)\n\n## Summary\r\n\r\nEntities were appearing in the entity store with double nested arrays\r\nlike below.\r\n\r\nThe issue was that the arrays changed from `List` to `Set` type and the\r\ncode only checked for lists. Using `Collection` has fixed this.\r\n\r\n```\r\n \"_index\": \".entities.v1.latest.security_host_default\",\r\n \"_id\": \"c03w7AZsMkm_obWF2HZEirgAAAAAAAAA\",\r\n \"_score\": 1,\r\n \"_source\": {\r\n \"host\": {\r\n \"hostname\": [\r\n [\r\n \"small-host-1.example.small.com\"\r\n ]\r\n ],\r\n \"domain\": [\r\n [\r\n \"example.small.com\"\r\n ]\r\n ],\r\n \"ip\": [\r\n [\r\n \"192.168.1.1\",\r\n \"192.168.1.0\",\r\n \"192.168.1.3\",\r\n \"192.168.1.2\",\r\n \"192.168.1.9\",\r\n \"192.168.1.8\",\r\n \"192.168.1.5\",\r\n \"192.168.1.4\",\r\n \"192.168.1.7\",\r\n \"192.168.1.6\"\r\n ]\r\n ],\r\n ```\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"855456b3bf26204c9a32008a1bc538d9c63b5190"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
Summary
Entities were appearing in the entity store with double nested arrays like below.
The issue was that the arrays changed from
List
toSet
type and the code only checked for lists. UsingCollection
has fixed this.