-
Notifications
You must be signed in to change notification settings - Fork 589
feat: ESQL query validation against Elastic cluster #4955
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
base: main
Are you sure you want to change the base?
Conversation
@@ -1432,15 +1432,14 @@ def get_packaged_integrations( | |||
# if both exist, rule tags are only used if defined in definitions for non-dataset packages | |||
# of machine learning analytic packages | |||
|
|||
rule_integrations = meta.get("integration", []) | |||
if rule_integrations: | |||
for integration in rule_integrations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simple style fix, replacing if
condition with a more robust default value condition via
rule_integrations = meta.get("integration") or []
@@ -1754,7 +1753,7 @@ def parse_datasets(datasets: list[str], package_manifest: dict[str, Any]) -> lis | |||
else: | |||
package = value | |||
|
|||
if package in list(package_manifest): | |||
if package in package_manifest: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small style fix
|
||
log(f"Got query columns: {', '.join(query_column_names)}") | ||
|
||
# FIXME: validate the dynamic columns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The columns returned from the cluster must be validated against the input mapping, and the dynamic fields checked for validity.
at the moment (before any field validation) the test marks 33 rules out of 75 as invalid. The tests were executed against a vanilla local The many errors are most probably because of the bugs in the code, so I expect the number of invalid rules to go down after those are fixed. full log
|
Pull Request
Issue link(s):
Summary - What I changed
How To Test
.detection-rules-cfg.yml
) or from the environment variablesChecklist
bug
,enhancement
,schema
,maintenance
,Rule: New
,Rule: Deprecation
,Rule: Tuning
,Hunt: New
, orHunt: Tuning
so guidelines can be generatedmeta:rapid-merge
label if planning to merge within 24 hoursContributor checklist