Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions detection_rules/rule_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ def dump_str(self, v: str | NonformattedField) -> str:
return "\n".join([TRIPLE_SQ] + [self._old_dump_str(line)[1:-1] for line in lines] + [TRIPLE_SQ])
if raw:
return f"'{lines[0]:s}'"
if "\\\\x" in v:
return f'"{v!s}"'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we will want a new unit test in test_toml_formatter.py

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ agreed, added new unit test that looks for this specifically. It also will fail if the path behavior changes. E.g. currently we expect \\\\ to be formatted to \\. If this changes the unit test will fail on purpose as we want to match Query DSL's path handling which does this as well.

return self._old_dump_str(v)

def _dump_flat_list(self, v: Iterable[Any]) -> str:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "detection_rules"
version = "1.3.23"
version = "1.3.24"
description = "Detection Rules is the home for rules used by Elastic Security. This repository is used for the development, maintenance, testing, validation, and release of rules for Elastic Security’s Detection Engine."
readme = "README.md"
requires-python = ">=3.12"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
creation_date = "2020/08/14"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2025/03/20"
updated_date = "2025/08/13"

[rule]
author = ["Elastic"]
Expand Down Expand Up @@ -106,14 +106,14 @@ value = "?:\\\\Windows\\\\Sys?????\\\\PrintConfig.dll"
negate = true
[rule.filters.query.wildcard."file.path"]
case_insensitive = true
value = "?:\\Windows\\Sys?????\\u005lrs.dll"
value = "?:\\Windows\\Sys?????\\x5lrs.dll"
[[rule.filters]]

[rule.filters.meta]
negate = true
[rule.filters.query.wildcard."file.path"]
case_insensitive = true
value = "?:\\Windows\\system32\\spool\\DRIVERS\\u0064\\\\*.dll"
value = "?:\\Windows\\system32\\spool\\DRIVERS\\x64\\*.dll"
[[rule.filters]]

[rule.filters.meta]
Expand All @@ -127,7 +127,7 @@ value = "?:\\\\Windows\\\\system32\\\\spool\\\\DRIVERS\\\\W32X86\\\\*.dll"
negate = true
[rule.filters.query.wildcard."file.path"]
case_insensitive = true
value = "?:\\Windows\\system32\\spool\\PRTPROCS\\u0064\\\\*.dll"
value = "?:\\Windows\\system32\\spool\\PRTPROCS\\x64\\*.dll"
[[rule.filters]]

[rule.filters.meta]
Expand Down
Loading