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] Invalidate prebuilt rules status after package upgrade or installation #150292

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

xcrzx
Copy link
Contributor

@xcrzx xcrzx commented Feb 6, 2023

Resolves: #150306

Summary

Fixes the Load Prebuilt rules button not visible when users visit the rules management page for the first time (no prebuilt detection rules package installed).

Steps to test

  1. Ensure that the detection engine package is not installed:
  2. Navigate to the rules management page.

Previously

The "Load Elastic Prebuilt Rules" button is not visible, and users cannot install prebuilt rules.

With the fix

Users now see loading animation, indicating that the package installation happens in the background. Once the package installation finishes, users see the Load Prebuilt rules button appear.

Screen.Recording.2023-02-07.at.16.22.09.mov

@xcrzx xcrzx added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area v8.7.0 labels Feb 6, 2023
@xcrzx xcrzx self-assigned this Feb 6, 2023
@xcrzx xcrzx force-pushed the prepackaged-status-invalidate branch 9 times, most recently from e57997d to a0eb666 Compare February 8, 2023 16:01
@xcrzx xcrzx marked this pull request as ready for review February 8, 2023 16:11
@xcrzx xcrzx requested review from a team as code owners February 8, 2023 16:11
@xcrzx xcrzx requested a review from spong February 8, 2023 16:11
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@elasticmachine
Copy link
Contributor

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

@xcrzx xcrzx force-pushed the prepackaged-status-invalidate branch from a0eb666 to d19ff8a Compare February 9, 2023 09:43
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.

Checked out, tested locally, and code reviewed -- LGTM!

Prior to checking out I was able to reproduce the issue as described in #150306, and then with these changes I was unable to reproduce the issue (the button showed up and worked as expected). Thanks for the fix here @xcrzx, and for all the cleanup around the useUpgradeSecurityPackages hook. Looks great! 🙂

Note: I did find one pre-existing issue where we're not disabling both install buttons once clicked, which allows for duplicates to be installed, but should be easy to fix with your new changes and the useIsUpgradingSecurityPackages hook.

@xcrzx xcrzx force-pushed the prepackaged-status-invalidate branch from d19ff8a to 1cd1f52 Compare February 13, 2023 13:14
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Security Solution Tests #4 / Add exception using data views from rule details Creates an exception item from alert actions overflow menu
  • [job] [logs] Security Solution Tests #4 / Timeline search and filters Update kqlMode for timeline "before each" hook for "should be able to update timeline kqlMode with search"

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 3721 3723 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 13.8MB 13.8MB +40.0KB
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 426 424 -2

Total ESLint disabled count

id before after diff
securitySolution 502 500 -2

History

  • 💚 Build #106747 succeeded d19ff8afcc33c7ab17978de46d7492b95fe1f4e7
  • 💔 Build #106495 failed a0eb666267144f90ec40b4e564d43825e1376e5d
  • 💚 Build #106145 succeeded e57997da12eb8794408d29734333b964f5188a97
  • 💔 Build #105756 failed 6d9370c089feb88c4e91f15c29ebcb7292bc4eb7
  • 💔 Build #105724 failed d4a59bdbeb276ec3a9105db3e7c5b0182ab7d34e
  • 💔 Build #105582 failed e40e0b5471e190ed942b976e1cf09901f73833c1

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

cc @xcrzx

@xcrzx xcrzx merged commit 4f1f2a8 into elastic:main Feb 13, 2023
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 13, 2023
…grade or installation (elastic#150292)

**Resolves: elastic#150306

## Summary

Fixes the Load Prebuilt rules button not visible when users visit the
rules management page for the first time (no prebuilt detection rules
package installed).

## Steps to test

1. Ensure that the detection engine package is not installed: <img
src="https://user-images.githubusercontent.com/1938181/216949857-a49731f3-535e-4813-95d3-62b2995500bb.png"
width="600" />
2. Navigate to the rules management page.

### Previously

The "Load Elastic Prebuilt Rules" button is not visible, and users
cannot install prebuilt rules.

<img
src="https://user-images.githubusercontent.com/1938181/216950430-4c57a3ad-3146-40a0-82c2-08c4fc2f65c3.png"
width="600" />

### With the fix

Users now see loading animation, indicating that the package
installation happens in the background. Once the package installation
finishes, users see the Load Prebuilt rules button appear.

https://user-images.githubusercontent.com/1938181/217585144-879fe288-0ede-4e01-b585-6aced1d89379.mov
(cherry picked from commit 4f1f2a8)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.7

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 Feb 13, 2023
…age upgrade or installation (#150292) (#151019)

# Backport

This will backport the following commits from `main` to `8.7`:
- [[Security Solution] Invalidate prebuilt rules status after package
upgrade or installation
(#150292)](#150292)

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

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

<!--BACKPORT [{"author":{"name":"Dmitrii
Shevchenko","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-02-13T15:00:20Z","message":"[Security
Solution] Invalidate prebuilt rules status after package upgrade or
installation (#150292)\n\n**Resolves:
https://github.com/elastic/kibana/issues/150306**\r\n\r\n##
Summary\r\n\r\nFixes the Load Prebuilt rules button not visible when
users visit the\r\nrules management page for the first time (no prebuilt
detection rules\r\npackage installed).\r\n\r\n## Steps to test\r\n\r\n1.
Ensure that the detection engine package is not installed:
<img\r\nsrc=\"https://user-images.githubusercontent.com/1938181/216949857-a49731f3-535e-4813-95d3-62b2995500bb.png\"\r\nwidth=\"600\"
/>\r\n2. Navigate to the rules management page.\r\n\r\n###
Previously\r\n\r\nThe \"Load Elastic Prebuilt Rules\" button is not
visible, and users\r\ncannot install prebuilt
rules.\r\n\r\n<img\r\nsrc=\"https://user-images.githubusercontent.com/1938181/216950430-4c57a3ad-3146-40a0-82c2-08c4fc2f65c3.png\"\r\nwidth=\"600\"
/>\r\n\r\n### With the fix\r\n\r\nUsers now see loading animation,
indicating that the package\r\ninstallation happens in the background.
Once the package installation\r\nfinishes, users see the Load Prebuilt
rules button
appear.\r\n\r\n\r\nhttps://user-images.githubusercontent.com/1938181/217585144-879fe288-0ede-4e01-b585-6aced1d89379.mov","sha":"4f1f2a84fdf3421d6b56aac82274dee2e881d376","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","impact:high","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection
Rules","Feature:Prebuilt Detection
Rules","v8.7.0","v8.8.0"],"number":150292,"url":"https://github.com/elastic/kibana/pull/150292","mergeCommit":{"message":"[Security
Solution] Invalidate prebuilt rules status after package upgrade or
installation (#150292)\n\n**Resolves:
https://github.com/elastic/kibana/issues/150306**\r\n\r\n##
Summary\r\n\r\nFixes the Load Prebuilt rules button not visible when
users visit the\r\nrules management page for the first time (no prebuilt
detection rules\r\npackage installed).\r\n\r\n## Steps to test\r\n\r\n1.
Ensure that the detection engine package is not installed:
<img\r\nsrc=\"https://user-images.githubusercontent.com/1938181/216949857-a49731f3-535e-4813-95d3-62b2995500bb.png\"\r\nwidth=\"600\"
/>\r\n2. Navigate to the rules management page.\r\n\r\n###
Previously\r\n\r\nThe \"Load Elastic Prebuilt Rules\" button is not
visible, and users\r\ncannot install prebuilt
rules.\r\n\r\n<img\r\nsrc=\"https://user-images.githubusercontent.com/1938181/216950430-4c57a3ad-3146-40a0-82c2-08c4fc2f65c3.png\"\r\nwidth=\"600\"
/>\r\n\r\n### With the fix\r\n\r\nUsers now see loading animation,
indicating that the package\r\ninstallation happens in the background.
Once the package installation\r\nfinishes, users see the Load Prebuilt
rules button
appear.\r\n\r\n\r\nhttps://user-images.githubusercontent.com/1938181/217585144-879fe288-0ede-4e01-b585-6aced1d89379.mov","sha":"4f1f2a84fdf3421d6b56aac82274dee2e881d376"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/150292","number":150292,"mergeCommit":{"message":"[Security
Solution] Invalidate prebuilt rules status after package upgrade or
installation (#150292)\n\n**Resolves:
https://github.com/elastic/kibana/issues/150306**\r\n\r\n##
Summary\r\n\r\nFixes the Load Prebuilt rules button not visible when
users visit the\r\nrules management page for the first time (no prebuilt
detection rules\r\npackage installed).\r\n\r\n## Steps to test\r\n\r\n1.
Ensure that the detection engine package is not installed:
<img\r\nsrc=\"https://user-images.githubusercontent.com/1938181/216949857-a49731f3-535e-4813-95d3-62b2995500bb.png\"\r\nwidth=\"600\"
/>\r\n2. Navigate to the rules management page.\r\n\r\n###
Previously\r\n\r\nThe \"Load Elastic Prebuilt Rules\" button is not
visible, and users\r\ncannot install prebuilt
rules.\r\n\r\n<img\r\nsrc=\"https://user-images.githubusercontent.com/1938181/216950430-4c57a3ad-3146-40a0-82c2-08c4fc2f65c3.png\"\r\nwidth=\"600\"
/>\r\n\r\n### With the fix\r\n\r\nUsers now see loading animation,
indicating that the package\r\ninstallation happens in the background.
Once the package installation\r\nfinishes, users see the Load Prebuilt
rules button
appear.\r\n\r\n\r\nhttps://user-images.githubusercontent.com/1938181/217585144-879fe288-0ede-4e01-b585-6aced1d89379.mov","sha":"4f1f2a84fdf3421d6b56aac82274dee2e881d376"}}]}]
BACKPORT-->

Co-authored-by: Dmitrii Shevchenko <[email protected]>
@xcrzx xcrzx deleted the prepackaged-status-invalidate branch February 13, 2023 17:33
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 Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. release_note:skip Skip the PR/issue when compiling release notes Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.7.0 v8.8.0
Projects
None yet
6 participants