Open joshnck opened 3 weeks ago
Using the output format of a backend is not the recommended way anymore to support such formats like Splunk savedsearches.conf
files. Instead, as you mentioned, query postprocessing is the way to go due to it's flexibility compared to the output format.
The Jinja2 templates in query post-processing should be able to access custom attributes with {{ rule.custom_attributes.cron_schedule }}
etc. This is also totally fine from Sigma specification point of view because Sigma is extensible by custom attributes by spec.
Take the following rule and example:
sigma convert --without-pipeline -t splunk -f savedsearches rule.yml
outputs:
I would like to modify this on a per-rule basis to give me the ability to modify the
cron_schedule
oralert.suppress.fields:
without having to modify the pipeline for each rule. This is of course possible in postprocessing in the pipeline, and I can do some logic like "if rule contains the word query, then setalert.suppress.fields
to query" or something but that isn't always possible or scalable.We've solved this by adding an optional custom section to our Sigma rules like this:
Which works fine for us and we can directly call the savedsearches.conf field names by name to modify the output. But I think this is likely a problem that other teams have and I'd be curious on if this is something that could be implemented into the backend.
It would of course deviate from the Sigma standard specifications but just appending the savedsearches.conf fields into the rules and having them interpreted by the backend during conversion would be powerful.
The ideal state is that the output is: