[8.18] [Security Solution] Fix prebuilt rules exclusion on bulk edit (#209992) (#210851)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Security Solution] Fix prebuilt rules exclusion on bulk edit
(#209992)](https://github.com/elastic/kibana/pull/209992)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Dmitrii
Shevchenko","email":"dmitrii.shevchenko@elastic.co"},"sourceCommit":{"committedDate":"2025-02-12T15:04:13Z","message":"[Security
Solution] Fix prebuilt rules exclusion on bulk edit
(#209992)\n\n**Resolves:
https://github.com/elastic/kibana/issues/209888**\n\n##
Summary\n\nResolves an issue when prebuilt rules were not excluded from
bulk\noperations when the license tier is not sufficient to customize
prebuilt\nrules.\n\nSee the attached issue for reproduction
steps.\n\n**Before**\n\n\n8ed2a1e4-d298-4173-95ca-565e0c280c21","sha":"376754afb4f1e630d26d00560fc4ae124141900f","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Security
Solution] Fix prebuilt rules exclusion on bulk
edit","number":209992,"url":"https://github.com/elastic/kibana/pull/209992","mergeCommit":{"message":"[Security
Solution] Fix prebuilt rules exclusion on bulk edit
(#209992)\n\n**Resolves:
https://github.com/elastic/kibana/issues/209888**\n\n##
Summary\n\nResolves an issue when prebuilt rules were not excluded from
bulk\noperations when the license tier is not sufficient to customize
prebuilt\nrules.\n\nSee the attached issue for reproduction
steps.\n\n**Before**\n\n\n8ed2a1e4-d298-4173-95ca-565e0c280c21","sha":"376754afb4f1e630d26d00560fc4ae124141900f"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/209992","number":209992,"mergeCommit":{"message":"[Security
Solution] Fix prebuilt rules exclusion on bulk edit
(#209992)\n\n**Resolves:
https://github.com/elastic/kibana/issues/209888**\n\n##
Summary\n\nResolves an issue when prebuilt rules were not excluded from
bulk\noperations when the license tier is not sufficient to customize
prebuilt\nrules.\n\nSee the attached issue for reproduction
steps.\n\n**Before**\n\n\n8ed2a1e4-d298-4173-95ca-565e0c280c21","sha":"376754afb4f1e630d26d00560fc4ae124141900f"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Dmitrii Shevchenko <dmitrii.shevchenko@elastic.co>
This commit is contained in:
Kibana Machine 2025-02-13 03:48:12 +11:00 committed by GitHub
parent 628aadd924
commit 55798e1877
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -40,6 +40,7 @@ export const prepareSearchParams = ({
dryRunResult?.ruleErrors.forEach(({ errorCode }) => {
switch (errorCode) {
case BulkActionsDryRunErrCodeEnum.IMMUTABLE:
case BulkActionsDryRunErrCodeEnum.PREBUILT_CUSTOMIZATION_LICENSE:
modifiedFilterOptions = { ...modifiedFilterOptions, showCustomRules: true };
break;
case BulkActionsDryRunErrCodeEnum.MACHINE_LEARNING_INDEX_PATTERN: