[Security Solution] Rectify prebuilt rules export test plan#222796
[Security Solution] Rectify prebuilt rules export test plan#222796maximpn merged 3 commits intoelastic:mainfrom
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) |
💚 Build Succeeded
cc @maximpn |
f253a85 to
24c7178
Compare
nikitaindik
left a comment
There was a problem hiding this comment.
Thanks for refactoring this, @maximpn! I've reviewed and left a few questions.
| - [Scenarios](#scenarios) | ||
| - [Core Functionality](#core-functionality) | ||
| - [Scenario: Exporting prebuilt rule individually from rule details page](#scenario-exporting-prebuilt-rule-individually-from-rule-details-page) | ||
| - [Scenario: Exporting custom rule individually from rule details page](#scenario-exporting-custom-rule-individually-from-rule-details-page) |
There was a problem hiding this comment.
Are custom rules related scenarios removed now? I can't find them in other test plans. If yes, what do you think about creating a custom_rule_export.md with these?
There was a problem hiding this comment.
Right. It looks kind of strange to have test scenarios purely for custom rules while these test scenarios should be concerned by prebuilt rules. We have separate tests for custom rules import. I'll move removed test scenarios to a separate plan.
| And the custom rules' "ruleSource" "type" should be "internal" | ||
| And the customized prebuilt rules' "isCustomized" value should be true | ||
| And the exported prebuilt rules should include an "immutable" field having true value | ||
| And the exported prebuilt rules "ruleSource.type" should be "external" |
There was a problem hiding this comment.
Let's make "ruleSource" -> "rule_source" to match other scenarios
|
|
||
| ### Licensing | ||
|
|
||
| #### Scenario: Exporting a mixture of prebuilt and custom rules via export API under insufficient license** |
There was a problem hiding this comment.
Why remove this? Don't we want to cover the exports API specifically?
There was a problem hiding this comment.
Please check Useful information section. I made a note that described test scenarios are expected to work under both low- and high-tier licenses. It looks sufficient to run the tests in prebuilt_rules/common folder under low-tier license with the assumption it works under high-tier licensees as well. Though we might have to test under different licenses. Please check out prebuilt rules import test plan implementation PR for more details.
This is also one important thing to note regarding low-tier license and Prebuilt Rules Customization for tests setup. Despite the licensing our public CRUD APIs allow to customize prebuilt rules. Since we can't break the public API's behavior this fact is used in the tests implementation.
| ### Error Handling | ||
|
|
||
| #### Scenario: Exporting beyond the export limit | ||
| #### **Scenario: Exporting beyond the export limit** |
There was a problem hiding this comment.
Do you think this should be more specific, like whether it's in UI or via bulk API / exports API?
There was a problem hiding this comment.
Technically it should be all of them. You may see Automation is missing here. So I'll specify it there.
Anyway I wasn't able to implement this test scenario in this PR as it described in the PR description. Since it has less impact I'd have a look at this later on.
24c7178 to
280eed7
Compare
|
@nikitaindik Thank you for reviewing my PR 🙏 I've addressed your comments. Could you have a look? |
nikitaindik
left a comment
There was a problem hiding this comment.
Thanks for addressing my comments! 👍 Let's merge!
|
Starting backport for target branches: 8.19 |
…222796) **Addresses:** elastic#202079 ## Summary This PR aligns prebuilt rules export test plan with the rest test plans. It doesn't include functional changes. (cherry picked from commit a3e4c2e)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…222796) (#225025) # Backport This will backport the following commits from `main` to `8.19`: - [[Security Solution] Rectify prebuilt rules export test plan (#222796)](#222796) <!--- 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-06-24T08:58:08Z","message":"[Security Solution] Rectify prebuilt rules export test plan (#222796)\n\n**Addresses:** https://github.com/elastic/kibana/issues/202079\n\n## Summary\n\nThis PR aligns prebuilt rules export test plan with the rest test plans. It doesn't include functional changes.","sha":"a3e4c2e770bf551a52525e37d65fa84774d924b0","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","test-plan","Team:Detections and Resp","Team: SecuritySolution","Team:Detection Rule Management","Feature:Prebuilt Detection Rules","backport:version","v9.1.0","v8.19.0"],"title":"[Security Solution] Rectify prebuilt rules export test plan","number":222796,"url":"https://github.com/elastic/kibana/pull/222796","mergeCommit":{"message":"[Security Solution] Rectify prebuilt rules export test plan (#222796)\n\n**Addresses:** https://github.com/elastic/kibana/issues/202079\n\n## Summary\n\nThis PR aligns prebuilt rules export test plan with the rest test plans. It doesn't include functional changes.","sha":"a3e4c2e770bf551a52525e37d65fa84774d924b0"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/222796","number":222796,"mergeCommit":{"message":"[Security Solution] Rectify prebuilt rules export test plan (#222796)\n\n**Addresses:** https://github.com/elastic/kibana/issues/202079\n\n## Summary\n\nThis PR aligns prebuilt rules export test plan with the rest test plans. It doesn't include functional changes.","sha":"a3e4c2e770bf551a52525e37d65fa84774d924b0"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
…222796) **Addresses:** elastic#202079 ## Summary This PR aligns prebuilt rules export test plan with the rest test plans. It doesn't include functional changes.
**Addresses:** #202079 **Relates to:** #222796 ## Summary This PR implements Prebuilt Rules export [test plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_export.md). Existing tests were adjusted and extended to match the test plan. ## Caveats The test plan describes a scenario to verify prebuilt rules export fails for 10K+ rules but this scenario is tricky to implement. Due to ES limitations on filtering more than 10K the majority of utility functions like `deleteAllRules()` fail. The proper implementation requires proper setup and cleanup to make sure the test doesn't block the testing workflow. As the result of the mentioned complexities implementation of the test scenario for 10K+ rules is skipped in this PR.
…c#224611) **Addresses:** elastic#202079 **Relates to:** elastic#222796 ## Summary This PR implements Prebuilt Rules export [test plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_export.md). Existing tests were adjusted and extended to match the test plan. ## Caveats The test plan describes a scenario to verify prebuilt rules export fails for 10K+ rules but this scenario is tricky to implement. Due to ES limitations on filtering more than 10K the majority of utility functions like `deleteAllRules()` fail. The proper implementation requires proper setup and cleanup to make sure the test doesn't block the testing workflow. As the result of the mentioned complexities implementation of the test scenario for 10K+ rules is skipped in this PR. (cherry picked from commit 6120cae)
…c#224611) **Addresses:** elastic#202079 **Relates to:** elastic#222796 ## Summary This PR implements Prebuilt Rules export [test plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_export.md). Existing tests were adjusted and extended to match the test plan. ## Caveats The test plan describes a scenario to verify prebuilt rules export fails for 10K+ rules but this scenario is tricky to implement. Due to ES limitations on filtering more than 10K the majority of utility functions like `deleteAllRules()` fail. The proper implementation requires proper setup and cleanup to make sure the test doesn't block the testing workflow. As the result of the mentioned complexities implementation of the test scenario for 10K+ rules is skipped in this PR. (cherry picked from commit 6120cae)
…c#224611) **Addresses:** elastic#202079 **Relates to:** elastic#222796 ## Summary This PR implements Prebuilt Rules export [test plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_export.md). Existing tests were adjusted and extended to match the test plan. ## Caveats The test plan describes a scenario to verify prebuilt rules export fails for 10K+ rules but this scenario is tricky to implement. Due to ES limitations on filtering more than 10K the majority of utility functions like `deleteAllRules()` fail. The proper implementation requires proper setup and cleanup to make sure the test doesn't block the testing workflow. As the result of the mentioned complexities implementation of the test scenario for 10K+ rules is skipped in this PR. (cherry picked from commit 6120cae) # Conflicts: # x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_export.md # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/configs/ess_air_gapped.config.ts # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/index.ts # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/index.ts
…c#224611) **Addresses:** elastic#202079 **Relates to:** elastic#222796 ## Summary This PR implements Prebuilt Rules export [test plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_export.md). Existing tests were adjusted and extended to match the test plan. ## Caveats The test plan describes a scenario to verify prebuilt rules export fails for 10K+ rules but this scenario is tricky to implement. Due to ES limitations on filtering more than 10K the majority of utility functions like `deleteAllRules()` fail. The proper implementation requires proper setup and cleanup to make sure the test doesn't block the testing workflow. As the result of the mentioned complexities implementation of the test scenario for 10K+ rules is skipped in this PR. (cherry picked from commit 6120cae) # Conflicts: # x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_export.md
…c#224611) **Addresses:** elastic#202079 **Relates to:** elastic#222796 ## Summary This PR implements Prebuilt Rules export [test plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_export.md). Existing tests were adjusted and extended to match the test plan. ## Caveats The test plan describes a scenario to verify prebuilt rules export fails for 10K+ rules but this scenario is tricky to implement. Due to ES limitations on filtering more than 10K the majority of utility functions like `deleteAllRules()` fail. The proper implementation requires proper setup and cleanup to make sure the test doesn't block the testing workflow. As the result of the mentioned complexities implementation of the test scenario for 10K+ rules is skipped in this PR. (cherry picked from commit 6120cae) # Conflicts: # x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_export.md
…c#224611) **Addresses:** elastic#202079 **Relates to:** elastic#222796 ## Summary This PR implements Prebuilt Rules export [test plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_export.md). Existing tests were adjusted and extended to match the test plan. ## Caveats The test plan describes a scenario to verify prebuilt rules export fails for 10K+ rules but this scenario is tricky to implement. Due to ES limitations on filtering more than 10K the majority of utility functions like `deleteAllRules()` fail. The proper implementation requires proper setup and cleanup to make sure the test doesn't block the testing workflow. As the result of the mentioned complexities implementation of the test scenario for 10K+ rules is skipped in this PR.
|
Backports to |
…c#224611) **Addresses:** elastic#202079 **Relates to:** elastic#222796 ## Summary This PR implements Prebuilt Rules export [test plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_export.md). Existing tests were adjusted and extended to match the test plan. ## Caveats The test plan describes a scenario to verify prebuilt rules export fails for 10K+ rules but this scenario is tricky to implement. Due to ES limitations on filtering more than 10K the majority of utility functions like `deleteAllRules()` fail. The proper implementation requires proper setup and cleanup to make sure the test doesn't block the testing workflow. As the result of the mentioned complexities implementation of the test scenario for 10K+ rules is skipped in this PR.
Addresses: #202079
Summary
This PR aligns prebuilt rules export test plan with the rest test plans. It doesn't include functional changes.