rules

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package rules implements configurable request matching for CheeseWAF.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigToStorage

func ConfigToStorage(siteID string, items []config.CustomRuleConfig) []storage.Rule

func ParseAction

func ParseAction(action string) engine.Action

func ParseSeverity

func ParseSeverity(severity string) engine.Severity

Types

type Engine

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

func New

func New(ruleSet []Rule) *Engine

func (*Engine) Detect

func (e *Engine) Detect(ctx context.Context, reqCtx *engine.RequestContext) (*engine.DetectionResult, error)

func (*Engine) ID

func (e *Engine) ID() string

func (*Engine) Name

func (e *Engine) Name() string

func (*Engine) Priority

func (e *Engine) Priority() int

func (*Engine) Rules

func (e *Engine) Rules() []Rule

type Rule

type Rule struct {
	ID       string
	Name     string
	Pattern  *regexp.Regexp
	Location string
	Action   engine.Action
	Severity engine.Severity
	Priority int
	Enabled  bool
	// contains filtered or unexported fields
}

func FromConfig

func FromConfig(items []config.CustomRuleConfig) ([]Rule, error)

func FromStorage

func FromStorage(items []storage.Rule) ([]Rule, error)

Jump to

Keyboard shortcuts

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