-
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
[SecuritySolution] Ingest pipelines conflict when upgrading host risk scores #145232
Conversation
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
x-pack/plugins/security_solution/common/utils/risk_score_modules.ts
Outdated
Show resolved
Hide resolved
@@ -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', () => { |
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.
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
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.
Thanks so much for the improvement Steph! Really appreciate it! I've updated it accordingly.
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 detailed tests! Great job on this fix @angorayc 🚀
…es.ts Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
Hi @angorayc we have validated the issue following the above steps under the Build Details:
Screen-Cast karanbir-kibana-main-linux.-.VMware.Remote.Console.2022-11-16.17-02-01.mp4Please let us known if we need to test anything more for this fix or any other version. thanks |
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… 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
…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-->
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:
Steps to reproduce:
Option 1: Cypress: Run
upgrade_risk_score.cy.ts
Option 2: Manually:
/app/security/entity_analytics
and click the upgrade buttons.Checklist
Delete any items that are not applicable to this PR.