-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated #193428
[Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated #193428
Conversation
…an entity is repeated ### Summary This PR fixes a display issue in Attack discovery where entities repeated in a description were displayed with a UUID instead of the value, as illustrated by the _Before_ and _After_ screenshots below: **Before** ![before](https://github.com/user-attachments/assets/9197c9b0-27d2-4f46-a967-35bb8ca254d0) **After** ![after](https://github.com/user-attachments/assets/2d7c16bd-972c-45cc-a22f-abe7c8c6c019)
Pinging @elastic/security-solution (Team: SecuritySolution) |
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
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! Thanks for the added test coverage as well 👍
…entity is repeated (elastic#193428) ## [Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated ### Summary This PR fixes a display issue in Attack discovery where entities repeated in a description were displayed with a UUID instead of the value, as illustrated by the _Before_ and _After_ screenshots below: **Before** ![before](https://github.com/user-attachments/assets/9197c9b0-27d2-4f46-a967-35bb8ca254d0) **After** ![after](https://github.com/user-attachments/assets/2d7c16bd-972c-45cc-a22f-abe7c8c6c019) (cherry picked from commit a84a045)
…entity is repeated (elastic#193428) ## [Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated ### Summary This PR fixes a display issue in Attack discovery where entities repeated in a description were displayed with a UUID instead of the value, as illustrated by the _Before_ and _After_ screenshots below: **Before** ![before](https://github.com/user-attachments/assets/9197c9b0-27d2-4f46-a967-35bb8ca254d0) **After** ![after](https://github.com/user-attachments/assets/2d7c16bd-972c-45cc-a22f-abe7c8c6c019) (cherry picked from commit a84a045)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…hen an entity is repeated (#193428) (#193497) # Backport This will backport the following commits from `main` to `8.15`: - [[Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated (#193428)](#193428) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Andrew Macri","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-19T22:37:50Z","message":"[Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated (#193428)\n\n## [Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated\r\n\r\n### Summary\r\n\r\nThis PR fixes a display issue in Attack discovery where entities repeated in a description were displayed with a UUID instead of the value, as illustrated by the _Before_ and _After_ screenshots below:\r\n\r\n**Before**\r\n\r\n![before](https://github.com/user-attachments/assets/9197c9b0-27d2-4f46-a967-35bb8ca254d0)\r\n\r\n**After**\r\n\r\n![after](https://github.com/user-attachments/assets/2d7c16bd-972c-45cc-a22f-abe7c8c6c019)","sha":"a84a045e353c8bb2b3780065adbccc2b66b15d46","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","v9.0.0","Team: SecuritySolution","backport:prev-minor","Team:Security Generative AI","v8.16.0","v8.15.2"],"title":"[Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated","number":193428,"url":"https://github.com/elastic/kibana/pull/193428","mergeCommit":{"message":"[Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated (#193428)\n\n## [Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated\r\n\r\n### Summary\r\n\r\nThis PR fixes a display issue in Attack discovery where entities repeated in a description were displayed with a UUID instead of the value, as illustrated by the _Before_ and _After_ screenshots below:\r\n\r\n**Before**\r\n\r\n![before](https://github.com/user-attachments/assets/9197c9b0-27d2-4f46-a967-35bb8ca254d0)\r\n\r\n**After**\r\n\r\n![after](https://github.com/user-attachments/assets/2d7c16bd-972c-45cc-a22f-abe7c8c6c019)","sha":"a84a045e353c8bb2b3780065adbccc2b66b15d46"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193428","number":193428,"mergeCommit":{"message":"[Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated (#193428)\n\n## [Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated\r\n\r\n### Summary\r\n\r\nThis PR fixes a display issue in Attack discovery where entities repeated in a description were displayed with a UUID instead of the value, as illustrated by the _Before_ and _After_ screenshots below:\r\n\r\n**Before**\r\n\r\n![before](https://github.com/user-attachments/assets/9197c9b0-27d2-4f46-a967-35bb8ca254d0)\r\n\r\n**After**\r\n\r\n![after](https://github.com/user-attachments/assets/2d7c16bd-972c-45cc-a22f-abe7c8c6c019)","sha":"a84a045e353c8bb2b3780065adbccc2b66b15d46"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Andrew Macri <[email protected]>
…en an entity is repeated (#193428) (#193498) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated (#193428)](#193428) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Andrew Macri","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-19T22:37:50Z","message":"[Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated (#193428)\n\n## [Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated\r\n\r\n### Summary\r\n\r\nThis PR fixes a display issue in Attack discovery where entities repeated in a description were displayed with a UUID instead of the value, as illustrated by the _Before_ and _After_ screenshots below:\r\n\r\n**Before**\r\n\r\n![before](https://github.com/user-attachments/assets/9197c9b0-27d2-4f46-a967-35bb8ca254d0)\r\n\r\n**After**\r\n\r\n![after](https://github.com/user-attachments/assets/2d7c16bd-972c-45cc-a22f-abe7c8c6c019)","sha":"a84a045e353c8bb2b3780065adbccc2b66b15d46","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","v9.0.0","Team: SecuritySolution","backport:prev-minor","Team:Security Generative AI","v8.16.0","v8.15.2"],"title":"[Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated","number":193428,"url":"https://github.com/elastic/kibana/pull/193428","mergeCommit":{"message":"[Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated (#193428)\n\n## [Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated\r\n\r\n### Summary\r\n\r\nThis PR fixes a display issue in Attack discovery where entities repeated in a description were displayed with a UUID instead of the value, as illustrated by the _Before_ and _After_ screenshots below:\r\n\r\n**Before**\r\n\r\n![before](https://github.com/user-attachments/assets/9197c9b0-27d2-4f46-a967-35bb8ca254d0)\r\n\r\n**After**\r\n\r\n![after](https://github.com/user-attachments/assets/2d7c16bd-972c-45cc-a22f-abe7c8c6c019)","sha":"a84a045e353c8bb2b3780065adbccc2b66b15d46"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193428","number":193428,"mergeCommit":{"message":"[Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated (#193428)\n\n## [Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated\r\n\r\n### Summary\r\n\r\nThis PR fixes a display issue in Attack discovery where entities repeated in a description were displayed with a UUID instead of the value, as illustrated by the _Before_ and _After_ screenshots below:\r\n\r\n**Before**\r\n\r\n![before](https://github.com/user-attachments/assets/9197c9b0-27d2-4f46-a967-35bb8ca254d0)\r\n\r\n**After**\r\n\r\n![after](https://github.com/user-attachments/assets/2d7c16bd-972c-45cc-a22f-abe7c8c6c019)","sha":"a84a045e353c8bb2b3780065adbccc2b66b15d46"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Andrew Macri <[email protected]>
Object.entries<string>(replacements ?? {}).reduce((acc, [key, value]) => { | ||
const regex = new RegExp(key, 'g'); | ||
|
||
return acc.replace(regex, value); |
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.
acc.replaceAll(key, value)
would have been better here; or better still, a call to the common replacements function here and on line 47
below, so I opened a follow-up PR: #193645
…nction This PR is a follow-up to <elastic#193428>, to make use of the common function for replacing anonymized values with original values
…on (elastic#193645) ### [Security Solution] [Attack discovery] Use common replacements function This PR is a follow-up to <elastic#193428>, to make use of the common function for replacing anonymized values with original values (cherry picked from commit 30831e6)
…on (elastic#193645) ### [Security Solution] [Attack discovery] Use common replacements function This PR is a follow-up to <elastic#193428>, to make use of the common function for replacing anonymized values with original values (cherry picked from commit 30831e6)
…function (#193645) (#194198) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] [Attack discovery] Use common replacements function (#193645)](#193645) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Andrew Macri","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-26T17:08:32Z","message":"[Security Solution] [Attack discovery] Use common replacements function (#193645)\n\n### [Security Solution] [Attack discovery] Use common replacements function\r\n\r\nThis PR is a follow-up to <#193428>, to make use of the common function for replacing anonymized values with original values","sha":"30831e61568d4cd58aec2493767180e05ea3ec28","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team: SecuritySolution","Team:Security Generative AI","v8.16.0","backport:version","v8.15.3"],"title":"[Security Solution] [Attack discovery] Use common replacements function","number":193645,"url":"https://github.com/elastic/kibana/pull/193645","mergeCommit":{"message":"[Security Solution] [Attack discovery] Use common replacements function (#193645)\n\n### [Security Solution] [Attack discovery] Use common replacements function\r\n\r\nThis PR is a follow-up to <#193428>, to make use of the common function for replacing anonymized values with original values","sha":"30831e61568d4cd58aec2493767180e05ea3ec28"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193645","number":193645,"mergeCommit":{"message":"[Security Solution] [Attack discovery] Use common replacements function (#193645)\n\n### [Security Solution] [Attack discovery] Use common replacements function\r\n\r\nThis PR is a follow-up to <#193428>, to make use of the common function for replacing anonymized values with original values","sha":"30831e61568d4cd58aec2493767180e05ea3ec28"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Andrew Macri <[email protected]>
… function (#193645) (#194197) # Backport This will backport the following commits from `main` to `8.15`: - [[Security Solution] [Attack discovery] Use common replacements function (#193645)](#193645) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Andrew Macri","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-26T17:08:32Z","message":"[Security Solution] [Attack discovery] Use common replacements function (#193645)\n\n### [Security Solution] [Attack discovery] Use common replacements function\r\n\r\nThis PR is a follow-up to <#193428>, to make use of the common function for replacing anonymized values with original values","sha":"30831e61568d4cd58aec2493767180e05ea3ec28","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team: SecuritySolution","Team:Security Generative AI","v8.16.0","backport:version","v8.15.3"],"title":"[Security Solution] [Attack discovery] Use common replacements function","number":193645,"url":"https://github.com/elastic/kibana/pull/193645","mergeCommit":{"message":"[Security Solution] [Attack discovery] Use common replacements function (#193645)\n\n### [Security Solution] [Attack discovery] Use common replacements function\r\n\r\nThis PR is a follow-up to <#193428>, to make use of the common function for replacing anonymized values with original values","sha":"30831e61568d4cd58aec2493767180e05ea3ec28"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193645","number":193645,"mergeCommit":{"message":"[Security Solution] [Attack discovery] Use common replacements function (#193645)\n\n### [Security Solution] [Attack discovery] Use common replacements function\r\n\r\nThis PR is a follow-up to <#193428>, to make use of the common function for replacing anonymized values with original values","sha":"30831e61568d4cd58aec2493767180e05ea3ec28"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Andrew Macri <[email protected]>
[Security Solution] [Attack discovery] Fixes a display issue when an entity is repeated
Summary
This PR fixes a display issue in Attack discovery where entities repeated in a description were displayed with a UUID instead of the value, as illustrated by the Before and After screenshots below:
Before
After