rules

package
v2.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Custom

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

Custom defines a WAF custom rule.

func (*Custom) Close

func (rule *Custom) Close()

func (*Custom) Directives

func (rule *Custom) Directives() string

Directives returns the directives for custom rules.

func (*Custom) GetPreprocessor

func (rule *Custom) GetPreprocessor() protocol.PreWAFProcessor

GetPreprocessor returns the preprocessor for custom rules.

func (*Custom) NeedCrs

func (rule *Custom) NeedCrs() bool

NeedCrs indicates whether the custom rule requires OWASP CRS.

func (*Custom) Type

func (rule *Custom) Type() protocol.RuleType

Type returns the type of the custom rule.

type GeoIPBlocker

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

GeoIPBlocker defines a WAF GeoIP blocking rule.

func (*GeoIPBlocker) Close

func (rule *GeoIPBlocker) Close()

func (*GeoIPBlocker) Directives

func (rule *GeoIPBlocker) Directives() string

Directives returns the directives for GeoIP blocking rules.

func (*GeoIPBlocker) GetPreprocessor

func (rule *GeoIPBlocker) GetPreprocessor() protocol.PreWAFProcessor

GetPreprocessor returns the preprocessor for GeoIP blocking rules.

func (*GeoIPBlocker) NeedCrs

func (rule *GeoIPBlocker) NeedCrs() bool

NeedCrs indicates whether the GeoIP blocking rule requires OWASP CRS.

func (*GeoIPBlocker) Type

func (rule *GeoIPBlocker) Type() protocol.RuleType

Type returns the type of the GeoIP blocking rule.

type IPBlocker

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

IPBlocker defines a WAF IP blocking rule.

func (*IPBlocker) Close

func (rule *IPBlocker) Close()

func (*IPBlocker) Directives

func (rule *IPBlocker) Directives() string

Directives returns the directives for IP blocking rules.

func (*IPBlocker) GetPreprocessor

func (rule *IPBlocker) GetPreprocessor() protocol.PreWAFProcessor

GetPreprocessor returns the preprocessor for IP blocking rules.

func (*IPBlocker) NeedCrs

func (rule *IPBlocker) NeedCrs() bool

NeedCrs indicates whether the IP blocking rule requires OWASP CRS.

func (*IPBlocker) Type

func (rule *IPBlocker) Type() protocol.RuleType

Type returns the type of the IP blocking rule.

type OwaspRules

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

OwaspRules defines the specification for OWASP rules.

func (*OwaspRules) Close

func (owasp *OwaspRules) Close()

func (*OwaspRules) Directives

func (owasp *OwaspRules) Directives() string

Directives returns the directives for OWASP rules. Check https://github.com/corazawaf/coraza-coreruleset?tab=readme-ov-file#usage for more details.

func (*OwaspRules) GetPreprocessor

func (owasp *OwaspRules) GetPreprocessor() protocol.PreWAFProcessor

GetPreprocessor returns the preprocessor for OWASP rules.

func (*OwaspRules) NeedCrs

func (owasp *OwaspRules) NeedCrs() bool

NeedCrs indicates whether the OWASP rules require OWASP CRS.

func (*OwaspRules) Type

func (owasp *OwaspRules) Type() protocol.RuleType

Type returns the type of the OWASP rules.

type Rule

type Rule interface {
	Type() protocol.RuleType
	Directives() string
	NeedCrs() bool
	GetPreprocessor() protocol.PreWAFProcessor
	Close()
	// contains filtered or unexported methods
}

Rule defines a WAF rule.

func NewRules

func NewRules(ruleSpec protocol.RuleSpec) []Rule

NewRules creates a slice of Rule based on the provided rule specification.

Jump to

Keyboard shortcuts

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