-
Notifications
You must be signed in to change notification settings - Fork 17
/
sigma.go
36 lines (30 loc) · 976 Bytes
/
sigma.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package sigma
// Keyworder implements keywords sigma rule type on arbitrary event
// Should return list of fields that are relevant for rule matching
type Keyworder interface {
// Keywords implements Keyworder
Keywords() ([]string, bool)
}
// Selector implements selection sigma rule type
type Selector interface {
// Select implements Selector
Select(string) (interface{}, bool)
}
// Event implements sigma rule types by embedding Keyworder and Selector
// Used by rules to extract relevant fields
type Event interface {
Keyworder
Selector
}
// Matcher is used for implementing Abstract Syntax Tree for Sigma engine
type Matcher interface {
// Match implements Matcher
Match(Event) (bool, bool)
}
// Branch implements Matcher with additional methods for walking and debugging the tree
type Branch interface {
Matcher
// Self returns Node or final rule object for debugging and/or walking the tree
// Must be type switched externally
// Self() interface{}
}