Documentation
¶
Index ¶
- func FuzzConditionParser(data []byte) int
- func FuzzConfigParser(data []byte) int
- func FuzzRuleParser(data []byte) int
- type AggregationExpr
- type AggregationFunc
- type AllOfIdentifier
- type AllOfPattern
- type AllOfThem
- type And
- type Average
- type Comparison
- type ComparisonOp
- type Condition
- type Conditions
- type Config
- type Count
- type Detection
- type EventMatcher
- type FieldMapping
- type FieldMatcher
- type FileType
- type Logsource
- type LogsourceIndexes
- type LogsourceMapping
- type Max
- type Min
- type Near
- type Not
- type OneOfIdentifier
- type OneOfPattern
- type OneOfThem
- type Or
- type RelatedRule
- type Rule
- type Search
- type SearchExpr
- type SearchIdentifier
- type Sum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FuzzConditionParser ¶
func FuzzConfigParser ¶
func FuzzRuleParser ¶
Types ¶
type AggregationExpr ¶
type AggregationExpr interface {
// contains filtered or unexported methods
}
type AggregationFunc ¶
type AggregationFunc interface {
// contains filtered or unexported methods
}
type AllOfIdentifier ¶
type AllOfIdentifier struct {
Ident SearchIdentifier
}
type AllOfPattern ¶
type AllOfPattern struct {
Pattern string
}
type And ¶
type And []SearchExpr
type Comparison ¶
type Comparison struct { Func AggregationFunc Op ComparisonOp Threshold float64 }
type ComparisonOp ¶
type ComparisonOp string
var ( Equal ComparisonOp = "=" NotEqual ComparisonOp = "!=" LessThan ComparisonOp = "<" LessThanEqual ComparisonOp = "<=" GreaterThan ComparisonOp = ">" GreaterThanEqual ComparisonOp = ">=" )
type Condition ¶
type Condition struct { Search SearchExpr `yaml:",omitempty" json:",omitempty"` Aggregation AggregationExpr `yaml:",omitempty" json:",omitempty"` // contains filtered or unexported fields }
func ParseCondition ¶
Parses the Sigma condition syntax
func (Condition) MarshalYAML ¶
type Conditions ¶
type Conditions []Condition
func (Conditions) MarshalYAML ¶
func (c Conditions) MarshalYAML() (interface{}, error)
Marshal the conditions back to grammar expressions :sob:
func (*Conditions) UnmarshalYAML ¶
func (c *Conditions) UnmarshalYAML(node *yaml.Node) error
type Config ¶
type Config struct { Title string // A short description of what this configuration does Order int // Defines the order of expansion when multiple config files are applicable Backends []string // Lists the Sigma implementations that this config file is compatible with FieldMappings map[string]FieldMapping Logsources map[string]LogsourceMapping // TODO: LogsourceMerging option DefaultIndex string // Defines a default index if no logsources match Placeholders map[string][]interface{} // Defines values for placeholders that might appear in Sigma rules }
func ParseConfig ¶
type Detection ¶
type Detection struct { Searches map[string]Search `yaml:",inline" json:",inline"` Conditions Conditions `yaml:"condition" json:"condition"` Timeframe time.Duration `yaml:",omitempty" json:",omitempty"` }
func (*Detection) UnmarshalYAML ¶
type EventMatcher ¶
type EventMatcher []FieldMatcher
func (EventMatcher) MarshalYAML ¶
func (f EventMatcher) MarshalYAML() (interface{}, error)
func (*EventMatcher) UnmarshalYAML ¶
func (f *EventMatcher) UnmarshalYAML(node *yaml.Node) error
type FieldMapping ¶
type FieldMapping struct {
TargetNames []string // The name(s) that appear in the events being matched
}
func (*FieldMapping) UnmarshalYAML ¶
func (f *FieldMapping) UnmarshalYAML(value *yaml.Node) error
type FieldMatcher ¶
type FieldMatcher struct { Field string `yaml:",omitempty" json:",omitempty"` Modifiers []string `yaml:",omitempty" json:",omitempty"` Values []interface{} `yaml:",omitempty" json:",omitempty"` // contains filtered or unexported fields }
func (FieldMatcher) Position ¶
func (f FieldMatcher) Position() (int, int)
Position returns the line and column of this FieldMatcher in the original input
type Logsource ¶
type Logsource struct { Category string `yaml:",omitempty" json:",omitempty"` Product string `yaml:",omitempty" json:",omitempty"` Service string `yaml:",omitempty" json:",omitempty"` Definition string `yaml:",omitempty" json:",omitempty"` // Any non-standard fields will end up in here AdditionalFields map[string]interface{} `yaml:",inline,omitempty" json:",inline,omitempty"` }
type LogsourceIndexes ¶
type LogsourceIndexes []string
func (*LogsourceIndexes) UnmarshalYAML ¶
func (i *LogsourceIndexes) UnmarshalYAML(value *yaml.Node) error
type LogsourceMapping ¶
type LogsourceMapping struct { Logsource `yaml:",inline"` // Matches the logsource field in Sigma rules Index LogsourceIndexes // The index(es) that should be used Conditions Search // Conditions that are added to all rules targeting this logsource Rewrite Logsource // Rewrites this logsource (i.e. so that it can be matched by another lower precedence config) }
type Near ¶
type Near struct {
Condition SearchExpr
}
type Not ¶
type Not struct {
Expr SearchExpr
}
type OneOfIdentifier ¶
type OneOfIdentifier struct {
Ident SearchIdentifier
}
type OneOfPattern ¶
type OneOfPattern struct {
Pattern string
}
type Or ¶
type Or []SearchExpr
type RelatedRule ¶
type Rule ¶
type Rule struct { // Required fields Title string Logsource Logsource Detection Detection ID string `yaml:",omitempty" json:",omitempty"` Related []RelatedRule `yaml:",omitempty" json:",omitempty"` Status string `yaml:",omitempty" json:",omitempty"` Description string `yaml:",omitempty" json:",omitempty"` Author string `yaml:",omitempty" json:",omitempty"` Level string `yaml:",omitempty" json:",omitempty"` References []string `yaml:",omitempty" json:",omitempty"` Tags []string `yaml:",omitempty" json:",omitempty"` // Any non-standard fields will end up in here AdditionalFields map[string]interface{} `yaml:",inline,omitempty" json:",inline,omitempty"` }
type Search ¶
type Search struct { Keywords []string `yaml:",omitempty" json:",omitempty"` EventMatchers []EventMatcher `yaml:",omitempty" json:",omitempty"` // contains filtered or unexported fields }
func (Search) MarshalYAML ¶
func (*Search) UnmarshalYAML ¶
type SearchExpr ¶
type SearchExpr interface {
// contains filtered or unexported methods
}
type SearchIdentifier ¶
type SearchIdentifier struct {
Name string
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.