-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fleet] Stream-based programmatic API for installing packages #187646
Comments
Pinging @elastic/fleet (Team:Fleet) |
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
Update from @kpollich:
Update from @xcrzx:
Thank you both. With that, I'm removing the 8.16 target from this one. We'll be working on the optimized package installation within a separate ticket #192350. |
Epics: https://github.com/elastic/security-team/issues/1974 (internal), #174168
Summary
Recently we had an incident in Serverless where Kibana instances would crash with an OOM because of an installation of the
security_detection_engine
Fleet package that Security Solution uses to distribute prebuilt detection rules. Fleet loads whole packages into memory before installing their assets, and this package had become too big for that. The incident has been mitigated by temporarily decreasing the number of assets in the package by ~50%. However, this is a short-term measure that we cannot keep for a long time. We need a fundamental solution to this problem in Fleet itself.Our idea is to introduce a stream-based API for installing Fleet packages:
PackageClient
) available for Security Solution on the server side, and not available to Kibana users via HTTP. Security Solution would wrap this API with its own HTTP API endpoint for installation of thesecurity_detection_engine
package.We hope this solution would help us prevent spikes in memory usage when installing the
security_detection_engine
package.Details
This is where/how Security Solution installs the package on the server side:
kibana/x-pack/plugins/security_solution/server/lib/detection_engine/prebuilt_rules/api/install_prebuilt_rules_and_timelines/install_prebuilt_rules_package.ts
Lines 38 to 41 in 1040bae
The corresponding method of the
PackageClient
is:kibana/x-pack/plugins/fleet/server/services/epm/package_service.ts
Lines 71 to 76 in 1040bae
We would need a stream-based alternative of the
ensureInstalledPackage
method.It could be done via adding an option to the existing method:
Or via adding a new method:
The text was updated successfully, but these errors were encountered: