There appears to be a bug when trying to convert certain rules with multiple numeric values (SigmaNumber objects), as is seen in over two dozen Windows security rules. Example rules from SigmaHQ include:
Here's the traceback from running the CLI converter:
$ sigma convert -t kusto win_security_aadhealth_mon_agent_regkey_access.yml
Parsing Sigma rules [####################################] 100%
Traceback (most recent call last):
File "/venv/bin/sigma", line 8, in <module>
sys.exit(main())
File "/venv/lib/python3.10/site-packages/sigma/cli/main.py", line 81, in main
cli()
File "/venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/venv/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/venv/lib/python3.10/site-packages/sigma/cli/convert.py", line 287, in convert
result = backend.convert(rule_collection, format, correlation_method)
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 164, in convert
queries = [
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 168, in <listcomp>
self.convert_rule(rule, output_format or self.default_format)
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 197, in convert_rule
queries = [
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 198, in <listcomp>
self.convert_condition(cond.parsed, states[index])
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 515, in convert_condition
return self.convert_condition_and(cond, state)
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 1146, in convert_condition_and
return joiner.join(
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 1147, in <genexpr>
(
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 1153, in <genexpr>
else self.convert_condition_group(arg, state)
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 1079, in convert_condition_group
expr = self.convert_condition(cond, state)
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 515, in convert_condition
return self.convert_condition_and(cond, state)
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 1146, in convert_condition_and
return joiner.join(
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 1147, in <genexpr>
(
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 1153, in <genexpr>
else self.convert_condition_group(arg, state)
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 1079, in convert_condition_group
expr = self.convert_condition(cond, state)
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 508, in convert_condition
return self.convert_condition_as_in_expression(cond, state)
File "/venv/lib/python3.10/site-packages/sigma/backends/kusto/kusto.py", line 179, in convert_condition_as_in_expression
[
File "/venv/lib/python3.10/site-packages/sigma/backends/kusto/kusto.py", line 180, in <listcomp>
self.convert_value_str(arg.value, state)
File "/venv/lib/python3.10/site-packages/sigma/backends/kusto/kusto.py", line 236, in convert_value_str
converted = super().convert_value_str(s, state)
File "/venv/lib/python3.10/site-packages/sigma/conversion/base.py", line 1262, in convert_value_str
converted = s.convert(
AttributeError: 'SigmaNumber' object has no attribute 'convert' (while converting rule /repos/sigma/rules/windows/builtin/security/win_security_aadhealth_mon_agent_regkey_access.yml)
I also noticed the same behavior in ETW Logging Disabled In .NET Processes - Sysmon Registry which from what I can tell would be caused by the Details statement in the detection, due to the mix of numeric and non-numeric values (best guess).
Details:
- 0 # For REG_SZ type
- 'DWORD (0x00000000)'
I really appreciate your efforts on this much-needed Sigma backend! If interested, here's the full list of rule IDs from SigmaHQ:
Thanks for reporting this issue and the detailed list of rules that fail! I've been busy with the other SecOps backend, but I can tackle this issue next week.
There appears to be a bug when trying to convert certain rules with multiple numeric values (
SigmaNumber
objects), as is seen in over two dozen Windows security rules. Example rules from SigmaHQ include:Here's the traceback from running the CLI converter:
I also noticed the same behavior in ETW Logging Disabled In .NET Processes - Sysmon Registry which from what I can tell would be caused by the
Details
statement in the detection, due to the mix of numeric and non-numeric values (best guess).I really appreciate your efforts on this much-needed Sigma backend! If interested, here's the full list of rule IDs from SigmaHQ: