Documentation
¶
Overview ¶
Package rules defines the interface between the inspection pipeline and a rule engine. Coraza is the first implementation (package rules/coraza); the interface keeps a different engine possible without touching adapters.
Evaluation currently takes a whole request with its buffered body prefix. Streaming evaluation (headers, then body chunks, then response) arrives with the Envoy ext_proc adapter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Evaluator ¶
Evaluator evaluates requests against a compiled rule set. Implementations must be safe for concurrent use.
type Match ¶ added in v0.1.1
type Match struct {
RuleID int
// Variable is the collection and key, e.g. ARGS:id.
Variable string
// Value is the matched data.
Value string
}
Match is where a rule matched.
type Result ¶
type Result struct {
// Interrupted reports that a rule asked to block the request.
Interrupted bool
// Status is the HTTP status the blocking rule asked for (0 if unset).
Status int
// RuleID is the rule that interrupted the request, if any.
RuleID int
// MatchedRuleIDs lists every rule that matched request data, including
// rules that only contributed to an anomaly score.
MatchedRuleIDs []int
// Matches says where each of those rules matched, unredacted: the
// caller redacts before anything leaves the engine.
Matches []Match
// AnomalyScore is the CRS inbound anomaly score (0 without CRS).
AnomalyScore int
}
Result is the outcome of evaluating one request.