Repository navigation
[Rule Tuning] Fix quoted KQL wildcards in four rules - #7216
Open
LiamCarPer wants to merge 1 commit into
Open
LiamCarPer wants to merge 1 commit into
LiamCarPer wants to merge 1 commit into
Conversation
Unquote wildcard values in KQL queries so the patterns match as wildcards instead of literal asterisks, as reported in elastic#7214. Escape literal colons and embedded quotes where the values are now unquoted, and add regression tests asserting these values parse as Wildcard nodes.
LiamCarPer
marked this pull request as ready for review
November 22, 2026 05:50
LiamCarPer
requested review from
Mikaayenson and
eric-forte-elastic
as code owners
November 22, 2026 05:50
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue link(s): Fixes #7214
Summary - What I changed
KQL treats
*inside double quotes as a literal character, so several prebuilt rule queries contained wildcard-looking values that could never match as patterns. This PR moves the wildcards outside the quoted values in the four affected rules:rules/network/initial_access_splunk_postgres_recovery_body_injection.toml— unquotes theurl.pathrecovery endpoint gate, thehttp.request.body.contentfilename/database markers, and the two status-400url.pathvalues. Embedded quotes are escaped as\".rules/cross-platform/impact_destructive_aws_cli_execution_by_genai_agent.toml— unquotes theprocess.args--dry-run*,--help*,-help*, and--version*exclusions.rules/cross-platform/discovery_cloud_offensive_framework_execution.toml— unquotes the*site-packages/pip*exclusion arm.rules/windows/persistence_webshell_detection.toml— unquotes the WAMP Apache parent path, escaping the literal:asE\:/....I also bumped
updated_dateto2026/11/22for each tuned rule and addedTestKqlQuotedWildcardstotests/test_specific_rules.py, which asserts the corrected values parse asWildcardAST nodes for the intended fields and that these rules contain no quoted values with*.How To Test
The
PYTHONPATH=prefix only clears a local ROS pytest plugin that otherwise fails to load; it does not affect the repository code under test.Checklist
bug,enhancement,schema,maintenance,Rule: New,Rule: Deprecation,Rule: Tuning,Hunt: New, orHunt: Tuningso guidelines can be generated — I could not apply labels from the fork (GitHub returns 403, maintainer/admin rights required); please addRule: Tuning.meta:rapid-mergelabel if planning to merge within 24 hoursContributor checklist