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

[SecuritySolution] Ingest pipelines conflict when upgrading host risk scores #145232

Merged
merged 6 commits into from
Nov 16, 2022

Conversation

angorayc
Copy link
Contributor

@angorayc angorayc commented Nov 15, 2022

Summary

Original issue: #144916
Users installed via https://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/host-risk-score.md and https://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/user-risk-score.md
couldn't upgrade successfully.

Fixes:

  1. Remove all the legacy scripts and ingest pipelines with or without space name
  2. Add version history to x-pack/plugins/security_solution/server/lib/risk_score/readme.md

Screenshot 2022-11-15 at 13 49 43

Screenshot 2022-11-15 at 13 53 54

Steps to reproduce:

Option 1: Cypress: Run upgrade_risk_score.cy.ts

Option 2: Manually:

  1. Follow the steps of https://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/host-risk-score.md and https://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/user-risk-score.md to install the module.
  2. Back to /app/security/entity_analytics and click the upgrade buttons.
  3. Observe if the installation success.

Checklist

Delete any items that are not applicable to this PR.

@angorayc angorayc added bug Fixes for quality problems that affect the customer experience Team:Threat Hunting Security Solution Threat Hunting Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore v8.6.0 v8.5.1 labels Nov 15, 2022
@angorayc angorayc marked this pull request as ready for review November 15, 2022 16:22
@angorayc angorayc requested a review from a team as a code owner November 15, 2022 16:22
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@elasticmachine
Copy link
Contributor

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

@angorayc angorayc changed the title [SecuritySolution] remove legacy ingest pipelines [SecuritySolution] Ingest pipelines conflict when upgrading host risk scores Nov 15, 2022
@angorayc angorayc added the release_note:skip Skip the PR/issue when compiling release notes label Nov 15, 2022
@@ -35,24 +35,24 @@ import { ENTITY_ANALYTICS_URL } from '../../urls/navigation';

const spaceId = 'default';

describe('Upgrade risk scores', () => {
describe('Upgrade risk scores from 8.4', () => {
Copy link
Contributor

@stephmilovic stephmilovic Nov 15, 2022

Choose a reason for hiding this comment

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

Testing nit....

Because all of the tests besides should upgrade X risk score successfully behave the same for 8.3 and 8.4, can we organize the generic tests together and the version tests together? I did this locally if you want to copy this

I tried describe.each for the version tests but cypress did not like that, so used forEach instead.

Thanks for including these, makes it very easy for me to test!

EDIT: I also combined a few tests that I believe are safe to do just to try to speed these up a bit. Not sure if you saw this comment before I did that, but I updated the pastebin link

Copy link
Contributor Author

@angorayc angorayc Nov 16, 2022

Choose a reason for hiding this comment

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

Thanks so much for the improvement Steph! Really appreciate it! I've updated it accordingly.

Copy link
Contributor

@stephmilovic stephmilovic 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 detailed tests! Great job on this fix @angorayc 🚀

@angorayc angorayc added v8.5.2 and removed v8.5.1 labels Nov 16, 2022
@ghost
Copy link

ghost commented Nov 16, 2022

Hi @angorayc

we have validated the issue following the above steps under the Option 2: Manually of the ticket and we are able to successfully able to upgrade the host risk on manually enabling the host risk score dev hits.

Build Details:

zeus@ubuntu-desktop:~/Desktop/newmain/kibana$ git status
On branch issue/144916
Your branch is up to date with 'angorayc/issue/144916'.

nothing to commit, working tree clean
zeus@ubuntu-desktop:~/Desktop/newmain/kibana$ git log
commit 0aae9052f30ad18885d585eec8d75c1c43c48368 (HEAD -> issue/144916, angorayc/issue/144916)
Author: Angela Chuang <6295984+angorayc@users.noreply.github.com>
Date:   Wed Nov 16 09:27:42 2022 +0000

    Update x-pack/plugins/security_solution/common/utils/risk_score_modules.ts

    Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>

Screen-Cast

karanbir-kibana-main-linux.-.VMware.Remote.Console.2022-11-16.17-02-01.mp4

image

Please let us known if we need to test anything more for this fix or any other version.

thanks

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

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 9.6MB 9.6MB +407.0B
Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 59 65 +6
osquery 108 113 +5
securitySolution 441 447 +6
total +19

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 67 73 +6
osquery 109 115 +6
securitySolution 518 524 +6
total +20

History

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

@angorayc angorayc merged commit b6693bd into elastic:main Nov 16, 2022
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.5 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 145232

Questions ?

Please refer to the Backport tool documentation

@angorayc
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.5

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

Questions ?

Please refer to the Backport tool documentation

angorayc added a commit to angorayc/kibana that referenced this pull request Nov 16, 2022
… scores (elastic#145232)

## Summary

Original issue: elastic#144916
Users installed via
https://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/host-risk-score.md
and
https://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/user-risk-score.md
couldn't upgrade successfully.

**Fixes**:
1. Remove all the legacy scripts and ingest pipelines with or without
space name
2. Add version history to
x-pack/plugins/security_solution/server/lib/risk_score/readme.md
<img width="1459" alt="Screenshot 2022-11-15 at 13 49 43"
src="https://user-images.githubusercontent.com/6295984/201936206-e73ab61c-9a0f-4cfe-8a01-9666217bb863.png">

<img width="1429" alt="Screenshot 2022-11-15 at 13 53 54"
src="https://user-images.githubusercontent.com/6295984/201936751-c3a65f46-1f6e-4b2f-a04a-58f1f32a546f.png">

**Steps to reproduce**:

Option 1: **Cypress**: Run `upgrade_risk_score.cy.ts`

Option 2: **Manually**:
1. Follow the steps of
https://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/host-risk-score.md
and
https://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/user-risk-score.md
to install the module.
4. Back to `/app/security/entity_analytics` and click the upgrade
buttons.
5. Observe if the installation success.

### Checklist

Delete any items that are not applicable to this PR.

- [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

Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
(cherry picked from commit b6693bd)

# Conflicts:
#	x-pack/plugins/security_solution/cypress/e2e/dashboards/enable_risk_score.cy.ts
#	x-pack/plugins/security_solution/cypress/e2e/dashboards/upgrade_risk_score.cy.ts
#	x-pack/plugins/security_solution/cypress/tasks/api_calls/risk_scores/index.ts
#	x-pack/plugins/security_solution/cypress/tasks/api_calls/risk_scores/saved_objects.ts
#	x-pack/plugins/security_solution/cypress/tasks/risk_scores/index.ts
#	x-pack/plugins/security_solution/cypress/tasks/risk_scores/ingest_pipelines.ts
#	x-pack/plugins/security_solution/cypress/tasks/risk_scores/stored_scripts.ts
#	x-pack/plugins/security_solution/cypress/tasks/risk_scores/transforms.ts
#	x-pack/plugins/security_solution/public/risk_score/components/risk_score_onboarding/utils.test.ts
#	x-pack/plugins/security_solution/public/risk_score/components/risk_score_onboarding/utils.ts
angorayc added a commit that referenced this pull request Nov 17, 2022
…t risk scores (#145232) (#145352)

# Backport

This will backport the following commits from `main` to `8.5`:
- [[SecuritySolution] Ingest pipelines conflict when upgrading host risk
scores (#145232)](#145232)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Angela
Chuang","email":"6295984+angorayc@users.noreply.github.com"},"sourceCommit":{"committedDate":"2022-11-16T12:26:56Z","message":"[SecuritySolution]
Ingest pipelines conflict when upgrading host risk scores
(#145232)\n\n## Summary\r\n\r\nOriginal issue:
https://github.com/elastic/kibana/issues/144916\r\nUsers installed
via\r\nhttps://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/host-risk-score.md\r\nand\r\nhttps://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/user-risk-score.md\r\ncouldn't
upgrade successfully.\r\n\r\n**Fixes**:\r\n1. Remove all the legacy
scripts and ingest pipelines with or without\r\nspace name\r\n2. Add
version history
to\r\nx-pack/plugins/security_solution/server/lib/risk_score/readme.md\r\n<img
width=\"1459\" alt=\"Screenshot 2022-11-15 at 13 49
43\"\r\nsrc=\"https://user-images.githubusercontent.com/6295984/201936206-e73ab61c-9a0f-4cfe-8a01-9666217bb863.png\">\r\n\r\n<img
width=\"1429\" alt=\"Screenshot 2022-11-15 at 13 53
54\"\r\nsrc=\"https://user-images.githubusercontent.com/6295984/201936751-c3a65f46-1f6e-4b2f-a04a-58f1f32a546f.png\">\r\n\r\n\r\n**Steps
to reproduce**:\r\n\r\nOption 1: **Cypress**: Run
`upgrade_risk_score.cy.ts`\r\n\r\nOption 2: **Manually**: \r\n1. Follow
the steps
of\r\nhttps://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/host-risk-score.md\r\nand\r\nhttps://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/user-risk-score.md\r\nto
install the module.\r\n4. Back to `/app/security/entity_analytics` and
click the upgrade\r\nbuttons.\r\n5. Observe if the installation
success.\r\n\r\n### Checklist\r\n\r\nDelete any items that are not
applicable to this PR.\r\n\r\n-
[x]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\nCo-authored-by: Steph Milovic
<stephanie.milovic@elastic.co>","sha":"b6693bd9260c1620ec5ad8f09141b534c3b02e81","branchLabelMapping":{"^v8.6.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:Threat
Hunting","Team: SecuritySolution","Team:Threat
Hunting:Explore","v8.6.0","v8.5.2"],"number":145232,"url":"https://github.com/elastic/kibana/pull/145232","mergeCommit":{"message":"[SecuritySolution]
Ingest pipelines conflict when upgrading host risk scores
(#145232)\n\n## Summary\r\n\r\nOriginal issue:
https://github.com/elastic/kibana/issues/144916\r\nUsers installed
via\r\nhttps://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/host-risk-score.md\r\nand\r\nhttps://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/user-risk-score.md\r\ncouldn't
upgrade successfully.\r\n\r\n**Fixes**:\r\n1. Remove all the legacy
scripts and ingest pipelines with or without\r\nspace name\r\n2. Add
version history
to\r\nx-pack/plugins/security_solution/server/lib/risk_score/readme.md\r\n<img
width=\"1459\" alt=\"Screenshot 2022-11-15 at 13 49
43\"\r\nsrc=\"https://user-images.githubusercontent.com/6295984/201936206-e73ab61c-9a0f-4cfe-8a01-9666217bb863.png\">\r\n\r\n<img
width=\"1429\" alt=\"Screenshot 2022-11-15 at 13 53
54\"\r\nsrc=\"https://user-images.githubusercontent.com/6295984/201936751-c3a65f46-1f6e-4b2f-a04a-58f1f32a546f.png\">\r\n\r\n\r\n**Steps
to reproduce**:\r\n\r\nOption 1: **Cypress**: Run
`upgrade_risk_score.cy.ts`\r\n\r\nOption 2: **Manually**: \r\n1. Follow
the steps
of\r\nhttps://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/host-risk-score.md\r\nand\r\nhttps://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/user-risk-score.md\r\nto
install the module.\r\n4. Back to `/app/security/entity_analytics` and
click the upgrade\r\nbuttons.\r\n5. Observe if the installation
success.\r\n\r\n### Checklist\r\n\r\nDelete any items that are not
applicable to this PR.\r\n\r\n-
[x]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\nCo-authored-by: Steph Milovic
<stephanie.milovic@elastic.co>","sha":"b6693bd9260c1620ec5ad8f09141b534c3b02e81"}},"sourceBranch":"main","suggestedTargetBranches":["8.5"],"targetPullRequestStates":[{"branch":"main","label":"v8.6.0","labelRegex":"^v8.6.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145232","number":145232,"mergeCommit":{"message":"[SecuritySolution]
Ingest pipelines conflict when upgrading host risk scores
(#145232)\n\n## Summary\r\n\r\nOriginal issue:
https://github.com/elastic/kibana/issues/144916\r\nUsers installed
via\r\nhttps://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/host-risk-score.md\r\nand\r\nhttps://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/user-risk-score.md\r\ncouldn't
upgrade successfully.\r\n\r\n**Fixes**:\r\n1. Remove all the legacy
scripts and ingest pipelines with or without\r\nspace name\r\n2. Add
version history
to\r\nx-pack/plugins/security_solution/server/lib/risk_score/readme.md\r\n<img
width=\"1459\" alt=\"Screenshot 2022-11-15 at 13 49
43\"\r\nsrc=\"https://user-images.githubusercontent.com/6295984/201936206-e73ab61c-9a0f-4cfe-8a01-9666217bb863.png\">\r\n\r\n<img
width=\"1429\" alt=\"Screenshot 2022-11-15 at 13 53
54\"\r\nsrc=\"https://user-images.githubusercontent.com/6295984/201936751-c3a65f46-1f6e-4b2f-a04a-58f1f32a546f.png\">\r\n\r\n\r\n**Steps
to reproduce**:\r\n\r\nOption 1: **Cypress**: Run
`upgrade_risk_score.cy.ts`\r\n\r\nOption 2: **Manually**: \r\n1. Follow
the steps
of\r\nhttps://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/host-risk-score.md\r\nand\r\nhttps://github.com/elastic/detection-rules/blob/main/docs/experimental-machine-learning/user-risk-score.md\r\nto
install the module.\r\n4. Back to `/app/security/entity_analytics` and
click the upgrade\r\nbuttons.\r\n5. Observe if the installation
success.\r\n\r\n### Checklist\r\n\r\nDelete any items that are not
applicable to this PR.\r\n\r\n-
[x]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas
added for features that require explanation or tutorials\r\n- [x] [Unit
or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\nCo-authored-by: Steph Milovic
<stephanie.milovic@elastic.co>","sha":"b6693bd9260c1620ec5ad8f09141b534c3b02e81"}},{"branch":"8.5","label":"v8.5.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting:Explore Team:Threat Hunting Security Solution Threat Hunting Team v8.5.2 v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants