Skip to content
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

Merged

Conversation

andrew-goldstein
Copy link
Contributor

@andrew-goldstein andrew-goldstein commented Sep 19, 2024

[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

After

after

…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)
@andrew-goldstein andrew-goldstein added bug Fixes for quality problems that affect the customer experience v9.0.0 Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.16.0 v8.15.2 labels Sep 19, 2024
@andrew-goldstein andrew-goldstein self-assigned this Sep 19, 2024
@andrew-goldstein andrew-goldstein requested a review from a team as a code owner September 19, 2024 14:06
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@andrew-goldstein andrew-goldstein added release_note:fix backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Sep 19, 2024
@andrew-goldstein
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💛 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 20.4MB 20.4MB +70.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @andrew-goldstein

@andrew-goldstein andrew-goldstein added the Team:Security Generative AI Security Generative AI label Sep 19, 2024
Copy link
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.

LGTM! Thanks for the added test coverage as well 👍

@andrew-goldstein andrew-goldstein merged commit a84a045 into elastic:main Sep 19, 2024
42 checks passed
@andrew-goldstein andrew-goldstein deleted the fix-anonymization-display-issue branch September 19, 2024 22:37
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 19, 2024
…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)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 19, 2024
…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)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.15
8.x

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 Sep 20, 2024
…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]>
kibanamachine added a commit that referenced this pull request Sep 20, 2024
…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);
Copy link
Contributor Author

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

andrew-goldstein added a commit to andrew-goldstein/kibana that referenced this pull request Sep 26, 2024
…nction

This PR is a follow-up to <elastic#193428>, to make use of the common function for replacing anonymized values with original values
andrew-goldstein added a commit that referenced this pull request Sep 26, 2024
…on (#193645)

### [Security Solution] [Attack discovery] Use common replacements function

This PR is a follow-up to <#193428>, to make use of the common function for replacing anonymized values with original values
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 26, 2024
…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)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 26, 2024
…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)
kibanamachine added a commit that referenced this pull request Sep 26, 2024
…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]>
kibanamachine added a commit that referenced this pull request Sep 26, 2024
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) bug Fixes for quality problems that affect the customer experience release_note:fix Team:Security Generative AI Security Generative AI Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.15.3 v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants