Skip to content

Trailing backslashes escape wildcards added by modifiers #431

@thomaspatzke

Description

@thomaspatzke

From the community Discord:

When converting a Sigma rule to the EQL using the elastic backend and the ecs_windows pipeline, strings ending with a backslash immediately followed by a wildcard (due to the contains modifier) are not correctly escaped in the final query.

Example of incorrect output for a rule matching on the path \Desktop\:
The backend would generate:
... like~ ("*\\Desktop\*")
(Note: The \ before the final * is not escaped)

Expected correct output for the same rule:
The query should have a double backslash before the final wildcard to represent a literal escaped backslash:
... like~ ("*\\Desktop\\*")
(Note: The \ before the final * is now escaped as \\)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions