waf

package module
v0.0.0-...-f1be747 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

README

caddy-waf

Waf based on caddy2

example

   route {
        waf {
            args_rule args.rule
            user_agent_rule user_agent.rule
            post_rule post.rule
            ip_allow_rule ip_allow.rule
            ip_block_rule ip_block.rule
            rate_limit_bucket 10
            rate_limit_rate 10
        }
    }

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaddyWaf

type CaddyWaf struct {
	ArgsRule        []string
	UserAgentRule   []string
	PostRule        []string
	IpAllowRule     []string
	IpBlockRule     []string
	RateLimitBucket int
	RateLimitRate   float64
	// contains filtered or unexported fields
}

func (CaddyWaf) CaddyModule

func (CaddyWaf) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*CaddyWaf) Provision

func (w *CaddyWaf) Provision(ctx caddy.Context) error

func (CaddyWaf) ServeHTTP

func (w CaddyWaf) ServeHTTP(rw http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

ServeHTTP implements caddyhttp.MiddlewareHandler.

func (CaddyWaf) Start

func (w CaddyWaf) Start() error

func (CaddyWaf) Stop

func (w CaddyWaf) Stop() error

func (*CaddyWaf) UnmarshalCaddyfile

func (w *CaddyWaf) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile

func (*CaddyWaf) Validate

func (w *CaddyWaf) Validate() error

type RateLimit

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

func NewRateLimit

func NewRateLimit(logger *zap.Logger, rateLimitBucket int, rateLimitRate float64) *RateLimit

Jump to

Keyboard shortcuts

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