mirror of
https://github.com/valitydev/SigmaHQ.git
synced 2024-11-07 09:48:58 +00:00
Structured backends module with comments
This commit is contained in:
parent
998bb0079d
commit
6a29884615
@ -17,6 +17,8 @@ def getBackend(name):
|
||||
except KeyError as e:
|
||||
raise LookupError("Backend not found") from e
|
||||
|
||||
### Generic base classes
|
||||
|
||||
class BaseBackend:
|
||||
"""Base class for all backends"""
|
||||
identifier = "base"
|
||||
@ -77,6 +79,8 @@ class BaseBackend:
|
||||
def generateAggregation(self, agg):
|
||||
raise NotImplementedError("Aggregations not implemented for this backend")
|
||||
|
||||
### Backends for specific SIEMs
|
||||
|
||||
class ElasticsearchQuerystringBackend(BaseBackend):
|
||||
"""Converts Sigma rule into Elasticsearch query string. Only searches, no aggregations."""
|
||||
identifier = "es-qs"
|
||||
@ -208,6 +212,8 @@ class SplunkBackend(BaseBackend):
|
||||
else:
|
||||
return " | stats %s(%s) as val by %s | search val %s %s" % (agg.aggfunc_notrans, agg.aggfield, agg.groupfield, agg.cond_op, agg.condition)
|
||||
|
||||
### Backends for developement purposes
|
||||
|
||||
class FieldnameListBackend(BaseBackend):
|
||||
"""List all fieldnames from given Sigma rules for creation of a field mapping configuration."""
|
||||
identifier = "fieldlist"
|
||||
|
Loading…
Reference in New Issue
Block a user