engine

package
v0.0.0-...-48d9f46 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertSeverity

type AlertSeverity string

AlertSeverity represents the severity level of an alert

const (
	SeverityLow      AlertSeverity = "low"
	SeverityMedium   AlertSeverity = "medium"
	SeverityHigh     AlertSeverity = "high"
	SeverityCritical AlertSeverity = "critical"
)

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine wraps the sigma rule evaluation with security protections

func NewEngine

func NewEngine(rulesDir string) (*Engine, error)

NewEngine creates a new rule engine

func (*Engine) Evaluate

func (e *Engine) Evaluate(fields map[string]string) []RuleResult

Evaluate evaluates an event against all loaded rules. Returns only rules that matched the input fields.

func (*Engine) GetLoadedRules

func (e *Engine) GetLoadedRules() []RuleResult

GetLoadedRules returns information about currently loaded rules

func (*Engine) GetStats

func (e *Engine) GetStats() map[string]interface{}

GetStats returns engine statistics

func (*Engine) LoadRules

func (e *Engine) LoadRules() error

LoadRules loads all Sigma rules from the rules directory

type LoadedRule

type LoadedRule struct {
	// contains filtered or unexported fields
}

LoadedRule represents a loaded Sigma rule with metadata

type RuleResult

type RuleResult struct {
	RuleID        string            `json:"rule_id"`
	RuleName      string            `json:"rule_name"`
	Severity      AlertSeverity     `json:"severity"`
	Description   string            `json:"description"`
	Matched       bool              `json:"matched"`
	MatchedFields map[string]string `json:"matched_fields,omitempty"`
}

RuleResult represents the result of evaluating a rule

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL