engine

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 49 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package engine implements the core detection engine streaming logic, event processing, logging, and metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RiskLevel

func RiskLevel(score float64, t config.RiskThresholds) string

RiskLevel ignores alert_level.

func RiskLevelName

func RiskLevelName(rank int) string

func RiskScore

func RiskScore(entries []state.RiskContribution, now time.Time) (active []state.RiskContribution, effective []float64, total float64)

func ValidateRules

func ValidateRules(rules map[ruleset.RuleID]*ruleset.Rule, liteFuncs *litefunc.Registry) error

Types

type DetectionEngine

type DetectionEngine struct {
	Logger *extendedLogger
	// contains filtered or unexported fields
}

func NewDetectionEngine

func NewDetectionEngine(cfg config.Config, rules map[ruleset.RuleID]*ruleset.Rule, version string) (*DetectionEngine, error)

func (*DetectionEngine) NewLifecycle

func (de *DetectionEngine) NewLifecycle(ctx context.Context) *Lifecycle

func (*DetectionEngine) Run

func (de *DetectionEngine) Run(ctx context.Context) error

func (*DetectionEngine) RunWithSourceSinks

func (de *DetectionEngine) RunWithSourceSinks(lc *Lifecycle, source streams.Source, sinks []streams.Sink) error

type Lifecycle

type Lifecycle struct {
	Ingest        context.Context
	StopIngest    context.CancelFunc
	Delivery      context.Context
	AbortDelivery context.CancelFunc
	// contains filtered or unexported fields
}

Lifecycle separates stopping ingest from aborting delivery: once Ingest is cancelled the pipeline drains, and Delivery is cancelled only if draining outlasts the shutdown timeout.

func (*Lifecycle) Close

func (lc *Lifecycle) Close()

Jump to

Keyboard shortcuts

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