Skip to content

Comments

[Security Solution] Refactor prebuilt rules integration tests#219831

Merged
maximpn merged 15 commits intoelastic:mainfrom
maximpn:refactor-functional-tests
May 30, 2025
Merged

[Security Solution] Refactor prebuilt rules integration tests#219831
maximpn merged 15 commits intoelastic:mainfrom
maximpn:refactor-functional-tests

Conversation

@maximpn
Copy link
Contributor

@maximpn maximpn commented May 1, 2025

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_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

@maximpn maximpn added test refactoring 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 backport:version Backport to applied version labels v9.1.0 v8.19.0 labels May 1, 2025
@maximpn maximpn self-assigned this May 1, 2025
@maximpn maximpn requested review from a team as code owners May 1, 2025 11:32
@maximpn maximpn requested a review from dplumlee May 1, 2025 11:32
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management)

@elasticmachine
Copy link
Contributor

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

@prodsecmachine
Copy link
Collaborator

prodsecmachine commented May 1, 2025

🎉 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)

@maximpn maximpn marked this pull request as draft May 1, 2025 19:08
@maximpn maximpn force-pushed the refactor-functional-tests branch from cb2e177 to c16de20 Compare May 2, 2025 11:35
@maximpn maximpn force-pushed the refactor-functional-tests branch 2 times, most recently from bd68e05 to 7e17aad Compare May 22, 2025 08:25
@maximpn maximpn marked this pull request as ready for review May 22, 2025 10:51
@maximpn maximpn requested a review from a team as a code owner May 22, 2025 10:51
Copy link
Contributor

@dplumlee dplumlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @maximpn I think this structure is much cleaner and readable than what we currently have. Left a few comments and questions but approving in advance

Comment on lines +47 to +69
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 }),
])
);
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these checks worth two separate tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate on the question? Do you mean separate test suites?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

@dplumlee dplumlee May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this file needed? Can we not do this from the main .eslintignore file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing as above

await deleteAllPrebuiltRuleAssets(es, log);
});

describe('w/ historical versions', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, prefer with/without

};

describe('@ess @serverless @skipInServerlessMKI preview prebuilt rules upgrade', () => {
describe('@ess @serverless @skipInServerlessMKI review prebuilt rules upgrade', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're renaming this to review prebuilt rules upgrade, do you also want to change this file name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it makes sense

maximpn added a commit that referenced this pull request Jul 2, 2025
…n folder (#225495)

**Relates to:** #219831

## Summary

This PR moves prebuilt rules license independent integration tests to the `prebuilt_rules/common` folder.
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 2, 2025
…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)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 2, 2025
…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)
maximpn added a commit to maximpn/kibana that referenced this pull request Jul 2, 2025
…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
maximpn added a commit to maximpn/kibana that referenced this pull request Jul 3, 2025
…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
maximpn added a commit to maximpn/kibana that referenced this pull request Jul 3, 2025
…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
@maximpn
Copy link
Contributor Author

maximpn commented Jul 3, 2025

💚 All backports created successfully

Status Branch Result
9.0
8.18

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

maximpn added a commit that referenced this pull request Jul 3, 2025
…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-->
maximpn added a commit that referenced this pull request Jul 3, 2025
…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-->
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.0, 9.1

https://github.com/elastic/kibana/actions/runs/16052870896

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.0, 9.1

https://github.com/elastic/kibana/actions/runs/16052877320

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.18, 8.19, 9.0, 9.1

https://github.com/elastic/kibana/actions/runs/16052878744

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts
9.0 Backport failed because of merge conflicts
9.1 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 219831

Questions ?

Please refer to the Backport tool documentation

1 similar comment
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts
9.0 Backport failed because of merge conflicts
9.1 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 219831

Questions ?

Please refer to the Backport tool documentation

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.18 Backport failed because of merge conflicts
8.19 Backport failed because of merge conflicts
9.0 Backport failed because of merge conflicts
9.1 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 219831

Questions ?

Please refer to the Backport tool documentation

maximpn added a commit to maximpn/kibana that referenced this pull request Jul 3, 2025
**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)
maximpn added a commit to maximpn/kibana that referenced this pull request Jul 3, 2025
**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)
maximpn added a commit that referenced this pull request Jul 4, 2025
…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-->
maximpn added a commit that referenced this pull request Jul 4, 2025
…#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-->
maximpn added a commit to maximpn/kibana that referenced this pull request Jul 5, 2025
…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
maximpn added a commit to maximpn/kibana that referenced this pull request Jul 5, 2025
…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
maximpn added a commit to maximpn/kibana that referenced this pull request Jul 5, 2025
…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)
maximpn added a commit to maximpn/kibana that referenced this pull request Jul 5, 2025
…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)
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
…n folder (elastic#225495)

**Relates to:** elastic#219831

## Summary

This PR moves prebuilt rules license independent integration tests to the `prebuilt_rules/common` folder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels 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. refactoring 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. test v8.18.4 v8.19.0 v9.0.4 v9.1.0 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants