Skip to content

[Security Solution] Enable prebuilt rules customization feature flag#212761

Merged
maximpn merged 4 commits intoelastic:mainfrom
maximpn:enable-prebuilt-rules-customization-ff
Mar 11, 2025
Merged

[Security Solution] Enable prebuilt rules customization feature flag#212761
maximpn merged 4 commits intoelastic:mainfrom
maximpn:enable-prebuilt-rules-customization-ff

Conversation

@maximpn
Copy link
Contributor

@maximpn maximpn commented Feb 28, 2025

Addresses: #180267

Summary

This PR enables prebuiltRulesCustomizationEnabled feature flag.

Details

Besides simply enabling prebuiltRulesCustomizationEnabled feature flag the following required changes were done

  • failed tests due enabling the FF were fixed
  • FF setting was removed from test configurations (integrations and Cypress tests)
  • FF logic was removed from the codebase. Disabling the FF would require roll back test changes as well. So just in case we have to disable the FF it's simpler to roll back the PR's commit.

@maximpn maximpn added 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. v9.0.0 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 v8.18.0 v9.1.0 v8.19.0 labels Feb 28, 2025
@maximpn maximpn self-assigned this Feb 28, 2025
@maximpn maximpn force-pushed the enable-prebuilt-rules-customization-ff branch 7 times, most recently from 100afa4 to 86db5ac Compare March 5, 2025 09:33
@maximpn maximpn marked this pull request as ready for review March 5, 2025 11:38
@maximpn maximpn requested review from a team as code owners March 5, 2025 11:38
@maximpn maximpn requested a review from jkelas March 5, 2025 11:38
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

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

@maximpn maximpn requested review from banderror and xcrzx and removed request for jkelas March 5, 2025 11:38
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.

I checked all the same use cases as @banderror and achieved similar results, it looks like the bulk tags is not a bug in this PR but rather this one as we're only really comparing the params object between the two rule versions in bulk_edit_rules.ts.

actionsClient,
savedObjectsClient: coreContext.savedObjects.client,
mlAuthz,
experimentalFeatures: config.experimentalFeatures,
Copy link
Contributor

Choose a reason for hiding this comment

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

Saw this was originally added just for this specific flag check 👍🏽

Copy link
Contributor

@yctercero yctercero left a comment

Choose a reason for hiding this comment

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

Only reviewed files owned by DE. LGTM.

@maximpn
Copy link
Contributor Author

maximpn commented Mar 11, 2025

@banderror Thanks for through testing 🙏

🔴 Bulk adding tags to rules marks some rules as customized and doesn't mark other rules as customized. It looks like it depends on the existence of the base version.

I agree with Davis here. The reason in having some rules with base versions and some without. I'll double it with @xcrzx.

@maximpn maximpn merged commit f7d4f19 into elastic:main Mar 11, 2025
10 checks passed
@maximpn maximpn deleted the enable-prebuilt-rules-customization-ff branch March 11, 2025 21:45
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.18, 8.x, 9.0

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 11, 2025
…lastic#212761)

**Addresses:** elastic#180267

## Summary

This PR enables `prebuiltRulesCustomizationEnabled` feature flag.

## Details

Besides simply enabling `prebuiltRulesCustomizationEnabled` feature flag the following required changes were done

- failed tests due enabling the FF were fixed
- FF setting was removed from test configurations (integrations and Cypress tests)
- FF logic was removed from the codebase. Disabling the FF would require roll back test changes as well. So just in case we have to disable the FF it's simpler to roll back the PR's commit.

(cherry picked from commit f7d4f19)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 11, 2025
…lastic#212761)

**Addresses:** elastic#180267

## Summary

This PR enables `prebuiltRulesCustomizationEnabled` feature flag.

## Details

Besides simply enabling `prebuiltRulesCustomizationEnabled` feature flag the following required changes were done

- failed tests due enabling the FF were fixed
- FF setting was removed from test configurations (integrations and Cypress tests)
- FF logic was removed from the codebase. Disabling the FF would require roll back test changes as well. So just in case we have to disable the FF it's simpler to roll back the PR's commit.

(cherry picked from commit f7d4f19)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 11, 2025
…lastic#212761)

**Addresses:** elastic#180267

## Summary

This PR enables `prebuiltRulesCustomizationEnabled` feature flag.

## Details

Besides simply enabling `prebuiltRulesCustomizationEnabled` feature flag the following required changes were done

- failed tests due enabling the FF were fixed
- FF setting was removed from test configurations (integrations and Cypress tests)
- FF logic was removed from the codebase. Disabling the FF would require roll back test changes as well. So just in case we have to disable the FF it's simpler to roll back the PR's commit.

(cherry picked from commit f7d4f19)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.18
8.x
9.0

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Mar 11, 2025
… flag (#212761) (#214025)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Security Solution] Enable prebuilt rules customization feature flag
(#212761)](#212761)

<!--- 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-03-11T21:45:49Z","message":"[Security
Solution] Enable prebuilt rules customization feature flag
(#212761)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/180267\n\n## Summary\n\nThis PR
enables `prebuiltRulesCustomizationEnabled` feature flag.\n\n##
Details\n\nBesides simply enabling `prebuiltRulesCustomizationEnabled`
feature flag the following required changes were done\n\n- failed tests
due enabling the FF were fixed\n- FF setting was removed from test
configurations (integrations and Cypress tests)\n- FF logic was removed
from the codebase. Disabling the FF would require roll back test changes
as well. So just in case we have to disable the FF it's simpler to roll
back the PR's
commit.","sha":"f7d4f19096e0711021b8587fb4d0575998d18f3e","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","impact:high","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Security
Solution] Enable prebuilt rules customization feature
flag","number":212761,"url":"https://github.com/elastic/kibana/pull/212761","mergeCommit":{"message":"[Security
Solution] Enable prebuilt rules customization feature flag
(#212761)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/180267\n\n## Summary\n\nThis PR
enables `prebuiltRulesCustomizationEnabled` feature flag.\n\n##
Details\n\nBesides simply enabling `prebuiltRulesCustomizationEnabled`
feature flag the following required changes were done\n\n- failed tests
due enabling the FF were fixed\n- FF setting was removed from test
configurations (integrations and Cypress tests)\n- FF logic was removed
from the codebase. Disabling the FF would require roll back test changes
as well. So just in case we have to disable the FF it's simpler to roll
back the PR's
commit.","sha":"f7d4f19096e0711021b8587fb4d0575998d18f3e"}},"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/212761","number":212761,"mergeCommit":{"message":"[Security
Solution] Enable prebuilt rules customization feature flag
(#212761)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/180267\n\n## Summary\n\nThis PR
enables `prebuiltRulesCustomizationEnabled` feature flag.\n\n##
Details\n\nBesides simply enabling `prebuiltRulesCustomizationEnabled`
feature flag the following required changes were done\n\n- failed tests
due enabling the FF were fixed\n- FF setting was removed from test
configurations (integrations and Cypress tests)\n- FF logic was removed
from the codebase. Disabling the FF would require roll back test changes
as well. So just in case we have to disable the FF it's simpler to roll
back the PR's
commit.","sha":"f7d4f19096e0711021b8587fb4d0575998d18f3e"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
kibanamachine added a commit that referenced this pull request Mar 11, 2025
…e flag (#212761) (#214023)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Security Solution] Enable prebuilt rules customization feature flag
(#212761)](#212761)

<!--- 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-03-11T21:45:49Z","message":"[Security
Solution] Enable prebuilt rules customization feature flag
(#212761)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/180267\n\n## Summary\n\nThis PR
enables `prebuiltRulesCustomizationEnabled` feature flag.\n\n##
Details\n\nBesides simply enabling `prebuiltRulesCustomizationEnabled`
feature flag the following required changes were done\n\n- failed tests
due enabling the FF were fixed\n- FF setting was removed from test
configurations (integrations and Cypress tests)\n- FF logic was removed
from the codebase. Disabling the FF would require roll back test changes
as well. So just in case we have to disable the FF it's simpler to roll
back the PR's
commit.","sha":"f7d4f19096e0711021b8587fb4d0575998d18f3e","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","impact:high","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Security
Solution] Enable prebuilt rules customization feature
flag","number":212761,"url":"https://github.com/elastic/kibana/pull/212761","mergeCommit":{"message":"[Security
Solution] Enable prebuilt rules customization feature flag
(#212761)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/180267\n\n## Summary\n\nThis PR
enables `prebuiltRulesCustomizationEnabled` feature flag.\n\n##
Details\n\nBesides simply enabling `prebuiltRulesCustomizationEnabled`
feature flag the following required changes were done\n\n- failed tests
due enabling the FF were fixed\n- FF setting was removed from test
configurations (integrations and Cypress tests)\n- FF logic was removed
from the codebase. Disabling the FF would require roll back test changes
as well. So just in case we have to disable the FF it's simpler to roll
back the PR's
commit.","sha":"f7d4f19096e0711021b8587fb4d0575998d18f3e"}},"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/212761","number":212761,"mergeCommit":{"message":"[Security
Solution] Enable prebuilt rules customization feature flag
(#212761)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/180267\n\n## Summary\n\nThis PR
enables `prebuiltRulesCustomizationEnabled` feature flag.\n\n##
Details\n\nBesides simply enabling `prebuiltRulesCustomizationEnabled`
feature flag the following required changes were done\n\n- failed tests
due enabling the FF were fixed\n- FF setting was removed from test
configurations (integrations and Cypress tests)\n- FF logic was removed
from the codebase. Disabling the FF would require roll back test changes
as well. So just in case we have to disable the FF it's simpler to roll
back the PR's
commit.","sha":"f7d4f19096e0711021b8587fb4d0575998d18f3e"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
kibanamachine added a commit that referenced this pull request Mar 12, 2025
… flag (#212761) (#214024)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution] Enable prebuilt rules customization feature flag
(#212761)](#212761)

<!--- 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-03-11T21:45:49Z","message":"[Security
Solution] Enable prebuilt rules customization feature flag
(#212761)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/180267\n\n## Summary\n\nThis PR
enables `prebuiltRulesCustomizationEnabled` feature flag.\n\n##
Details\n\nBesides simply enabling `prebuiltRulesCustomizationEnabled`
feature flag the following required changes were done\n\n- failed tests
due enabling the FF were fixed\n- FF setting was removed from test
configurations (integrations and Cypress tests)\n- FF logic was removed
from the codebase. Disabling the FF would require roll back test changes
as well. So just in case we have to disable the FF it's simpler to roll
back the PR's
commit.","sha":"f7d4f19096e0711021b8587fb4d0575998d18f3e","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","impact:high","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Security
Solution] Enable prebuilt rules customization feature
flag","number":212761,"url":"https://github.com/elastic/kibana/pull/212761","mergeCommit":{"message":"[Security
Solution] Enable prebuilt rules customization feature flag
(#212761)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/180267\n\n## Summary\n\nThis PR
enables `prebuiltRulesCustomizationEnabled` feature flag.\n\n##
Details\n\nBesides simply enabling `prebuiltRulesCustomizationEnabled`
feature flag the following required changes were done\n\n- failed tests
due enabling the FF were fixed\n- FF setting was removed from test
configurations (integrations and Cypress tests)\n- FF logic was removed
from the codebase. Disabling the FF would require roll back test changes
as well. So just in case we have to disable the FF it's simpler to roll
back the PR's
commit.","sha":"f7d4f19096e0711021b8587fb4d0575998d18f3e"}},"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/212761","number":212761,"mergeCommit":{"message":"[Security
Solution] Enable prebuilt rules customization feature flag
(#212761)\n\n**Addresses:**
https://github.com/elastic/kibana/issues/180267\n\n## Summary\n\nThis PR
enables `prebuiltRulesCustomizationEnabled` feature flag.\n\n##
Details\n\nBesides simply enabling `prebuiltRulesCustomizationEnabled`
feature flag the following required changes were done\n\n- failed tests
due enabling the FF were fixed\n- FF setting was removed from test
configurations (integrations and Cypress tests)\n- FF logic was removed
from the codebase. Disabling the FF would require roll back test changes
as well. So just in case we have to disable the FF it's simpler to roll
back the PR's
commit.","sha":"f7d4f19096e0711021b8587fb4d0575998d18f3e"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
maximpn added a commit that referenced this pull request Mar 12, 2025
…lying bulk actions (#214115)

## Summary

Fixes a problem [`Bulk adding tags to rules marks some rules as customized and doesn't mark other rules as customized. It looks like it depends on the existence of the base version.`](#212761 (review)) discovered while smoke testing after enabling Prebuilt Rules Customization FF.

## Details

The problems manifests as some rules have `Modified` badge missing after modifying tags via bulk actions.

The root cause is that current bulk actions implementation expects unmodified rule's data in `paramsModifier()` callback. But Alerting Framework's Rules Client invokes `paramsModifier()` providing already modified rule. Alerting Framework managed fields like `rule.tags` have modified values.

The fix makes sure rule customizartion state is calculated by using unmodified rule data.

## Screenshots

Before:

https://github.com/user-attachments/assets/eeb65b18-c51f-4c5e-b0e6-6552e442994e

After:

https://github.com/user-attachments/assets/d18d8765-4f40-4513-95a1-2cd84ac2a0a9
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 12, 2025
…lying bulk actions (elastic#214115)

## Summary

Fixes a problem [`Bulk adding tags to rules marks some rules as customized and doesn't mark other rules as customized. It looks like it depends on the existence of the base version.`](elastic#212761 (review)) discovered while smoke testing after enabling Prebuilt Rules Customization FF.

## Details

The problems manifests as some rules have `Modified` badge missing after modifying tags via bulk actions.

The root cause is that current bulk actions implementation expects unmodified rule's data in `paramsModifier()` callback. But Alerting Framework's Rules Client invokes `paramsModifier()` providing already modified rule. Alerting Framework managed fields like `rule.tags` have modified values.

The fix makes sure rule customizartion state is calculated by using unmodified rule data.

## Screenshots

Before:

https://github.com/user-attachments/assets/eeb65b18-c51f-4c5e-b0e6-6552e442994e

After:

https://github.com/user-attachments/assets/d18d8765-4f40-4513-95a1-2cd84ac2a0a9
(cherry picked from commit 6b87869)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 12, 2025
…lying bulk actions (elastic#214115)

## Summary

Fixes a problem [`Bulk adding tags to rules marks some rules as customized and doesn't mark other rules as customized. It looks like it depends on the existence of the base version.`](elastic#212761 (review)) discovered while smoke testing after enabling Prebuilt Rules Customization FF.

## Details

The problems manifests as some rules have `Modified` badge missing after modifying tags via bulk actions.

The root cause is that current bulk actions implementation expects unmodified rule's data in `paramsModifier()` callback. But Alerting Framework's Rules Client invokes `paramsModifier()` providing already modified rule. Alerting Framework managed fields like `rule.tags` have modified values.

The fix makes sure rule customizartion state is calculated by using unmodified rule data.

## Screenshots

Before:

https://github.com/user-attachments/assets/eeb65b18-c51f-4c5e-b0e6-6552e442994e

After:

https://github.com/user-attachments/assets/d18d8765-4f40-4513-95a1-2cd84ac2a0a9
(cherry picked from commit 6b87869)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 12, 2025
…lying bulk actions (elastic#214115)

## Summary

Fixes a problem [`Bulk adding tags to rules marks some rules as customized and doesn't mark other rules as customized. It looks like it depends on the existence of the base version.`](elastic#212761 (review)) discovered while smoke testing after enabling Prebuilt Rules Customization FF.

## Details

The problems manifests as some rules have `Modified` badge missing after modifying tags via bulk actions.

The root cause is that current bulk actions implementation expects unmodified rule's data in `paramsModifier()` callback. But Alerting Framework's Rules Client invokes `paramsModifier()` providing already modified rule. Alerting Framework managed fields like `rule.tags` have modified values.

The fix makes sure rule customizartion state is calculated by using unmodified rule data.

## Screenshots

Before:

https://github.com/user-attachments/assets/eeb65b18-c51f-4c5e-b0e6-6552e442994e

After:

https://github.com/user-attachments/assets/d18d8765-4f40-4513-95a1-2cd84ac2a0a9
(cherry picked from commit 6b87869)
kibanamachine added a commit that referenced this pull request Mar 12, 2025
…er applying bulk actions (#214115) (#214152)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution] Fix inconsistent rule's modified status after
applying bulk actions
(#214115)](#214115)

<!--- 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-03-12T13:10:38Z","message":"[Security
Solution] Fix inconsistent rule's modified status after applying bulk
actions (#214115)\n\n## Summary\n\nFixes a problem [`Bulk adding tags to
rules marks some rules as customized and doesn't mark other rules as
customized. It looks like it depends on the existence of the base
version.`](#212761 (review))
discovered while smoke testing after enabling Prebuilt Rules
Customization FF.\n\n## Details\n\nThe problems manifests as some rules
have `Modified` badge missing after modifying tags via bulk
actions.\n\nThe root cause is that current bulk actions implementation
expects unmodified rule's data in `paramsModifier()` callback. But
Alerting Framework's Rules Client invokes `paramsModifier()` providing
already modified rule. Alerting Framework managed fields like
`rule.tags` have modified values.\n\nThe fix makes sure rule
customizartion state is calculated by using unmodified rule data.\n\n##
Screenshots\n\nBefore:\n\nhttps://github.com/user-attachments/assets/eeb65b18-c51f-4c5e-b0e6-6552e442994e\n\nAfter:\n\nhttps://github.com/user-attachments/assets/d18d8765-4f40-4513-95a1-2cd84ac2a0a9","sha":"6b87869dc07a531f62523d1e3c1c81bf269d25ae","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","impact:high","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Security
Solution] Fix inconsistent rule's modified status after applying bulk
actions","number":214115,"url":"https://github.com/elastic/kibana/pull/214115","mergeCommit":{"message":"[Security
Solution] Fix inconsistent rule's modified status after applying bulk
actions (#214115)\n\n## Summary\n\nFixes a problem [`Bulk adding tags to
rules marks some rules as customized and doesn't mark other rules as
customized. It looks like it depends on the existence of the base
version.`](#212761 (review))
discovered while smoke testing after enabling Prebuilt Rules
Customization FF.\n\n## Details\n\nThe problems manifests as some rules
have `Modified` badge missing after modifying tags via bulk
actions.\n\nThe root cause is that current bulk actions implementation
expects unmodified rule's data in `paramsModifier()` callback. But
Alerting Framework's Rules Client invokes `paramsModifier()` providing
already modified rule. Alerting Framework managed fields like
`rule.tags` have modified values.\n\nThe fix makes sure rule
customizartion state is calculated by using unmodified rule data.\n\n##
Screenshots\n\nBefore:\n\nhttps://github.com/user-attachments/assets/eeb65b18-c51f-4c5e-b0e6-6552e442994e\n\nAfter:\n\nhttps://github.com/user-attachments/assets/d18d8765-4f40-4513-95a1-2cd84ac2a0a9","sha":"6b87869dc07a531f62523d1e3c1c81bf269d25ae"}},"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/214115","number":214115,"mergeCommit":{"message":"[Security
Solution] Fix inconsistent rule's modified status after applying bulk
actions (#214115)\n\n## Summary\n\nFixes a problem [`Bulk adding tags to
rules marks some rules as customized and doesn't mark other rules as
customized. It looks like it depends on the existence of the base
version.`](#212761 (review))
discovered while smoke testing after enabling Prebuilt Rules
Customization FF.\n\n## Details\n\nThe problems manifests as some rules
have `Modified` badge missing after modifying tags via bulk
actions.\n\nThe root cause is that current bulk actions implementation
expects unmodified rule's data in `paramsModifier()` callback. But
Alerting Framework's Rules Client invokes `paramsModifier()` providing
already modified rule. Alerting Framework managed fields like
`rule.tags` have modified values.\n\nThe fix makes sure rule
customizartion state is calculated by using unmodified rule data.\n\n##
Screenshots\n\nBefore:\n\nhttps://github.com/user-attachments/assets/eeb65b18-c51f-4c5e-b0e6-6552e442994e\n\nAfter:\n\nhttps://github.com/user-attachments/assets/d18d8765-4f40-4513-95a1-2cd84ac2a0a9","sha":"6b87869dc07a531f62523d1e3c1c81bf269d25ae"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
kibanamachine added a commit that referenced this pull request Mar 12, 2025
…ter applying bulk actions (#214115) (#214151)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Security Solution] Fix inconsistent rule's modified status after
applying bulk actions
(#214115)](#214115)

<!--- 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-03-12T13:10:38Z","message":"[Security
Solution] Fix inconsistent rule's modified status after applying bulk
actions (#214115)\n\n## Summary\n\nFixes a problem [`Bulk adding tags to
rules marks some rules as customized and doesn't mark other rules as
customized. It looks like it depends on the existence of the base
version.`](#212761 (review))
discovered while smoke testing after enabling Prebuilt Rules
Customization FF.\n\n## Details\n\nThe problems manifests as some rules
have `Modified` badge missing after modifying tags via bulk
actions.\n\nThe root cause is that current bulk actions implementation
expects unmodified rule's data in `paramsModifier()` callback. But
Alerting Framework's Rules Client invokes `paramsModifier()` providing
already modified rule. Alerting Framework managed fields like
`rule.tags` have modified values.\n\nThe fix makes sure rule
customizartion state is calculated by using unmodified rule data.\n\n##
Screenshots\n\nBefore:\n\nhttps://github.com/user-attachments/assets/eeb65b18-c51f-4c5e-b0e6-6552e442994e\n\nAfter:\n\nhttps://github.com/user-attachments/assets/d18d8765-4f40-4513-95a1-2cd84ac2a0a9","sha":"6b87869dc07a531f62523d1e3c1c81bf269d25ae","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","impact:high","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Security
Solution] Fix inconsistent rule's modified status after applying bulk
actions","number":214115,"url":"https://github.com/elastic/kibana/pull/214115","mergeCommit":{"message":"[Security
Solution] Fix inconsistent rule's modified status after applying bulk
actions (#214115)\n\n## Summary\n\nFixes a problem [`Bulk adding tags to
rules marks some rules as customized and doesn't mark other rules as
customized. It looks like it depends on the existence of the base
version.`](#212761 (review))
discovered while smoke testing after enabling Prebuilt Rules
Customization FF.\n\n## Details\n\nThe problems manifests as some rules
have `Modified` badge missing after modifying tags via bulk
actions.\n\nThe root cause is that current bulk actions implementation
expects unmodified rule's data in `paramsModifier()` callback. But
Alerting Framework's Rules Client invokes `paramsModifier()` providing
already modified rule. Alerting Framework managed fields like
`rule.tags` have modified values.\n\nThe fix makes sure rule
customizartion state is calculated by using unmodified rule data.\n\n##
Screenshots\n\nBefore:\n\nhttps://github.com/user-attachments/assets/eeb65b18-c51f-4c5e-b0e6-6552e442994e\n\nAfter:\n\nhttps://github.com/user-attachments/assets/d18d8765-4f40-4513-95a1-2cd84ac2a0a9","sha":"6b87869dc07a531f62523d1e3c1c81bf269d25ae"}},"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/214115","number":214115,"mergeCommit":{"message":"[Security
Solution] Fix inconsistent rule's modified status after applying bulk
actions (#214115)\n\n## Summary\n\nFixes a problem [`Bulk adding tags to
rules marks some rules as customized and doesn't mark other rules as
customized. It looks like it depends on the existence of the base
version.`](#212761 (review))
discovered while smoke testing after enabling Prebuilt Rules
Customization FF.\n\n## Details\n\nThe problems manifests as some rules
have `Modified` badge missing after modifying tags via bulk
actions.\n\nThe root cause is that current bulk actions implementation
expects unmodified rule's data in `paramsModifier()` callback. But
Alerting Framework's Rules Client invokes `paramsModifier()` providing
already modified rule. Alerting Framework managed fields like
`rule.tags` have modified values.\n\nThe fix makes sure rule
customizartion state is calculated by using unmodified rule data.\n\n##
Screenshots\n\nBefore:\n\nhttps://github.com/user-attachments/assets/eeb65b18-c51f-4c5e-b0e6-6552e442994e\n\nAfter:\n\nhttps://github.com/user-attachments/assets/d18d8765-4f40-4513-95a1-2cd84ac2a0a9","sha":"6b87869dc07a531f62523d1e3c1c81bf269d25ae"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
kibanamachine added a commit that referenced this pull request Mar 12, 2025
…er applying bulk actions (#214115) (#214153)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Security Solution] Fix inconsistent rule's modified status after
applying bulk actions
(#214115)](#214115)

<!--- 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-03-12T13:10:38Z","message":"[Security
Solution] Fix inconsistent rule's modified status after applying bulk
actions (#214115)\n\n## Summary\n\nFixes a problem [`Bulk adding tags to
rules marks some rules as customized and doesn't mark other rules as
customized. It looks like it depends on the existence of the base
version.`](#212761 (review))
discovered while smoke testing after enabling Prebuilt Rules
Customization FF.\n\n## Details\n\nThe problems manifests as some rules
have `Modified` badge missing after modifying tags via bulk
actions.\n\nThe root cause is that current bulk actions implementation
expects unmodified rule's data in `paramsModifier()` callback. But
Alerting Framework's Rules Client invokes `paramsModifier()` providing
already modified rule. Alerting Framework managed fields like
`rule.tags` have modified values.\n\nThe fix makes sure rule
customizartion state is calculated by using unmodified rule data.\n\n##
Screenshots\n\nBefore:\n\nhttps://github.com/user-attachments/assets/eeb65b18-c51f-4c5e-b0e6-6552e442994e\n\nAfter:\n\nhttps://github.com/user-attachments/assets/d18d8765-4f40-4513-95a1-2cd84ac2a0a9","sha":"6b87869dc07a531f62523d1e3c1c81bf269d25ae","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","impact:high","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Security
Solution] Fix inconsistent rule's modified status after applying bulk
actions","number":214115,"url":"https://github.com/elastic/kibana/pull/214115","mergeCommit":{"message":"[Security
Solution] Fix inconsistent rule's modified status after applying bulk
actions (#214115)\n\n## Summary\n\nFixes a problem [`Bulk adding tags to
rules marks some rules as customized and doesn't mark other rules as
customized. It looks like it depends on the existence of the base
version.`](#212761 (review))
discovered while smoke testing after enabling Prebuilt Rules
Customization FF.\n\n## Details\n\nThe problems manifests as some rules
have `Modified` badge missing after modifying tags via bulk
actions.\n\nThe root cause is that current bulk actions implementation
expects unmodified rule's data in `paramsModifier()` callback. But
Alerting Framework's Rules Client invokes `paramsModifier()` providing
already modified rule. Alerting Framework managed fields like
`rule.tags` have modified values.\n\nThe fix makes sure rule
customizartion state is calculated by using unmodified rule data.\n\n##
Screenshots\n\nBefore:\n\nhttps://github.com/user-attachments/assets/eeb65b18-c51f-4c5e-b0e6-6552e442994e\n\nAfter:\n\nhttps://github.com/user-attachments/assets/d18d8765-4f40-4513-95a1-2cd84ac2a0a9","sha":"6b87869dc07a531f62523d1e3c1c81bf269d25ae"}},"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/214115","number":214115,"mergeCommit":{"message":"[Security
Solution] Fix inconsistent rule's modified status after applying bulk
actions (#214115)\n\n## Summary\n\nFixes a problem [`Bulk adding tags to
rules marks some rules as customized and doesn't mark other rules as
customized. It looks like it depends on the existence of the base
version.`](#212761 (review))
discovered while smoke testing after enabling Prebuilt Rules
Customization FF.\n\n## Details\n\nThe problems manifests as some rules
have `Modified` badge missing after modifying tags via bulk
actions.\n\nThe root cause is that current bulk actions implementation
expects unmodified rule's data in `paramsModifier()` callback. But
Alerting Framework's Rules Client invokes `paramsModifier()` providing
already modified rule. Alerting Framework managed fields like
`rule.tags` have modified values.\n\nThe fix makes sure rule
customizartion state is calculated by using unmodified rule data.\n\n##
Screenshots\n\nBefore:\n\nhttps://github.com/user-attachments/assets/eeb65b18-c51f-4c5e-b0e6-6552e442994e\n\nAfter:\n\nhttps://github.com/user-attachments/assets/d18d8765-4f40-4513-95a1-2cd84ac2a0a9","sha":"6b87869dc07a531f62523d1e3c1c81bf269d25ae"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Maxim Palenov <maxim.palenov@elastic.co>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
…lastic#212761)

**Addresses:** elastic#180267

## Summary

This PR enables `prebuiltRulesCustomizationEnabled` feature flag.

## Details

Besides simply enabling `prebuiltRulesCustomizationEnabled` feature flag the following required changes were done

- failed tests due enabling the FF were fixed
- FF setting was removed from test configurations (integrations and Cypress tests)
- FF logic was removed from the codebase. Disabling the FF would require roll back test changes as well. So just in case we have to disable the FF it's simpler to roll back the PR's commit.
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
…lying bulk actions (elastic#214115)

## Summary

Fixes a problem [`Bulk adding tags to rules marks some rules as customized and doesn't mark other rules as customized. It looks like it depends on the existence of the base version.`](elastic#212761 (review)) discovered while smoke testing after enabling Prebuilt Rules Customization FF.

## Details

The problems manifests as some rules have `Modified` badge missing after modifying tags via bulk actions.

The root cause is that current bulk actions implementation expects unmodified rule's data in `paramsModifier()` callback. But Alerting Framework's Rules Client invokes `paramsModifier()` providing already modified rule. Alerting Framework managed fields like `rule.tags` have modified values.

The fix makes sure rule customizartion state is calculated by using unmodified rule data.

## Screenshots

Before:

https://github.com/user-attachments/assets/eeb65b18-c51f-4c5e-b0e6-6552e442994e

After:

https://github.com/user-attachments/assets/d18d8765-4f40-4513-95a1-2cd84ac2a0a9
@banderror banderror added release_note:feature Makes this part of the condensed release notes and removed release_note:skip Skip the PR/issue when compiling release notes labels Mar 28, 2025
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. release_note:feature Makes this part of the condensed 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. v8.18.0 v8.19.0 v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants