[Bug] ESQL Remote Validation Ignoring Rule Min-Stack#6223
[Bug] ESQL Remote Validation Ignoring Rule Min-Stack#6223terrancedejesus wants to merge 2 commits into
Conversation
Bug - GuidelinesThese guidelines serve as a reminder set of considerations when addressing a bug in the code. Documentation and Context
Code Standards and Practices
Testing
Additional Checks
|
| # stream) and raises spurious EsqlUnknownIndexError. Fall back to the minimum supported | ||
| # stack when the rule does not pin a min_stack_version. | ||
| min_stack = Version.parse( | ||
| str(metadata.min_stack_version or get_min_supported_stack_version()), |
There was a problem hiding this comment.
Nit. Is get_min_supported_stack_version needed? Its loading from the schema and get_stack_versions also loads verbatim from the schema so it should never be different right?
There was a problem hiding this comment.
Also get_min_supported_stack_version already returns a Version object so the cast to string and then back to Version is unnecessary.
| for version in get_stack_versions(): | ||
| if version in mappings_lookup: | ||
| continue | ||
| if Version.parse(version) < min_stack: |
There was a problem hiding this comment.
If for instance we min stack a rule to 9.4.1, it may not go through this section of the validation if the latest stack version is 9.4.0. Not inherently a problem, just that we need to be sure that the min stacks will not be a min stacked to a version newer than the latest version in the manifest.

Pull Request
Issue link(s):
Summary - What I changed
Adds a small change to ignore stack version validation in
ESQLValidator.remote_validate_rule()if the version is<the definedmin_stack_versionof the rule. This causes ESQL remote validation errors where the index pattern is not found in locally (integration manifests/schema) data, ultimately failing. Please see related issue for more details.How To Test
new-rule/azure-ad-graph-potential-roadrecon-enumpython -m detection_rules view-rule rules/integrations/azure/discovery_aad_graph_roadrecon_aitohttp_enumeration.toml --esql-remote-validationrule_validators.py#L928(notice it starts at lowest8.19.0and increments up) -> note this the issue and should not be evaluated herefor version in versions:loopChecklist
bug,enhancement,schema,maintenance,Rule: New,Rule: Deprecation,Rule: Tuning,Hunt: New, orHunt: Tuningso guidelines can be generatedmeta:rapid-mergelabel if planning to merge within 24 hoursContributor checklist