Documentation
¶
Overview ¶
Package engine compiles a feed's rules into what the sensor can run, and reports, per rule, whether it compiled. That report is the whole basis for the console calling a rule "protecting": a rule this package could not compile, or has no engine for, is never shown as running.
Engines:
MODSECURITY and the generated virtual patches in that format run on Coraza, in detection-only mode: Coraza says which rule matched and the verdict engine decides what to do about it.
REGEX_L7 runs on Go's RE2. A pattern that needs PCRE (lookaround, backreferences) is rejected with that reason rather than approximated.
STIX and OpenIOC become sets of domains, IP addresses and file hashes for the egress proxy, the DNS check and the file scan.
SIGMA rules for process_creation run against process starts (sigma.go).
Snort, Suricata, YARA, AWS WAF, Cloudflare and nginx rules are loaded as no-engine: this sensor build cannot run them, and says so.
Index ¶
Constants ¶
const ( Compiled = "compiled" Rejected = "rejected" NoEngine = "no-engine" )
Load statuses, as the runtime API names them.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IOCSet ¶
type IOCSet struct {
Domains map[string]decide.RuleRef
IPs map[string]decide.RuleRef
Hashes map[string]decide.RuleRef
}
IOCSet is the indicators the sensor can check without a rule engine: a domain someone resolves or connects to, an address someone connects to, a file hash on disk. Each indicator remembers the rule it came from, so a hit is reported against that rule.
type Process ¶ added in v3.141.0
type Process struct {
Image string
CommandLine string
ParentImage string
ParentCommandLine string
CurrentDirectory string
User string
}
Process is the event a Sigma rule is evaluated against.
type Set ¶
type Set struct {
IOC IOCSet
// contains filtered or unexported fields
}
Set is everything compiled from one or more feeds.
func (*Set) HasProcessRules ¶ added in v3.141.0
HasProcessRules reports whether anything checks process starts.
func (*Set) InspectRequest ¶
InspectRequest runs the HTTP engines over one request. body is what was buffered of it, possibly cut short.
func (*Set) MatchProcess ¶ added in v3.141.0
MatchProcess evaluates the Sigma rules against one process start.