rules

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 2 Imported by: 1 module, 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 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

type Evaluator interface {
	Evaluate(ctx context.Context, r *request.Request) (Result, error)
}

Evaluator evaluates requests against a compiled rule set. Implementations must be safe for concurrent use.

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
}

Result is the outcome of evaluating one request.

Directories

Path Synopsis
Package coraza implements rules.Evaluator with OWASP Coraza and the OWASP Core Rule Set (CRS), which is embedded in the binary.
Package coraza implements rules.Evaluator with OWASP Coraza and the OWASP Core Rule Set (CRS), which is embedded in the binary.

Jump to

Keyboard shortcuts

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