[8.17] [Security Solution] Fix prebuilt rules force upgrade on Endpoint policy creation (#217959)#218209
Merged
Conversation
…cy creation (#217959) **Resolves: https://github.com/elastic/security-team/issues/7216** ## Summary This PR updates the Endpoint policy callback to: - **Install only the Elastic Defend rule if it's missing**, without upgrading it to the latest version. Previously, the rule was both installed and updated whenever an Endpoint policy was created, which conflicted with rule customization. Automatic upgrades could erase existing user customizations. - **Avoid triggering the installation or upgrade of any other prebuilt rules** as part of this flow. The Endpoint package policy creation callback ([source](https://github.com/elastic/kibana/blob/f7d8bc3c25663ebd5e473087790e3a53c4901548/x-pack/solutions/security/plugins/security_solution/server/fleet_integration/fleet_integration.ts#L181-L187)) previously installed and upgraded **all** prebuilt detection rules to their target versions whenever an Endpoint policy was created. This logic relied on the legacy rule upgrade method, which has a known issue that causes all configured rule actions and exceptions to be lost. By removing the upgrade logic, this PR eliminates that incorrect behavior. (cherry picked from commit 9f5425f) # Conflicts: # x-pack/plugins/security_solution/server/fleet_integration/handlers/install_prepackaged_rules.ts
banderror
approved these changes
Apr 15, 2025
Contributor
banderror
left a comment
There was a problem hiding this comment.
The backport is identical to the main PR ✅
Contributor
💚 Build Succeeded
Metrics [docs]
|
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.17:Questions ?
Please refer to the Backport tool documentation