[Security Solution] Refactor prebuilt rules integration tests#219831
[Security Solution] Refactor prebuilt rules integration tests#219831maximpn merged 15 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
|
Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management) |
|
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
cb2e177 to
c16de20
Compare
bd68e05 to
7e17aad
Compare
| it('installs prebuilt rules', async () => { | ||
| await createPrebuiltRuleAssetSavedObjects(es, getRuleAssetSavedObjects()); | ||
| const body = await installPrebuiltRules(es, supertest); | ||
|
|
||
| expect(body.summary.succeeded).toBe(RULES_COUNT); | ||
| expect(body.summary.failed).toBe(0); | ||
| expect(body.summary.skipped).toBe(0); | ||
| }); | ||
|
|
||
| it('installs correct prebuilt rule versions', async () => { | ||
| await createPrebuiltRuleAssetSavedObjects(es, getRuleAssetSavedObjects()); | ||
| const body = await installPrebuiltRules(es, supertest); | ||
|
|
||
| // Check that all prebuilt rules were actually installed and their versions match the latest | ||
| expect(body.results.created).toEqual( | ||
| expect.arrayContaining([ | ||
| expect.objectContaining({ rule_id: 'rule-1', version: 1 }), | ||
| expect.objectContaining({ rule_id: 'rule-2', version: 2 }), | ||
| expect.objectContaining({ rule_id: 'rule-3', version: 3 }), | ||
| expect.objectContaining({ rule_id: 'rule-4', version: 4 }), | ||
| ]) | ||
| ); | ||
| }); |
There was a problem hiding this comment.
Are these checks worth two separate tests?
There was a problem hiding this comment.
Could you elaborate on the question? Do you mean separate test suites?
There was a problem hiding this comment.
Meaning these two tests (installs rules/installs correct rules) do the same operation and then just check different items on the same response body. Wouldn't one test checking all of these lead to the same results?
There was a problem hiding this comment.
Indeed. But I didn't have a goal to rectify all tests as part of this PR. It just merged existing and scattered tests together. In the next PRs test suites will be rectified. And it will be addressed by sub domains.
There was a problem hiding this comment.
Why is this file needed? Can we not do this from the main .eslintignore file?
There was a problem hiding this comment.
It was a leftover after tossing files around. It doesn't ignore any files and has been removed.
| await deleteAllPrebuiltRuleAssets(es, log); | ||
| }); | ||
|
|
||
| describe('w/ historical versions', () => { |
There was a problem hiding this comment.
I think it's better to leave these as with/without for people who don't know the shorthand
| }); | ||
|
|
||
| describe('without historical versions', () => { | ||
| describe('w/o historical versions', () => { |
| await deleteAllPrebuiltRuleAssets(es, log); | ||
| }); | ||
|
|
||
| describe('w/ historical versions', () => { |
There was a problem hiding this comment.
Same as above, prefer with/without
| }; | ||
|
|
||
| describe('@ess @serverless @skipInServerlessMKI preview prebuilt rules upgrade', () => { | ||
| describe('@ess @serverless @skipInServerlessMKI review prebuilt rules upgrade', () => { |
There was a problem hiding this comment.
If we're renaming this to review prebuilt rules upgrade, do you also want to change this file name?
There was a problem hiding this comment.
Yes, it makes sense
…n folder (elastic#225495) **Relates to:** elastic#219831 ## Summary This PR moves prebuilt rules license independent integration tests to the `prebuilt_rules/common` folder. (cherry picked from commit 55e3292)
…n folder (elastic#225495) **Relates to:** elastic#219831 ## Summary This PR moves prebuilt rules license independent integration tests to the `prebuilt_rules/common` folder. (cherry picked from commit 55e3292)
…n folder (elastic#225495) **Relates to:** elastic#219831 ## Summary This PR moves prebuilt rules license independent integration tests to the `prebuilt_rules/common` folder. (cherry picked from commit 55e3292) # Conflicts: # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/install_prebuilt_rules/install_mocked_prebuilt_rule_assets.ts # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/revert_prebuilt_rules/revert_prebuilt_rules.ts
…c#219831) **Related Epic:** elastic#179907 ## Summary This PR refactors prebuilt rules integration tests structure to streamline the implementation of test plans targeted [Prebuilt Rules Customization Milestone 4](elastic#179907). ## Details Existing integration tests structure have prebuilt rules related integration tests scattered around rules management area. Due to historical reasons and pace of the prebuilt rules customization development some old tests were updated, some new were added as random spots as well as some new tests structure was suggested. This PR moves files and some tests around to the following structure - `test_suites/detection_response/rules_management/prebuilt_rules` is the root folder for prebuilt rules related integration tests - `customization_disabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **insufficient** for customization license level (basic/essentials) - `customization_enabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **sufficient** for customization license level - `customization_disabled` and `customization_enabled` subfoldera have test suites grouped by sub domains - `prebuilt_rules_package` - contains integration tests related to detection rules Fleet package installation and updating, bootstrap is also belong to here - `install_prebuilt_rules` - contains tests related to prebuilt rules installation from prebuilt rule assets - `upgrade_prebuilt_rules` - contains tests related to prebuilt rules upgrade workflow - `customization` - contains tests related to prebuilt rules customization including `is_customized` calculation - `import_export` - contains tests related to exporting and importing customized and non-customized prebuilt rules - `status` - contain status endpoints related tests (cherry picked from commit 3ea69af) # Conflicts: # .buildkite/ftr_security_serverless_configs.yml # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/index.ts # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/customization_enabled/is_customized_calculation.ts
…c#219831) **Related Epic:** elastic#179907 ## Summary This PR refactors prebuilt rules integration tests structure to streamline the implementation of test plans targeted [Prebuilt Rules Customization Milestone 4](elastic#179907). ## Details Existing integration tests structure have prebuilt rules related integration tests scattered around rules management area. Due to historical reasons and pace of the prebuilt rules customization development some old tests were updated, some new were added as random spots as well as some new tests structure was suggested. This PR moves files and some tests around to the following structure - `test_suites/detection_response/rules_management/prebuilt_rules` is the root folder for prebuilt rules related integration tests - `customization_disabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **insufficient** for customization license level (basic/essentials) - `customization_enabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **sufficient** for customization license level - `customization_disabled` and `customization_enabled` subfoldera have test suites grouped by sub domains - `prebuilt_rules_package` - contains integration tests related to detection rules Fleet package installation and updating, bootstrap is also belong to here - `install_prebuilt_rules` - contains tests related to prebuilt rules installation from prebuilt rule assets - `upgrade_prebuilt_rules` - contains tests related to prebuilt rules upgrade workflow - `customization` - contains tests related to prebuilt rules customization including `is_customized` calculation - `import_export` - contains tests related to exporting and importing customized and non-customized prebuilt rules - `status` - contain status endpoints related tests (cherry picked from commit 3ea69af) # Conflicts: # .buildkite/ftr_security_serverless_configs.yml # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/prebuilt_rules_package/index.ts # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/prebuilt_rule_customization/customization_enabled/is_customized_calculation.ts
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…219831) (#226383) # Backport This will backport the following commits from `main` to `9.0`: - [[Security Solution] Refactor prebuilt rules integration tests (#219831)](#219831) <!--- Backport version: 10.0.1 --> ### 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-05-30T10:23:45Z","message":"[Security Solution] Refactor prebuilt rules integration tests (#219831)\n\n**Related Epic:** https://github.com/elastic/kibana/issues/179907\n\n## Summary\n\nThis PR refactors prebuilt rules integration tests structure to streamline the implementation of test plans targeted [Prebuilt Rules Customization Milestone 4](https://github.com/elastic/kibana/issues/179907).\n\n## Details\n\nExisting integration tests structure have prebuilt rules related integration tests scattered around rules management area. Due to historical reasons and pace of the prebuilt rules customization development some old tests were updated, some new were added as random spots as well as some new tests structure was suggested.\n\nThis PR moves files and some tests around to the following structure\n\n- `test_suites/detection_response/rules_management/prebuilt_rules` is the root folder for prebuilt rules related integration tests\n- `customization_disabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **insufficient** for customization license level (basic/essentials)\n- `customization_enabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **sufficient** for customization license level\n- `customization_disabled` and `customization_enabled` subfoldera have test suites grouped by sub domains\n - `prebuilt_rules_package` - contains integration tests related to detection rules Fleet package installation and updating, bootstrap is also belong to here\n - `install_prebuilt_rules` - contains tests related to prebuilt rules installation from prebuilt rule assets\n - `upgrade_prebuilt_rules` - contains tests related to prebuilt rules upgrade workflow\n - `customization` - contains tests related to prebuilt rules customization including `is_customized` calculation\n - `import_export` - contains tests related to exporting and importing customized and non-customized prebuilt rules\n - `status` - contain status endpoints related tests","sha":"3ea69afa83b692e5d82a0a7bb6d8cd0be014022c","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","refactoring","release_note:skip","impact:high","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] Refactor prebuilt rules integration tests","number":219831,"url":"https://github.com/elastic/kibana/pull/219831","mergeCommit":{"message":"[Security Solution] Refactor prebuilt rules integration tests (#219831)\n\n**Related Epic:** https://github.com/elastic/kibana/issues/179907\n\n## Summary\n\nThis PR refactors prebuilt rules integration tests structure to streamline the implementation of test plans targeted [Prebuilt Rules Customization Milestone 4](https://github.com/elastic/kibana/issues/179907).\n\n## Details\n\nExisting integration tests structure have prebuilt rules related integration tests scattered around rules management area. Due to historical reasons and pace of the prebuilt rules customization development some old tests were updated, some new were added as random spots as well as some new tests structure was suggested.\n\nThis PR moves files and some tests around to the following structure\n\n- `test_suites/detection_response/rules_management/prebuilt_rules` is the root folder for prebuilt rules related integration tests\n- `customization_disabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **insufficient** for customization license level (basic/essentials)\n- `customization_enabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **sufficient** for customization license level\n- `customization_disabled` and `customization_enabled` subfoldera have test suites grouped by sub domains\n - `prebuilt_rules_package` - contains integration tests related to detection rules Fleet package installation and updating, bootstrap is also belong to here\n - `install_prebuilt_rules` - contains tests related to prebuilt rules installation from prebuilt rule assets\n - `upgrade_prebuilt_rules` - contains tests related to prebuilt rules upgrade workflow\n - `customization` - contains tests related to prebuilt rules customization including `is_customized` calculation\n - `import_export` - contains tests related to exporting and importing customized and non-customized prebuilt rules\n - `status` - contain status endpoints related tests","sha":"3ea69afa83b692e5d82a0a7bb6d8cd0be014022c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219831","number":219831,"mergeCommit":{"message":"[Security Solution] Refactor prebuilt rules integration tests (#219831)\n\n**Related Epic:** https://github.com/elastic/kibana/issues/179907\n\n## Summary\n\nThis PR refactors prebuilt rules integration tests structure to streamline the implementation of test plans targeted [Prebuilt Rules Customization Milestone 4](https://github.com/elastic/kibana/issues/179907).\n\n## Details\n\nExisting integration tests structure have prebuilt rules related integration tests scattered around rules management area. Due to historical reasons and pace of the prebuilt rules customization development some old tests were updated, some new were added as random spots as well as some new tests structure was suggested.\n\nThis PR moves files and some tests around to the following structure\n\n- `test_suites/detection_response/rules_management/prebuilt_rules` is the root folder for prebuilt rules related integration tests\n- `customization_disabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **insufficient** for customization license level (basic/essentials)\n- `customization_enabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **sufficient** for customization license level\n- `customization_disabled` and `customization_enabled` subfoldera have test suites grouped by sub domains\n - `prebuilt_rules_package` - contains integration tests related to detection rules Fleet package installation and updating, bootstrap is also belong to here\n - `install_prebuilt_rules` - contains tests related to prebuilt rules installation from prebuilt rule assets\n - `upgrade_prebuilt_rules` - contains tests related to prebuilt rules upgrade workflow\n - `customization` - contains tests related to prebuilt rules customization including `is_customized` calculation\n - `import_export` - contains tests related to exporting and importing customized and non-customized prebuilt rules\n - `status` - contain status endpoints related tests","sha":"3ea69afa83b692e5d82a0a7bb6d8cd0be014022c"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/222052","number":222052,"state":"MERGED","mergeCommit":{"sha":"a5e16606a45a62c0064d4f8d796277e0b3457e28","message":"[8.19] [Security Solution] Refactor prebuilt rules integration tests (#219831) (#222052)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.19`:\n- [[Security Solution] Refactor prebuilt rules integration tests\n(#219831)](https://github.com/elastic/kibana/pull/219831)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n"}}]}] BACKPORT-->
…219831) (#226385) # Backport This will backport the following commits from `main` to `8.18`: - [[Security Solution] Refactor prebuilt rules integration tests (#219831)](#219831) <!--- Backport version: 10.0.1 --> ### 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-05-30T10:23:45Z","message":"[Security Solution] Refactor prebuilt rules integration tests (#219831)\n\n**Related Epic:** https://github.com/elastic/kibana/issues/179907\n\n## Summary\n\nThis PR refactors prebuilt rules integration tests structure to streamline the implementation of test plans targeted [Prebuilt Rules Customization Milestone 4](https://github.com/elastic/kibana/issues/179907).\n\n## Details\n\nExisting integration tests structure have prebuilt rules related integration tests scattered around rules management area. Due to historical reasons and pace of the prebuilt rules customization development some old tests were updated, some new were added as random spots as well as some new tests structure was suggested.\n\nThis PR moves files and some tests around to the following structure\n\n- `test_suites/detection_response/rules_management/prebuilt_rules` is the root folder for prebuilt rules related integration tests\n- `customization_disabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **insufficient** for customization license level (basic/essentials)\n- `customization_enabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **sufficient** for customization license level\n- `customization_disabled` and `customization_enabled` subfoldera have test suites grouped by sub domains\n - `prebuilt_rules_package` - contains integration tests related to detection rules Fleet package installation and updating, bootstrap is also belong to here\n - `install_prebuilt_rules` - contains tests related to prebuilt rules installation from prebuilt rule assets\n - `upgrade_prebuilt_rules` - contains tests related to prebuilt rules upgrade workflow\n - `customization` - contains tests related to prebuilt rules customization including `is_customized` calculation\n - `import_export` - contains tests related to exporting and importing customized and non-customized prebuilt rules\n - `status` - contain status endpoints related tests","sha":"3ea69afa83b692e5d82a0a7bb6d8cd0be014022c","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","refactoring","release_note:skip","impact:high","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] Refactor prebuilt rules integration tests","number":219831,"url":"https://github.com/elastic/kibana/pull/219831","mergeCommit":{"message":"[Security Solution] Refactor prebuilt rules integration tests (#219831)\n\n**Related Epic:** https://github.com/elastic/kibana/issues/179907\n\n## Summary\n\nThis PR refactors prebuilt rules integration tests structure to streamline the implementation of test plans targeted [Prebuilt Rules Customization Milestone 4](https://github.com/elastic/kibana/issues/179907).\n\n## Details\n\nExisting integration tests structure have prebuilt rules related integration tests scattered around rules management area. Due to historical reasons and pace of the prebuilt rules customization development some old tests were updated, some new were added as random spots as well as some new tests structure was suggested.\n\nThis PR moves files and some tests around to the following structure\n\n- `test_suites/detection_response/rules_management/prebuilt_rules` is the root folder for prebuilt rules related integration tests\n- `customization_disabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **insufficient** for customization license level (basic/essentials)\n- `customization_enabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **sufficient** for customization license level\n- `customization_disabled` and `customization_enabled` subfoldera have test suites grouped by sub domains\n - `prebuilt_rules_package` - contains integration tests related to detection rules Fleet package installation and updating, bootstrap is also belong to here\n - `install_prebuilt_rules` - contains tests related to prebuilt rules installation from prebuilt rule assets\n - `upgrade_prebuilt_rules` - contains tests related to prebuilt rules upgrade workflow\n - `customization` - contains tests related to prebuilt rules customization including `is_customized` calculation\n - `import_export` - contains tests related to exporting and importing customized and non-customized prebuilt rules\n - `status` - contain status endpoints related tests","sha":"3ea69afa83b692e5d82a0a7bb6d8cd0be014022c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219831","number":219831,"mergeCommit":{"message":"[Security Solution] Refactor prebuilt rules integration tests (#219831)\n\n**Related Epic:** https://github.com/elastic/kibana/issues/179907\n\n## Summary\n\nThis PR refactors prebuilt rules integration tests structure to streamline the implementation of test plans targeted [Prebuilt Rules Customization Milestone 4](https://github.com/elastic/kibana/issues/179907).\n\n## Details\n\nExisting integration tests structure have prebuilt rules related integration tests scattered around rules management area. Due to historical reasons and pace of the prebuilt rules customization development some old tests were updated, some new were added as random spots as well as some new tests structure was suggested.\n\nThis PR moves files and some tests around to the following structure\n\n- `test_suites/detection_response/rules_management/prebuilt_rules` is the root folder for prebuilt rules related integration tests\n- `customization_disabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **insufficient** for customization license level (basic/essentials)\n- `customization_enabled` subfolder contains prebuilt rules integration tests covering scenarios when users have **sufficient** for customization license level\n- `customization_disabled` and `customization_enabled` subfoldera have test suites grouped by sub domains\n - `prebuilt_rules_package` - contains integration tests related to detection rules Fleet package installation and updating, bootstrap is also belong to here\n - `install_prebuilt_rules` - contains tests related to prebuilt rules installation from prebuilt rule assets\n - `upgrade_prebuilt_rules` - contains tests related to prebuilt rules upgrade workflow\n - `customization` - contains tests related to prebuilt rules customization including `is_customized` calculation\n - `import_export` - contains tests related to exporting and importing customized and non-customized prebuilt rules\n - `status` - contain status endpoints related tests","sha":"3ea69afa83b692e5d82a0a7bb6d8cd0be014022c"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/222052","number":222052,"state":"MERGED","mergeCommit":{"sha":"a5e16606a45a62c0064d4f8d796277e0b3457e28","message":"[8.19] [Security Solution] Refactor prebuilt rules integration tests (#219831) (#222052)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.19`:\n- [[Security Solution] Refactor prebuilt rules integration tests\n(#219831)](https://github.com/elastic/kibana/pull/219831)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n"}}]}] BACKPORT-->
|
Starting backport for target branches: 8.19, 9.0, 9.1 https://github.com/elastic/kibana/actions/runs/16052870896 |
|
Starting backport for target branches: 8.19, 9.0, 9.1 https://github.com/elastic/kibana/actions/runs/16052877320 |
|
Starting backport for target branches: 8.18, 8.19, 9.0, 9.1 https://github.com/elastic/kibana/actions/runs/16052878744 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
1 similar comment
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
**Relates to:** elastic#219831 ## Summary This PR fixes MKI tests configuration for prebuilt rules after performing refactoring in elastic#219831. Since shorthand script in `x-pack/test/security_solution_api_integration/package.json` are used only for running MKI tests and local development it didn't cause PR pipeline failures and became prominent after running MKI tests. ## Pipelines [Kibana / Serverless / Security Solution Quality Gate / Rule Management](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management) pipeline was manually ran against this PR. - ✅ [Periodic pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786) - ✅ [Quality gate pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786) (cherry picked from commit d853886)
**Relates to:** elastic#219831 ## Summary This PR fixes MKI tests configuration for prebuilt rules after performing refactoring in elastic#219831. Since shorthand script in `x-pack/test/security_solution_api_integration/package.json` are used only for running MKI tests and local development it didn't cause PR pipeline failures and became prominent after running MKI tests. ## Pipelines [Kibana / Serverless / Security Solution Quality Gate / Rule Management](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management) pipeline was manually ran against this PR. - ✅ [Periodic pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786) - ✅ [Quality gate pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786) (cherry picked from commit d853886)
…226501) # Backport This will backport the following commits from `main` to `9.0`: - [[Security Solution] Fix MKI tests for prebuilt rules (#222170)](#222170) <!--- Backport version: 10.0.0 --> ### 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-02T14:16:42Z","message":"[Security Solution] Fix MKI tests for prebuilt rules (#222170)\n\n**Relates to:** https://github.com/elastic/kibana/pull/219831\n\n## Summary\n\nThis PR fixes MKI tests configuration for prebuilt rules after performing refactoring in #219831. Since shorthand script in `x-pack/test/security_solution_api_integration/package.json` are used only for running MKI tests and local development it didn't cause PR pipeline failures and became prominent after running MKI tests. \n\n## Pipelines\n\n[Kibana / Serverless / Security Solution Quality Gate / Rule Management](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management) pipeline was manually ran against this PR.\n\n- ✅ [Periodic pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786)\n- ✅ [Quality gate pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786)","sha":"d8538862505c7a7d2f4d6024e479b5ea88b5ddbd","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","test","release_note:skip","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] Fix MKI tests for prebuilt rules","number":222170,"url":"https://github.com/elastic/kibana/pull/222170","mergeCommit":{"message":"[Security Solution] Fix MKI tests for prebuilt rules (#222170)\n\n**Relates to:** https://github.com/elastic/kibana/pull/219831\n\n## Summary\n\nThis PR fixes MKI tests configuration for prebuilt rules after performing refactoring in #219831. Since shorthand script in `x-pack/test/security_solution_api_integration/package.json` are used only for running MKI tests and local development it didn't cause PR pipeline failures and became prominent after running MKI tests. \n\n## Pipelines\n\n[Kibana / Serverless / Security Solution Quality Gate / Rule Management](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management) pipeline was manually ran against this PR.\n\n- ✅ [Periodic pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786)\n- ✅ [Quality gate pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786)","sha":"d8538862505c7a7d2f4d6024e479b5ea88b5ddbd"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/222170","number":222170,"mergeCommit":{"message":"[Security Solution] Fix MKI tests for prebuilt rules (#222170)\n\n**Relates to:** https://github.com/elastic/kibana/pull/219831\n\n## Summary\n\nThis PR fixes MKI tests configuration for prebuilt rules after performing refactoring in #219831. Since shorthand script in `x-pack/test/security_solution_api_integration/package.json` are used only for running MKI tests and local development it didn't cause PR pipeline failures and became prominent after running MKI tests. \n\n## Pipelines\n\n[Kibana / Serverless / Security Solution Quality Gate / Rule Management](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management) pipeline was manually ran against this PR.\n\n- ✅ [Periodic pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786)\n- ✅ [Quality gate pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786)","sha":"d8538862505c7a7d2f4d6024e479b5ea88b5ddbd"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/222221","number":222221,"state":"MERGED","mergeCommit":{"sha":"ed7df7c000f37c15f137eb99df42d9ccbc76a515","message":"[8.19] [Security Solution] Fix MKI tests for prebuilt rules (#222170) (#222221)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.19`:\n- [[Security Solution] Fix MKI tests for prebuilt rules\n(#222170)](https://github.com/elastic/kibana/pull/222170)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Maxim Palenov <maxim.palenov@elastic.co>"}}]}] BACKPORT-->
…#226502) # Backport This will backport the following commits from `main` to `8.18`: - [[Security Solution] Fix MKI tests for prebuilt rules (#222170)](#222170) <!--- Backport version: 10.0.0 --> ### 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-02T14:16:42Z","message":"[Security Solution] Fix MKI tests for prebuilt rules (#222170)\n\n**Relates to:** https://github.com/elastic/kibana/pull/219831\n\n## Summary\n\nThis PR fixes MKI tests configuration for prebuilt rules after performing refactoring in #219831. Since shorthand script in `x-pack/test/security_solution_api_integration/package.json` are used only for running MKI tests and local development it didn't cause PR pipeline failures and became prominent after running MKI tests. \n\n## Pipelines\n\n[Kibana / Serverless / Security Solution Quality Gate / Rule Management](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management) pipeline was manually ran against this PR.\n\n- ✅ [Periodic pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786)\n- ✅ [Quality gate pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786)","sha":"d8538862505c7a7d2f4d6024e479b5ea88b5ddbd","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","test","release_note:skip","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] Fix MKI tests for prebuilt rules","number":222170,"url":"https://github.com/elastic/kibana/pull/222170","mergeCommit":{"message":"[Security Solution] Fix MKI tests for prebuilt rules (#222170)\n\n**Relates to:** https://github.com/elastic/kibana/pull/219831\n\n## Summary\n\nThis PR fixes MKI tests configuration for prebuilt rules after performing refactoring in #219831. Since shorthand script in `x-pack/test/security_solution_api_integration/package.json` are used only for running MKI tests and local development it didn't cause PR pipeline failures and became prominent after running MKI tests. \n\n## Pipelines\n\n[Kibana / Serverless / Security Solution Quality Gate / Rule Management](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management) pipeline was manually ran against this PR.\n\n- ✅ [Periodic pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786)\n- ✅ [Quality gate pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786)","sha":"d8538862505c7a7d2f4d6024e479b5ea88b5ddbd"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/222170","number":222170,"mergeCommit":{"message":"[Security Solution] Fix MKI tests for prebuilt rules (#222170)\n\n**Relates to:** https://github.com/elastic/kibana/pull/219831\n\n## Summary\n\nThis PR fixes MKI tests configuration for prebuilt rules after performing refactoring in #219831. Since shorthand script in `x-pack/test/security_solution_api_integration/package.json` are used only for running MKI tests and local development it didn't cause PR pipeline failures and became prominent after running MKI tests. \n\n## Pipelines\n\n[Kibana / Serverless / Security Solution Quality Gate / Rule Management](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management) pipeline was manually ran against this PR.\n\n- ✅ [Periodic pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786)\n- ✅ [Quality gate pipeline](https://buildkite.com/elastic/kibana-serverless-security-solution-quality-gate-rule-management/builds/2786)","sha":"d8538862505c7a7d2f4d6024e479b5ea88b5ddbd"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/222221","number":222221,"state":"MERGED","mergeCommit":{"sha":"ed7df7c000f37c15f137eb99df42d9ccbc76a515","message":"[8.19] [Security Solution] Fix MKI tests for prebuilt rules (#222170) (#222221)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.19`:\n- [[Security Solution] Fix MKI tests for prebuilt rules\n(#222170)](https://github.com/elastic/kibana/pull/222170)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Maxim Palenov <maxim.palenov@elastic.co>"}}]}] BACKPORT-->
…n folder (elastic#225495) **Relates to:** elastic#219831 ## Summary This PR moves prebuilt rules license independent integration tests to the `prebuilt_rules/common` folder. (cherry picked from commit 55e3292) # Conflicts: # .buildkite/ftr_security_stateful_configs.yml # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/revert_prebuilt_rules/get_prebuilt_rule_base_version.ts # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/revert_prebuilt_rules/index.ts # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/revert_prebuilt_rules/revert_prebuilt_rules.ts # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/revert_prebuilt_rules/index.ts # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/ml_disabled/perform_installation/index.ts
…n folder (elastic#225495) **Relates to:** elastic#219831 ## Summary This PR moves prebuilt rules license independent integration tests to the `prebuilt_rules/common` folder. (cherry picked from commit 55e3292) # Conflicts: # .buildkite/ftr_security_stateful_configs.yml # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/install_prebuilt_rules/install_mocked_prebuilt_rule_assets.ts # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/revert_prebuilt_rules/get_prebuilt_rule_base_version.ts # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/revert_prebuilt_rules/index.ts # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/common/revert_prebuilt_rules/revert_prebuilt_rules.ts # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/customization_enabled/revert_prebuilt_rules/index.ts # x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/ml_disabled/perform_installation/index.ts
…n folder (elastic#225495) **Relates to:** elastic#219831 This PR moves prebuilt rules license independent integration tests to the `prebuilt_rules/common` folder. (cherry picked from commit 55e3292)
…n folder (elastic#225495) **Relates to:** elastic#219831 This PR moves prebuilt rules license independent integration tests to the `prebuilt_rules/common` folder. (cherry picked from commit 55e3292)
…n folder (elastic#225495) **Relates to:** elastic#219831 ## Summary This PR moves prebuilt rules license independent integration tests to the `prebuilt_rules/common` folder.
Related Epic: #179907
Summary
This PR refactors prebuilt rules integration tests structure to streamline the implementation of test plans targeted Prebuilt Rules Customization Milestone 4.
Details
Existing integration tests structure have prebuilt rules related integration tests scattered around rules management area. Due to historical reasons and pace of the prebuilt rules customization development some old tests were updated, some new were added as random spots as well as some new tests structure was suggested.
This PR moves files and some tests around to the following structure
test_suites/detection_response/rules_management/prebuilt_rulesis the root folder for prebuilt rules related integration testscustomization_disabledsubfolder contains prebuilt rules integration tests covering scenarios when users have insufficient for customization license level (basic/essentials)customization_enabledsubfolder contains prebuilt rules integration tests covering scenarios when users have sufficient for customization license levelcustomization_disabledandcustomization_enabledsubfoldera have test suites grouped by sub domainsprebuilt_rules_package- contains integration tests related to detection rules Fleet package installation and updating, bootstrap is also belong to hereinstall_prebuilt_rules- contains tests related to prebuilt rules installation from prebuilt rule assetsupgrade_prebuilt_rules- contains tests related to prebuilt rules upgrade workflowcustomization- contains tests related to prebuilt rules customization includingis_customizedcalculationimport_export- contains tests related to exporting and importing customized and non-customized prebuilt rulesstatus- contain status endpoints related tests