-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario #234735
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] Make importing prebuilt rules with missing base version tests matching the test scenario #234735
Conversation
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management) |
- [**Scenario: Importing a prebuilt rule with a missing base version when it's already installed but not equal to the import payload**](#scenario-importing-a-prebuilt-rule-with-a-missing-base-version-when-its-already-installed-but-not-equal-to-the-import-payload) | ||
- [**Scenario: Importing a prebuilt rule with a missing base version when it's already installed and not customized but not equal to the import payload**](#scenario-importing-a-prebuilt-rule-with-a-missing-base-version-when-its-already-installed-and-not-customized-but-not-equal-to-the-import-payload) | ||
- [**Scenario: Importing a prebuilt rule with a missing base version when it's already installed, is not customized, and is equal to the import payload**](#scenario-importing-a-prebuilt-rule-with-a-missing-base-version-when-its-already-installed-is-not-customized-and-is-equal-to-the-import-payload) | ||
- [**Scenario: Importing a prebuilt rule with a missing base version when it's already installed, is customized, and is equal to the import payload**](#scenario-importing-a-prebuilt-rule-with-a-missing-base-version-when-its-already-installed-is-customized-and-is-equal-to-the-import-payload) |
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.
Just a question: Shouldn't we have additional case, for:
Importing a prebuilt rule with a missing base version when it's already installed, is customized, and is NOT equal to the import payload**
Now we have a test in which we check that if a rule was customized, the flag is_customized
remains true
even after importing a rule with the same payload. But shouldn't we also check that the same applies when payload is different? I believe the flag is_customized
should still be true in that case.
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.
Yes, ideally we need it for full coverage. I've updated the test plan and added this test scenario implementation.
5683e1e
to
8f643e2
Compare
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.
Hi @maximpn
Thank you for addressing my comment.
The changes LGTM. Approving.
Starting backport for target branches: 8.18, 8.19, 9.0, 9.1 |
💚 Build Succeeded
Metrics [docs]Saved Objects .kibana field count
History
cc @maximpn |
…ersion tests matching the test scenario (elastic#234735) **Relates to:** elastic#223421 ## Summary This PR makes little adjustments to [Importing Prebuilt Rules](elastic#223421) with missing base version test scenario implementation to make it matching test scenario steps. In particular it makes sure an installed prebuilt rule gets customized before testing import. (cherry picked from commit 10533eb)
…ersion tests matching the test scenario (elastic#234735) **Relates to:** elastic#223421 ## Summary This PR makes little adjustments to [Importing Prebuilt Rules](elastic#223421) with missing base version test scenario implementation to make it matching test scenario steps. In particular it makes sure an installed prebuilt rule gets customized before testing import. (cherry picked from commit 10533eb)
…ersion tests matching the test scenario (elastic#234735) **Relates to:** elastic#223421 ## Summary This PR makes little adjustments to [Importing Prebuilt Rules](elastic#223421) with missing base version test scenario implementation to make it matching test scenario steps. In particular it makes sure an installed prebuilt rule gets customized before testing import. (cherry picked from commit 10533eb)
…ersion tests matching the test scenario (elastic#234735) **Relates to:** elastic#223421 ## Summary This PR makes little adjustments to [Importing Prebuilt Rules](elastic#223421) with missing base version test scenario implementation to make it matching test scenario steps. In particular it makes sure an installed prebuilt rule gets customized before testing import. (cherry picked from commit 10533eb)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…base version tests matching the test scenario (#234735) (#235114) # Backport This will backport the following commits from `main` to `9.1`: - [[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)](#234735) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Maxim Palenov","email":"maxim.palenov@elastic.co"},"sourceCommit":{"committedDate":"2025-09-15T16:36:35Z","message":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)\n\n**Relates to:** https://github.com/elastic/kibana/pull/223421\n\n## Summary\n\nThis PR makes little adjustments to [Importing Prebuilt\nRules](#223421) with missing base\nversion test scenario implementation to make it matching test scenario\nsteps. In particular it makes sure an installed prebuilt rule gets\ncustomized before testing import.","sha":"10533ebfa440c6ac91166cc1d6d33b72d7102dc9","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","release_note:skip","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Prebuilt Detection Rules","backport:version","v9.2.0","v9.1.3","v8.19.3","v9.0.6","v8.18.7"],"title":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario","number":234735,"url":"https://github.com/elastic/kibana/pull/234735","mergeCommit":{"message":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)\n\n**Relates to:** https://github.com/elastic/kibana/pull/223421\n\n## Summary\n\nThis PR makes little adjustments to [Importing Prebuilt\nRules](#223421) with missing base\nversion test scenario implementation to make it matching test scenario\nsteps. In particular it makes sure an installed prebuilt rule gets\ncustomized before testing import.","sha":"10533ebfa440c6ac91166cc1d6d33b72d7102dc9"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19","9.0","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/234735","number":234735,"mergeCommit":{"message":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)\n\n**Relates to:** https://github.com/elastic/kibana/pull/223421\n\n## Summary\n\nThis PR makes little adjustments to [Importing Prebuilt\nRules](#223421) with missing base\nversion test scenario implementation to make it matching test scenario\nsteps. In particular it makes sure an installed prebuilt rule gets\ncustomized before testing import.","sha":"10533ebfa440c6ac91166cc1d6d33b72d7102dc9"}},{"branch":"9.1","label":"v9.1.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.7","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
… base version tests matching the test scenario (#234735) (#235112) # Backport This will backport the following commits from `main` to `8.19`: - [[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)](#234735) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Maxim Palenov","email":"maxim.palenov@elastic.co"},"sourceCommit":{"committedDate":"2025-09-15T16:36:35Z","message":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)\n\n**Relates to:** https://github.com/elastic/kibana/pull/223421\n\n## Summary\n\nThis PR makes little adjustments to [Importing Prebuilt\nRules](#223421) with missing base\nversion test scenario implementation to make it matching test scenario\nsteps. In particular it makes sure an installed prebuilt rule gets\ncustomized before testing import.","sha":"10533ebfa440c6ac91166cc1d6d33b72d7102dc9","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","release_note:skip","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Prebuilt Detection Rules","backport:version","v9.2.0","v9.1.3","v8.19.3","v9.0.6","v8.18.7"],"title":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario","number":234735,"url":"https://github.com/elastic/kibana/pull/234735","mergeCommit":{"message":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)\n\n**Relates to:** https://github.com/elastic/kibana/pull/223421\n\n## Summary\n\nThis PR makes little adjustments to [Importing Prebuilt\nRules](#223421) with missing base\nversion test scenario implementation to make it matching test scenario\nsteps. In particular it makes sure an installed prebuilt rule gets\ncustomized before testing import.","sha":"10533ebfa440c6ac91166cc1d6d33b72d7102dc9"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19","9.0","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/234735","number":234735,"mergeCommit":{"message":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)\n\n**Relates to:** https://github.com/elastic/kibana/pull/223421\n\n## Summary\n\nThis PR makes little adjustments to [Importing Prebuilt\nRules](#223421) with missing base\nversion test scenario implementation to make it matching test scenario\nsteps. In particular it makes sure an installed prebuilt rule gets\ncustomized before testing import.","sha":"10533ebfa440c6ac91166cc1d6d33b72d7102dc9"}},{"branch":"9.1","label":"v9.1.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.7","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
…base version tests matching the test scenario (#234735) (#235113) # Backport This will backport the following commits from `main` to `9.0`: - [[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)](#234735) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Maxim Palenov","email":"maxim.palenov@elastic.co"},"sourceCommit":{"committedDate":"2025-09-15T16:36:35Z","message":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)\n\n**Relates to:** https://github.com/elastic/kibana/pull/223421\n\n## Summary\n\nThis PR makes little adjustments to [Importing Prebuilt\nRules](#223421) with missing base\nversion test scenario implementation to make it matching test scenario\nsteps. In particular it makes sure an installed prebuilt rule gets\ncustomized before testing import.","sha":"10533ebfa440c6ac91166cc1d6d33b72d7102dc9","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","release_note:skip","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Prebuilt Detection Rules","backport:version","v9.2.0","v9.1.3","v8.19.3","v9.0.6","v8.18.7"],"title":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario","number":234735,"url":"https://github.com/elastic/kibana/pull/234735","mergeCommit":{"message":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)\n\n**Relates to:** https://github.com/elastic/kibana/pull/223421\n\n## Summary\n\nThis PR makes little adjustments to [Importing Prebuilt\nRules](#223421) with missing base\nversion test scenario implementation to make it matching test scenario\nsteps. In particular it makes sure an installed prebuilt rule gets\ncustomized before testing import.","sha":"10533ebfa440c6ac91166cc1d6d33b72d7102dc9"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19","9.0","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/234735","number":234735,"mergeCommit":{"message":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)\n\n**Relates to:** https://github.com/elastic/kibana/pull/223421\n\n## Summary\n\nThis PR makes little adjustments to [Importing Prebuilt\nRules](#223421) with missing base\nversion test scenario implementation to make it matching test scenario\nsteps. In particular it makes sure an installed prebuilt rule gets\ncustomized before testing import.","sha":"10533ebfa440c6ac91166cc1d6d33b72d7102dc9"}},{"branch":"9.1","label":"v9.1.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.7","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
…ersion tests matching the test scenario (elastic#234735) **Relates to:** elastic#223421 ## Summary This PR makes little adjustments to [Importing Prebuilt Rules](elastic#223421) with missing base version test scenario implementation to make it matching test scenario steps. In particular it makes sure an installed prebuilt rule gets customized before testing import. (cherry picked from commit 10533eb)
… base version tests matching the test scenario (#234735) (#235111) # Backport This will backport the following commits from `main` to `8.18`: - [[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)](#234735) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Maxim Palenov","email":"maxim.palenov@elastic.co"},"sourceCommit":{"committedDate":"2025-09-15T16:36:35Z","message":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)\n\n**Relates to:** https://github.com/elastic/kibana/pull/223421\n\n## Summary\n\nThis PR makes little adjustments to [Importing Prebuilt\nRules](#223421) with missing base\nversion test scenario implementation to make it matching test scenario\nsteps. In particular it makes sure an installed prebuilt rule gets\ncustomized before testing import.","sha":"10533ebfa440c6ac91166cc1d6d33b72d7102dc9","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","release_note:skip","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Prebuilt Detection Rules","backport:version","v9.2.0","v9.1.3","v8.19.3","v9.0.6","v8.18.7"],"title":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario","number":234735,"url":"https://github.com/elastic/kibana/pull/234735","mergeCommit":{"message":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)\n\n**Relates to:** https://github.com/elastic/kibana/pull/223421\n\n## Summary\n\nThis PR makes little adjustments to [Importing Prebuilt\nRules](#223421) with missing base\nversion test scenario implementation to make it matching test scenario\nsteps. In particular it makes sure an installed prebuilt rule gets\ncustomized before testing import.","sha":"10533ebfa440c6ac91166cc1d6d33b72d7102dc9"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19","9.0","8.18"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/234735","number":234735,"mergeCommit":{"message":"[Security Solution] Make importing prebuilt rules with missing base version tests matching the test scenario (#234735)\n\n**Relates to:** https://github.com/elastic/kibana/pull/223421\n\n## Summary\n\nThis PR makes little adjustments to [Importing Prebuilt\nRules](#223421) with missing base\nversion test scenario implementation to make it matching test scenario\nsteps. In particular it makes sure an installed prebuilt rule gets\ncustomized before testing import.","sha":"10533ebfa440c6ac91166cc1d6d33b72d7102dc9"}},{"branch":"9.1","label":"v9.1.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.7","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
…ersion tests matching the test scenario (elastic#234735) **Relates to:** elastic#223421 ## Summary This PR makes little adjustments to [Importing Prebuilt Rules](elastic#223421) with missing base version test scenario implementation to make it matching test scenario steps. In particular it makes sure an installed prebuilt rule gets customized before testing import.
…ersion tests matching the test scenario (#234735) **Relates to:** #223421 ## Summary This PR makes little adjustments to [Importing Prebuilt Rules](#223421) with missing base version test scenario implementation to make it matching test scenario steps. In particular it makes sure an installed prebuilt rule gets customized before testing import.
Relates to: #223421
Summary
This PR makes little adjustments to Importing Prebuilt Rules with missing base version test scenario implementation to make it matching test scenario steps. In particular it makes sure an installed prebuilt rule gets customized before testing import.