Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[9.0] [Security Solution] Account for missing base rule versions in i…
…s_customized calculation (#213250) (#213466) # Backport This will backport the following commits from `main` to `9.0`: - [[Security Solution] Account for missing base rule versions in is_customized calculation (#213250)](#213250) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Dmitrii Shevchenko","email":"dmitrii.shevchenko@elastic.co"},"sourceCommit":{"committedDate":"2025-03-06T18:22:17Z","message":"[Security Solution] Account for missing base rule versions in is_customized calculation (#213250)\n\n**Partially addresses: https://github.com/elastic/kibana/issues/210358**\n\n## Summary\n\n### Editing of prebuilt rules with missing base versions\n\n**When the base version** of a currently installed prebuilt rule **is missing** among the `security-rule` asset saved objects, and the user edits this rule:\n\n- We should mark the rule as customized, only if the new rule settings are different from the current rule settings.\n - For example, adding a new tag should mark the rule as customized. Then, if the user removes this tag, the rule should remain to be marked as customized. This matches the current behavior.\n - However, if the user saves the rule without making any changes to it, it should keep its `is_customized` field as is. This is different from the current behavior.\n\n### Importing of prebuilt rules with missing base versions\n\n**When the base version** of a prebuilt rule that is being imported **is missing** among the `security-rule` asset saved objects, and the user imports this rule:\n\n- If this rule is not installed, it should be created with `is_customized` field set to `false`.\n- If this rule is already installed, it should be updated.\n - Its `is_customized` field should be set to `true` if the rule from the import payload is not equal to the installed rule.\n - Its `is_customized` field should be be kept unchanged (`false` or `true`) if the rule from the import payload is equal to the installed rule.","sha":"87e7cd94d1d649596dc0f23bf4cf730704fb4845","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","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] Account for missing base rule versions in is_customized calculation","number":213250,"url":"https://github.com/elastic/kibana/pull/213250","mergeCommit":{"message":"[Security Solution] Account for missing base rule versions in is_customized calculation (#213250)\n\n**Partially addresses: https://github.com/elastic/kibana/issues/210358**\n\n## Summary\n\n### Editing of prebuilt rules with missing base versions\n\n**When the base version** of a currently installed prebuilt rule **is missing** among the `security-rule` asset saved objects, and the user edits this rule:\n\n- We should mark the rule as customized, only if the new rule settings are different from the current rule settings.\n - For example, adding a new tag should mark the rule as customized. Then, if the user removes this tag, the rule should remain to be marked as customized. This matches the current behavior.\n - However, if the user saves the rule without making any changes to it, it should keep its `is_customized` field as is. This is different from the current behavior.\n\n### Importing of prebuilt rules with missing base versions\n\n**When the base version** of a prebuilt rule that is being imported **is missing** among the `security-rule` asset saved objects, and the user imports this rule:\n\n- If this rule is not installed, it should be created with `is_customized` field set to `false`.\n- If this rule is already installed, it should be updated.\n - Its `is_customized` field should be set to `true` if the rule from the import payload is not equal to the installed rule.\n - Its `is_customized` field should be be kept unchanged (`false` or `true`) if the rule from the import payload is equal to the installed rule.","sha":"87e7cd94d1d649596dc0f23bf4cf730704fb4845"}},"sourceBranch":"main","suggestedTargetBranches":["9.0"],"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,"url":"https://github.com/elastic/kibana/pull/213460","number":213460,"state":"OPEN"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/213250","number":213250,"mergeCommit":{"message":"[Security Solution] Account for missing base rule versions in is_customized calculation (#213250)\n\n**Partially addresses: https://github.com/elastic/kibana/issues/210358**\n\n## Summary\n\n### Editing of prebuilt rules with missing base versions\n\n**When the base version** of a currently installed prebuilt rule **is missing** among the `security-rule` asset saved objects, and the user edits this rule:\n\n- We should mark the rule as customized, only if the new rule settings are different from the current rule settings.\n - For example, adding a new tag should mark the rule as customized. Then, if the user removes this tag, the rule should remain to be marked as customized. This matches the current behavior.\n - However, if the user saves the rule without making any changes to it, it should keep its `is_customized` field as is. This is different from the current behavior.\n\n### Importing of prebuilt rules with missing base versions\n\n**When the base version** of a prebuilt rule that is being imported **is missing** among the `security-rule` asset saved objects, and the user imports this rule:\n\n- If this rule is not installed, it should be created with `is_customized` field set to `false`.\n- If this rule is already installed, it should be updated.\n - Its `is_customized` field should be set to `true` if the rule from the import payload is not equal to the installed rule.\n - Its `is_customized` field should be be kept unchanged (`false` or `true`) if the rule from the import payload is equal to the installed rule.","sha":"87e7cd94d1d649596dc0f23bf4cf730704fb4845"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/213462","number":213462,"state":"OPEN"}]}] BACKPORT--> Co-authored-by: Dmitrii Shevchenko <dmitrii.shevchenko@elastic.co>
- Loading branch information