-
Notifications
You must be signed in to change notification settings - Fork 456
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
RuleLoader
cleanup and optimizations
#2609
Comments
An example of something related is the "validate against ECS/Beats/Non-ECS.json AND THEN validate against integrations schema" logic. Related: #2627 A stop-gap may be to add a small patch to this validation logic. In the meantime any integration rule that uses EQL can have the integration specific fields added to the non-ecs file. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This has been closed due to inactivity. If you feel this is an error, please re-open and include a justifying comment. |
|
Adding a couple skips in key places throughout the code where we looped through ALL stack versions or ALL integration versions, etc, essentially limiting validation to the latest versions. if os.environ["DR_FAST"]:
break Toggling the environment variable, I consistently saw faster speeds, which is expected since we're NOT traversing EVERY version.
|
Overview
The purpose of this is to identify opportunities to clean up the code that makes up the rule loader (
Rule
,rule_validator
s, etc.). Loading the rules has gotten significantly slower and while some of it is due to the necessity of expanding validation, this should explore opportunities for optimization.rule loader profiling
Observations
data
indetection-rules/detection_rules/rule_validators.py
Line 251 in 6635901
Version.parse
instead of parsing for every ruledetection-rules/detection_rules/rule.py
Line 356 in 6635901
detection-rules/detection_rules/rule.py
Lines 491 to 492 in 6635901
cached_property
likeQueryRuleData
detection-rules/detection_rules/rule.py
Lines 489 to 490 in 6635901
The text was updated successfully, but these errors were encountered: