[8.x] [Security Solution] Skip isCustomized calculation when the feature flag is off (#201825)#202697
Merged
kibanamachine merged 1 commit intoelastic:8.xfrom Dec 3, 2024
Merged
Conversation
…ag is off (elastic#201825) **Resolves: elastic#201632 ## Summary When the rule customization feature flag is disabled, we should always return `isCustomized: false`, regardless of any changes introduced to a rule. This ensures that we do not accidentally mark prebuilt rules as customized in 8.16 with the feature flag off. For more details, refer to the related issue: elastic#201632 ### Main Changes - The primary change in this PR is encapsulated in the `calculateIsCustomized` function - Other changes involve passing the feature flag to this function - Added integration tests to cover all API CRUD operations that can be performed with rules (cherry picked from commit 22911c1)
Contributor
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
Historycc @xcrzx |
xcrzx
pushed a commit
that referenced
this pull request
Dec 4, 2024
…ture flag is off (#201825) (#202751) # Backport This will backport the following commits from `main` to `8.16`: - [[Security Solution] Skip isCustomized calculation when the feature flag is off (#201825)](#201825) <!--- Backport version: 8.9.8 --> ### 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":"2024-12-03T12:11:24Z","message":"[Security Solution] Skip isCustomized calculation when the feature flag is off (#201825)\n\n**Resolves: https://github.com/elastic/kibana/issues/201632**\r\n\r\n## Summary \r\n\r\nWhen the rule customization feature flag is disabled, we should always\r\nreturn `isCustomized: false`, regardless of any changes introduced to a\r\nrule. This ensures that we do not accidentally mark prebuilt rules as\r\ncustomized in 8.16 with the feature flag off. For more details, refer to\r\nthe related issue: https://github.com/elastic/kibana/issues/201632\r\n\r\n### Main Changes \r\n\r\n- The primary change in this PR is encapsulated in the\r\n`calculateIsCustomized` function\r\n- Other changes involve passing the feature flag to this function\r\n- Added integration tests to cover all API CRUD operations that can be\r\nperformed with rules","sha":"22911c1828f40160cf3a2935300aec18c11b56e9","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.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","Feature:Prebuilt Detection Rules","backport:version","v8.17.0","v8.18.0","v8.16.2"],"number":201825,"url":"https://github.com/elastic/kibana/pull/201825","mergeCommit":{"message":"[Security Solution] Skip isCustomized calculation when the feature flag is off (#201825)\n\n**Resolves: https://github.com/elastic/kibana/issues/201632**\r\n\r\n## Summary \r\n\r\nWhen the rule customization feature flag is disabled, we should always\r\nreturn `isCustomized: false`, regardless of any changes introduced to a\r\nrule. This ensures that we do not accidentally mark prebuilt rules as\r\ncustomized in 8.16 with the feature flag off. For more details, refer to\r\nthe related issue: https://github.com/elastic/kibana/issues/201632\r\n\r\n### Main Changes \r\n\r\n- The primary change in this PR is encapsulated in the\r\n`calculateIsCustomized` function\r\n- Other changes involve passing the feature flag to this function\r\n- Added integration tests to cover all API CRUD operations that can be\r\nperformed with rules","sha":"22911c1828f40160cf3a2935300aec18c11b56e9"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201825","number":201825,"mergeCommit":{"message":"[Security Solution] Skip isCustomized calculation when the feature flag is off (#201825)\n\n**Resolves: https://github.com/elastic/kibana/issues/201632**\r\n\r\n## Summary \r\n\r\nWhen the rule customization feature flag is disabled, we should always\r\nreturn `isCustomized: false`, regardless of any changes introduced to a\r\nrule. This ensures that we do not accidentally mark prebuilt rules as\r\ncustomized in 8.16 with the feature flag off. For more details, refer to\r\nthe related issue: https://github.com/elastic/kibana/issues/201632\r\n\r\n### Main Changes \r\n\r\n- The primary change in this PR is encapsulated in the\r\n`calculateIsCustomized` function\r\n- Other changes involve passing the feature flag to this function\r\n- Added integration tests to cover all API CRUD operations that can be\r\nperformed with rules","sha":"22911c1828f40160cf3a2935300aec18c11b56e9"}},{"branch":"8.17","label":"v8.17.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/202696","number":202696,"state":"MERGED","mergeCommit":{"sha":"487149e077e61341f81c871b74f36a9e20df67c0","message":"[8.17] [Security Solution] Skip isCustomized calculation when the feature flag is off (#201825) (#202696)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.17`:\n- [[Security Solution] Skip isCustomized calculation when the feature\nflag is off (#201825)](https://github.com/elastic/kibana/pull/201825)\n\n<!--- Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT [{\"author\":{\"name\":\"Dmitrii\nShevchenko\",\"email\":\"dmitrii.shevchenko@elastic.co\"},\"sourceCommit\":{\"committedDate\":\"2024-12-03T12:11:24Z\",\"message\":\"[Security\nSolution] Skip isCustomized calculation when the feature flag is off\n(#201825)\\n\\n**Resolves:\nhttps://github.com//issues/201632**\\r\\n\\r\\n## Summary\n\\r\\n\\r\\nWhen the rule customization feature flag is disabled, we should\nalways\\r\\nreturn `isCustomized: false`, regardless of any changes\nintroduced to a\\r\\nrule. This ensures that we do not accidentally mark\nprebuilt rules as\\r\\ncustomized in 8.16 with the feature flag off. For\nmore details, refer to\\r\\nthe related issue:\nhttps://github.com//issues/201632\\r\\n\\r\\n### Main Changes\n\\r\\n\\r\\n- The primary change in this PR is encapsulated in\nthe\\r\\n`calculateIsCustomized` function\\r\\n- Other changes involve\npassing the feature flag to this function\\r\\n- Added integration tests\nto cover all API CRUD operations that can be\\r\\nperformed with\nrules\",\"sha\":\"22911c1828f40160cf3a2935300aec18c11b56e9\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.18.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"bug\",\"release_note:skip\",\"v9.0.0\",\"Team:Detections\nand Resp\",\"Team: SecuritySolution\",\"Team:Detection Rule\nManagement\",\"Feature:Prebuilt Detection\nRules\",\"backport:version\",\"v8.17.0\",\"v8.18.0\",\"v8.16.2\"],\"title\":\"[Security\nSolution] Skip isCustomized calculation when the feature flag is\noff\",\"number\":201825,\"url\":\"https://github.com/elastic/kibana/pull/201825\",\"mergeCommit\":{\"message\":\"[Security\nSolution] Skip isCustomized calculation when the feature flag is off\n(#201825)\\n\\n**Resolves:\nhttps://github.com//issues/201632**\\r\\n\\r\\n## Summary\n\\r\\n\\r\\nWhen the rule customization feature flag is disabled, we should\nalways\\r\\nreturn `isCustomized: false`, regardless of any changes\nintroduced to a\\r\\nrule. This ensures that we do not accidentally mark\nprebuilt rules as\\r\\ncustomized in 8.16 with the feature flag off. For\nmore details, refer to\\r\\nthe related issue:\nhttps://github.com//issues/201632\\r\\n\\r\\n### Main Changes\n\\r\\n\\r\\n- The primary change in this PR is encapsulated in\nthe\\r\\n`calculateIsCustomized` function\\r\\n- Other changes involve\npassing the feature flag to this function\\r\\n- Added integration tests\nto cover all API CRUD operations that can be\\r\\nperformed with\nrules\",\"sha\":\"22911c1828f40160cf3a2935300aec18c11b56e9\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[\"8.17\",\"8.x\",\"8.16\"],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/201825\",\"number\":201825,\"mergeCommit\":{\"message\":\"[Security\nSolution] Skip isCustomized calculation when the feature flag is off\n(#201825)\\n\\n**Resolves:\nhttps://github.com//issues/201632**\\r\\n\\r\\n## Summary\n\\r\\n\\r\\nWhen the rule customization feature flag is disabled, we should\nalways\\r\\nreturn `isCustomized: false`, regardless of any changes\nintroduced to a\\r\\nrule. This ensures that we do not accidentally mark\nprebuilt rules as\\r\\ncustomized in 8.16 with the feature flag off. For\nmore details, refer to\\r\\nthe related issue:\nhttps://github.com//issues/201632\\r\\n\\r\\n### Main Changes\n\\r\\n\\r\\n- The primary change in this PR is encapsulated in\nthe\\r\\n`calculateIsCustomized` function\\r\\n- Other changes involve\npassing the feature flag to this function\\r\\n- Added integration tests\nto cover all API CRUD operations that can be\\r\\nperformed with\nrules\",\"sha\":\"22911c1828f40160cf3a2935300aec18c11b56e9\"}},{\"branch\":\"8.17\",\"label\":\"v8.17.0\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"8.x\",\"label\":\"v8.18.0\",\"branchLabelMappingKey\":\"^v8.18.0$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"8.16\",\"label\":\"v8.16.2\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"}]}]\nBACKPORT-->\n\nCo-authored-by: Dmitrii Shevchenko <dmitrii.shevchenko@elastic.co>"}},{"branch":"8.x","label":"v8.18.0","labelRegex":"^v8.18.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/202697","number":202697,"state":"MERGED","mergeCommit":{"sha":"8c9181aa48796a8467e38ad1431238ebaa78de7e","message":"[8.x] [Security Solution] Skip isCustomized calculation when the feature flag is off (#201825) (#202697)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.x`:\n- [[Security Solution] Skip isCustomized calculation when the feature\nflag is off (#201825)](https://github.com/elastic/kibana/pull/201825)\n\n<!--- Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT [{\"author\":{\"name\":\"Dmitrii\nShevchenko\",\"email\":\"dmitrii.shevchenko@elastic.co\"},\"sourceCommit\":{\"committedDate\":\"2024-12-03T12:11:24Z\",\"message\":\"[Security\nSolution] Skip isCustomized calculation when the feature flag is off\n(#201825)\\n\\n**Resolves:\nhttps://github.com//issues/201632**\\r\\n\\r\\n## Summary\n\\r\\n\\r\\nWhen the rule customization feature flag is disabled, we should\nalways\\r\\nreturn `isCustomized: false`, regardless of any changes\nintroduced to a\\r\\nrule. This ensures that we do not accidentally mark\nprebuilt rules as\\r\\ncustomized in 8.16 with the feature flag off. For\nmore details, refer to\\r\\nthe related issue:\nhttps://github.com//issues/201632\\r\\n\\r\\n### Main Changes\n\\r\\n\\r\\n- The primary change in this PR is encapsulated in\nthe\\r\\n`calculateIsCustomized` function\\r\\n- Other changes involve\npassing the feature flag to this function\\r\\n- Added integration tests\nto cover all API CRUD operations that can be\\r\\nperformed with\nrules\",\"sha\":\"22911c1828f40160cf3a2935300aec18c11b56e9\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.18.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"bug\",\"release_note:skip\",\"v9.0.0\",\"Team:Detections\nand Resp\",\"Team: SecuritySolution\",\"Team:Detection Rule\nManagement\",\"Feature:Prebuilt Detection\nRules\",\"backport:version\",\"v8.17.0\",\"v8.18.0\",\"v8.16.2\"],\"title\":\"[Security\nSolution] Skip isCustomized calculation when the feature flag is\noff\",\"number\":201825,\"url\":\"https://github.com/elastic/kibana/pull/201825\",\"mergeCommit\":{\"message\":\"[Security\nSolution] Skip isCustomized calculation when the feature flag is off\n(#201825)\\n\\n**Resolves:\nhttps://github.com//issues/201632**\\r\\n\\r\\n## Summary\n\\r\\n\\r\\nWhen the rule customization feature flag is disabled, we should\nalways\\r\\nreturn `isCustomized: false`, regardless of any changes\nintroduced to a\\r\\nrule. This ensures that we do not accidentally mark\nprebuilt rules as\\r\\ncustomized in 8.16 with the feature flag off. For\nmore details, refer to\\r\\nthe related issue:\nhttps://github.com//issues/201632\\r\\n\\r\\n### Main Changes\n\\r\\n\\r\\n- The primary change in this PR is encapsulated in\nthe\\r\\n`calculateIsCustomized` function\\r\\n- Other changes involve\npassing the feature flag to this function\\r\\n- Added integration tests\nto cover all API CRUD operations that can be\\r\\nperformed with\nrules\",\"sha\":\"22911c1828f40160cf3a2935300aec18c11b56e9\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[\"8.17\",\"8.x\",\"8.16\"],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/201825\",\"number\":201825,\"mergeCommit\":{\"message\":\"[Security\nSolution] Skip isCustomized calculation when the feature flag is off\n(#201825)\\n\\n**Resolves:\nhttps://github.com//issues/201632**\\r\\n\\r\\n## Summary\n\\r\\n\\r\\nWhen the rule customization feature flag is disabled, we should\nalways\\r\\nreturn `isCustomized: false`, regardless of any changes\nintroduced to a\\r\\nrule. This ensures that we do not accidentally mark\nprebuilt rules as\\r\\ncustomized in 8.16 with the feature flag off. For\nmore details, refer to\\r\\nthe related issue:\nhttps://github.com//issues/201632\\r\\n\\r\\n### Main Changes\n\\r\\n\\r\\n- The primary change in this PR is encapsulated in\nthe\\r\\n`calculateIsCustomized` function\\r\\n- Other changes involve\npassing the feature flag to this function\\r\\n- Added integration tests\nto cover all API CRUD operations that can be\\r\\nperformed with\nrules\",\"sha\":\"22911c1828f40160cf3a2935300aec18c11b56e9\"}},{\"branch\":\"8.17\",\"label\":\"v8.17.0\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"8.x\",\"label\":\"v8.18.0\",\"branchLabelMappingKey\":\"^v8.18.0$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"8.16\",\"label\":\"v8.16.2\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"}]}]\nBACKPORT-->\n\nCo-authored-by: Dmitrii Shevchenko <dmitrii.shevchenko@elastic.co>"}},{"branch":"8.16","label":"v8.16.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.x:Questions ?
Please refer to the Backport tool documentation