Open veramine opened 2 years ago
Ah excellent timing, I think https://github.com/bradleyjkemp/sigma-go/commit/5321737c16094b41006889dd51bb40a6209651d9 actually fixes this (or at least downgrades it to an error)
The underlying cause is sigma-go
thinking %public%
is a placeholder (which I think it is?) but not having any way to expand that.
Better default behaviour might be to just assume all placeholders are empty but for know you can do this yourself using the WithPlaceholderExpander
option: https://github.com/bradleyjkemp/sigma-go/blob/5321737c16094b41006889dd51bb40a6209651d9/evaluator/options.go#L29
Yep that worked fine, thanks!
//r := evaluator.ForRule(rule, evaluator.WithConfig(config))
r := evaluator.ForRule(rule, evaluator.WithConfig(config), evaluator.WithPlaceholderExpander(func(ctx context.Context, placeholderName string) ([]string, error) {
return nil, nil
}))
I'm using sigma-go along with the public Sigma process_creation rules and found several that segfault like this:
These two rules in particular:
https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_bitsadmin_download_susp_targetfolder.yml https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_control_panel_item.yml
Notice that both these rules are looking for fields with a %. When I remove those %s, it no longer segfaults.