Detection rules CLI

Traceback (most recent call last):
  File "/usr/lib64/python3.8/", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib64/python3.8/", line 87, in _run_code
    exec(code, run_globals)
  File "/home/rootadmin/git/detection-rules/detection_rules/", line 34, in <module>
  File "/home/rootadmin/git/detection-rules/detection_rules/", line 31, in main
  File "/home/rootadmin/.local/lib/python3.8/site-packages/click/", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/rootadmin/.local/lib/python3.8/site-packages/click/", line 717, in main
    rv = self.invoke(ctx)
  File "/home/rootadmin/.local/lib/python3.8/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/rootadmin/.local/lib/python3.8/site-packages/click/", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/rootadmin/.local/lib/python3.8/site-packages/click/", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/rootadmin/git/detection-rules/detection_rules/", line 100, in import_rules
  File "/home/rootadmin/git/detection-rules/detection_rules/", line 254, in load_rule_contents
    rule = load_dump(rule_file)
  File "/home/rootadmin/.local/lib/python3.8/site-packages/eql/", line 140, in load_dump
    return toml.load(f)
  File "/home/rootadmin/.local/lib/python3.8/site-packages/toml/", line 134, in load
    return loads(, _dict, decoder)
  File "/home/rootadmin/.local/lib/python3.8/site-packages/toml/", line 455, in loads
    ret = decoder.load_line(line, currentlevel, multikey,
  File "/home/rootadmin/.local/lib/python3.8/site-packages/toml/", line 725, in load_line
    value, vtype = self.load_value(pair[1], strictly_valid)
  File "/home/rootadmin/.local/lib/python3.8/site-packages/toml/", line 802, in load_value
    return (self.load_array(v), "array")
  File "/home/rootadmin/.local/lib/python3.8/site-packages/toml/", line 914, in load_array
    a[b] = a[b] + ',' + a[b + 1]
IndexError: list index out of range

-Following steps as per the link:
-After runnung command: python3.8 -m detection_rules import-rules -d rules/windows recieving above error
-i have installed dpendancies mentioned in requirements.txt which is on github link.

Please help me out to resolve this error.


Thanks for bringing this to our attention. The issue was with a dependency which loads the toml files. An issue was already opened in the repo for this and I have a draft PR in which will resolve this. I hope to have the PR merged soon.

If you are unable to wait or are feeling adventurous, the fix is here.

Let me know if there is anything else needed and feel free to continue this conversation within the issue itself

You can just use

python -m detection_rules

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.