Skip to content

[8.18] [Security Solution] Batch prebuilt rule installation (#214441)#214575

Merged
kibanamachine merged 1 commit intoelastic:8.18from
kibanamachine:backport/8.18/pr-214441
Mar 14, 2025
Merged

[8.18] [Security Solution] Batch prebuilt rule installation (#214441)#214575
kibanamachine merged 1 commit intoelastic:8.18from
kibanamachine:backport/8.18/pr-214441

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.18:

Questions ?

Please refer to the Backport tool documentation

**This is a follow-up to:elastic#211045

## Summary

This PR removes inefficiencies in prebuilt rule installation memory
consumption.

### Before

In the worst-case scenario:

1. All currently installed prebuilt rules were fully loaded into memory.
2. All latest rule versions from the rule packages were fully loaded
into memory.
3. All base rule versions were pulled into memory, even though they were
not used.
4. The algorithm then checked which rules could be installed and
installed them all at once.

### After

1. Pull only aggregated information about installed rules (only
`rule_id` and `versions`).
2. Pull the same lightweight aggregated info about the latest rules in
the package.
3. Using the collected `rule_id`s, fetch rule assets and install them in
small batches of up to 100 rules.

(cherry picked from commit 6d9fc21)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Mar 14, 2025
@kibanamachine kibanamachine enabled auto-merge (squash) March 14, 2025 13:45
@kibanamachine kibanamachine merged commit 482eec6 into elastic:8.18 Mar 14, 2025
11 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @xcrzx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants