Skip to content

[9.0] [Security Solution] Implement prebuilt rules import test plan (#223421)#226448

Merged
maximpn merged 2 commits intoelastic:9.0from
maximpn:backport/9.0/pr-223421
Jul 3, 2025
Merged

[9.0] [Security Solution] Implement prebuilt rules import test plan (#223421)#226448
maximpn merged 2 commits intoelastic:9.0from
maximpn:backport/9.0/pr-223421

Conversation

@maximpn
Copy link
Copy Markdown
Contributor

@maximpn maximpn commented Jul 3, 2025

Backport

This will backport the following commits from main to 9.0:

Questions ?

Please refer to the Backport tool documentation

…c#223421)

**Addresses:** elastic#202079

## Summary

This PR implement prebuilt rules import [test plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_import.md).

Prior existing tests were superseded by the new ones.

## Discovered issues

It turned out that the current implementation behaves slightly differently than described the test plan. Failed test scenarios are skipped and the following tickets have been created for tracking

- elastic#223099
- elastic#223280
- elastic#223253

## Extra changes

Some diff like in `alert_threat_enrichments.cy.ts` has been caused by disabling errors swallowing upon rule creation. It's important to have tests properly preparing the testing environment to reduce chances of test dependencies and flakiness. In particular some prebuilt rules import test scenarios require custom rules to be created. Swallowing rule creation errors reduces tests coverage.

## Flaky test runner

- ✅  [`detection_engine_security` package related prebuilt rules import integration tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8365) (100 iterations)
- ✅ [prebuilt rules import ECH integration tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8366) (100 iterations)
- ✅ [prebuilt rules import Serverless integration tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8367) (100 iterations)

(cherry picked from commit 87c8b88)
@maximpn maximpn requested a review from kibanamachine as a code owner July 3, 2025 14:58
@maximpn maximpn added the backport This PR is a backport of another PR label Jul 3, 2025
@maximpn maximpn enabled auto-merge (squash) July 3, 2025 14:58
@maximpn maximpn merged commit 108331c into elastic:9.0 Jul 3, 2025
9 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

kibanamachine added a commit that referenced this pull request Jul 4, 2025
…223421) (#226507)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Security Solution] Implement prebuilt rules import test plan
(#223421)](#223421)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Maxim
Palenov","email":"maxim.palenov@elastic.co"},"sourceCommit":{"committedDate":"2025-06-24T12:24:10Z","message":"[Security
Solution] Implement prebuilt rules import test plan
(#223421)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/202079\n\n## Summary\n\nThis PR
implement prebuilt rules import [test
plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_import.md).\n\nPrior
existing tests were superseded by the new ones.\n\n## Discovered
issues\n\nIt turned out that the current implementation behaves slightly
differently than described the test plan. Failed test scenarios are
skipped and the following tickets have been created for tracking\n\n-
https://github.com/elastic/kibana/issues/223099https://github.com/elastic/kibana/issues/223099\n-
https://github.com/elastic/kibana/issues/223280\n-
https://github.com/elastic/kibana/issues/223253\n\n## Extra
changes\n\nSome diff like in `alert_threat_enrichments.cy.ts` has been
caused by disabling errors swallowing upon rule creation. It's important
to have tests properly preparing the testing environment to reduce
chances of test dependencies and flakiness. In particular some prebuilt
rules import test scenarios require custom rules to be created.
Swallowing rule creation errors reduces tests coverage. \n\n## Flaky
test runner\n\n- ✅ [`detection_engine_security` package related prebuilt
rules import integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8365)
(100 iterations)\n- ✅ [prebuilt rules import ECH integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8366)
(100 iterations)\n- ✅ [prebuilt rules import Serverless integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8367)
(100
iterations)","sha":"87c8b882c238acd38c39704cacce29b8d022c4d5","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","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","v9.2.0","v9.0.4"],"title":"[Security
Solution] Implement prebuilt rules import test
plan","number":223421,"url":"https://github.com/elastic/kibana/pull/223421","mergeCommit":{"message":"[Security
Solution] Implement prebuilt rules import test plan
(#223421)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/202079\n\n## Summary\n\nThis PR
implement prebuilt rules import [test
plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_import.md).\n\nPrior
existing tests were superseded by the new ones.\n\n## Discovered
issues\n\nIt turned out that the current implementation behaves slightly
differently than described the test plan. Failed test scenarios are
skipped and the following tickets have been created for tracking\n\n-
https://github.com/elastic/kibana/issues/223099https://github.com/elastic/kibana/issues/223099\n-
https://github.com/elastic/kibana/issues/223280\n-
https://github.com/elastic/kibana/issues/223253\n\n## Extra
changes\n\nSome diff like in `alert_threat_enrichments.cy.ts` has been
caused by disabling errors swallowing upon rule creation. It's important
to have tests properly preparing the testing environment to reduce
chances of test dependencies and flakiness. In particular some prebuilt
rules import test scenarios require custom rules to be created.
Swallowing rule creation errors reduces tests coverage. \n\n## Flaky
test runner\n\n- ✅ [`detection_engine_security` package related prebuilt
rules import integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8365)
(100 iterations)\n- ✅ [prebuilt rules import ECH integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8366)
(100 iterations)\n- ✅ [prebuilt rules import Serverless integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8367)
(100
iterations)","sha":"87c8b882c238acd38c39704cacce29b8d022c4d5"}},"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/223421","number":223421,"mergeCommit":{"message":"[Security
Solution] Implement prebuilt rules import test plan
(#223421)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/202079\n\n## Summary\n\nThis PR
implement prebuilt rules import [test
plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_import.md).\n\nPrior
existing tests were superseded by the new ones.\n\n## Discovered
issues\n\nIt turned out that the current implementation behaves slightly
differently than described the test plan. Failed test scenarios are
skipped and the following tickets have been created for tracking\n\n-
https://github.com/elastic/kibana/issues/223099https://github.com/elastic/kibana/issues/223099\n-
https://github.com/elastic/kibana/issues/223280\n-
https://github.com/elastic/kibana/issues/223253\n\n## Extra
changes\n\nSome diff like in `alert_threat_enrichments.cy.ts` has been
caused by disabling errors swallowing upon rule creation. It's important
to have tests properly preparing the testing environment to reduce
chances of test dependencies and flakiness. In particular some prebuilt
rules import test scenarios require custom rules to be created.
Swallowing rule creation errors reduces tests coverage. \n\n## Flaky
test runner\n\n- ✅ [`detection_engine_security` package related prebuilt
rules import integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8365)
(100 iterations)\n- ✅ [prebuilt rules import ECH integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8366)
(100 iterations)\n- ✅ [prebuilt rules import Serverless integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8367)
(100
iterations)","sha":"87c8b882c238acd38c39704cacce29b8d022c4d5"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/225072","number":225072,"state":"MERGED","mergeCommit":{"sha":"2ccfccfc6c48365bdec9ee45b0f75b250724375f","message":"[8.19]
[Security Solution] Implement prebuilt rules import test plan (#223421)
(#225072)\n\n# Backport\n\nThis will backport the following commits from
`main` to `8.19`:\n- [[Security Solution] Implement prebuilt rules
import test
plan\n(#223421)](https://github.com/elastic/kibana/pull/223421)\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>"}},{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/226448","number":226448,"state":"MERGED","mergeCommit":{"sha":"108331c351b831b2e2e40f080d60a73dc127254d","message":"[9.0]
[Security Solution] Implement prebuilt rules import test plan (#223421)
(#226448)\n\n# Backport\n\nThis will backport the following commits from
`main` to `9.0`:\n- [[Security Solution] Implement prebuilt rules import
test
plan\n(#223421)](https://github.com/elastic/kibana/pull/223421)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n"}},{"url":"https://github.com/elastic/kibana/pull/226449","number":226449,"branch":"8.18","state":"OPEN"}]}]
BACKPORT-->

---------

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
kibanamachine added a commit that referenced this pull request Jul 4, 2025
…223421) (#226508)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Security Solution] Implement prebuilt rules import test plan
(#223421)](#223421)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Maxim
Palenov","email":"maxim.palenov@elastic.co"},"sourceCommit":{"committedDate":"2025-06-24T12:24:10Z","message":"[Security
Solution] Implement prebuilt rules import test plan
(#223421)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/202079\n\n## Summary\n\nThis PR
implement prebuilt rules import [test
plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_import.md).\n\nPrior
existing tests were superseded by the new ones.\n\n## Discovered
issues\n\nIt turned out that the current implementation behaves slightly
differently than described the test plan. Failed test scenarios are
skipped and the following tickets have been created for tracking\n\n-
https://github.com/elastic/kibana/issues/223099https://github.com/elastic/kibana/issues/223099\n-
https://github.com/elastic/kibana/issues/223280\n-
https://github.com/elastic/kibana/issues/223253\n\n## Extra
changes\n\nSome diff like in `alert_threat_enrichments.cy.ts` has been
caused by disabling errors swallowing upon rule creation. It's important
to have tests properly preparing the testing environment to reduce
chances of test dependencies and flakiness. In particular some prebuilt
rules import test scenarios require custom rules to be created.
Swallowing rule creation errors reduces tests coverage. \n\n## Flaky
test runner\n\n- ✅ [`detection_engine_security` package related prebuilt
rules import integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8365)
(100 iterations)\n- ✅ [prebuilt rules import ECH integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8366)
(100 iterations)\n- ✅ [prebuilt rules import Serverless integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8367)
(100
iterations)","sha":"87c8b882c238acd38c39704cacce29b8d022c4d5","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["test","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","v9.2.0","v8.18.4","v9.0.4"],"title":"[Security
Solution] Implement prebuilt rules import test
plan","number":223421,"url":"https://github.com/elastic/kibana/pull/223421","mergeCommit":{"message":"[Security
Solution] Implement prebuilt rules import test plan
(#223421)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/202079\n\n## Summary\n\nThis PR
implement prebuilt rules import [test
plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_import.md).\n\nPrior
existing tests were superseded by the new ones.\n\n## Discovered
issues\n\nIt turned out that the current implementation behaves slightly
differently than described the test plan. Failed test scenarios are
skipped and the following tickets have been created for tracking\n\n-
https://github.com/elastic/kibana/issues/223099https://github.com/elastic/kibana/issues/223099\n-
https://github.com/elastic/kibana/issues/223280\n-
https://github.com/elastic/kibana/issues/223253\n\n## Extra
changes\n\nSome diff like in `alert_threat_enrichments.cy.ts` has been
caused by disabling errors swallowing upon rule creation. It's important
to have tests properly preparing the testing environment to reduce
chances of test dependencies and flakiness. In particular some prebuilt
rules import test scenarios require custom rules to be created.
Swallowing rule creation errors reduces tests coverage. \n\n## Flaky
test runner\n\n- ✅ [`detection_engine_security` package related prebuilt
rules import integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8365)
(100 iterations)\n- ✅ [prebuilt rules import ECH integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8366)
(100 iterations)\n- ✅ [prebuilt rules import Serverless integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8367)
(100
iterations)","sha":"87c8b882c238acd38c39704cacce29b8d022c4d5"}},"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/223421","number":223421,"mergeCommit":{"message":"[Security
Solution] Implement prebuilt rules import test plan
(#223421)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/202079\n\n## Summary\n\nThis PR
implement prebuilt rules import [test
plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_import.md).\n\nPrior
existing tests were superseded by the new ones.\n\n## Discovered
issues\n\nIt turned out that the current implementation behaves slightly
differently than described the test plan. Failed test scenarios are
skipped and the following tickets have been created for tracking\n\n-
https://github.com/elastic/kibana/issues/223099https://github.com/elastic/kibana/issues/223099\n-
https://github.com/elastic/kibana/issues/223280\n-
https://github.com/elastic/kibana/issues/223253\n\n## Extra
changes\n\nSome diff like in `alert_threat_enrichments.cy.ts` has been
caused by disabling errors swallowing upon rule creation. It's important
to have tests properly preparing the testing environment to reduce
chances of test dependencies and flakiness. In particular some prebuilt
rules import test scenarios require custom rules to be created.
Swallowing rule creation errors reduces tests coverage. \n\n## Flaky
test runner\n\n- ✅ [`detection_engine_security` package related prebuilt
rules import integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8365)
(100 iterations)\n- ✅ [prebuilt rules import ECH integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8366)
(100 iterations)\n- ✅ [prebuilt rules import Serverless integration
tests](https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8367)
(100
iterations)","sha":"87c8b882c238acd38c39704cacce29b8d022c4d5"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/225072","number":225072,"state":"MERGED","mergeCommit":{"sha":"2ccfccfc6c48365bdec9ee45b0f75b250724375f","message":"[8.19]
[Security Solution] Implement prebuilt rules import test plan (#223421)
(#225072)\n\n# Backport\n\nThis will backport the following commits from
`main` to `8.19`:\n- [[Security Solution] Implement prebuilt rules
import test
plan\n(#223421)](https://github.com/elastic/kibana/pull/223421)\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>"}},{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/226449","number":226449,"state":"MERGED","mergeCommit":{"sha":"832b2097ad985af7e17e7d60d726816ca4d6323b","message":"[8.18]
[Security Solution] Implement prebuilt rules import test plan (#223421)
(#226449)\n\n# Backport\n\nThis will backport the following commits from
`main` to `8.18`:\n- [[Security Solution] Implement prebuilt rules
import test
plan\n(#223421)](https://github.com/elastic/kibana/pull/223421)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n"}},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/226448","number":226448,"state":"MERGED","mergeCommit":{"sha":"108331c351b831b2e2e40f080d60a73dc127254d","message":"[9.0]
[Security Solution] Implement prebuilt rules import test plan (#223421)
(#226448)\n\n# Backport\n\nThis will backport the following commits from
`main` to `9.0`:\n- [[Security Solution] Implement prebuilt rules import
test
plan\n(#223421)](https://github.com/elastic/kibana/pull/223421)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n"}}]}]
BACKPORT-->

---------

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants