rbl

package module
v0.0.0-...-3cb1600 Latest Latest
Warning

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

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

README

caddy-rbl License

caddy-rbl integrates Real time block lists with Caddy.


Features

  • Easy configuration with Caddyfile or JSON
  • Detailed logging for security auditing

Installation

git clone https://github.com/kitche/caddy-rbl.git
cd caddy-rbl
xcaddy build --with github.com/kitche/caddy-modsecurity=/path/to/checkout

Configuration

Example Caddyfile

example.com {
    rbl {
        lists zen.spamhaus.org bl.spamcop.net
        block_message "Your IP is listed in our blocklist"
        status_code 403
    }
    
    reverse_proxy localhost:8080
}

Contributing

We welcome contributions!

Fork the repository

Create a branch: git checkout -b feature-name

Commit your changes: git commit -m "Add feature"

Push to your branch: git push origin feature-name

Open a Pull Request

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RBL

type RBL struct {
	// Lists contains the RBL servers to query (e.g., "zen.spamhaus.org")
	Lists []string `json:"lists,omitempty"`

	// BlockMessage is the message returned when an IP is blocked
	BlockMessage string `json:"block_message,omitempty"`

	// StatusCode is the HTTP status code to return when blocking
	StatusCode int `json:"status_code,omitempty"`

	// LogAllChecks determines whether to log all RBL checks or only blocks
	LogAllChecks bool `json:"log_all_checks,omitempty"`
	// contains filtered or unexported fields
}

RBL implements an HTTP handler that checks client IPs against RBL lists

func (RBL) CaddyModule

func (RBL) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information

func (*RBL) Provision

func (r *RBL) Provision(ctx caddy.Context) error

Provision sets up the RBL module

func (RBL) ServeHTTP

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

ServeHTTP implements the caddyhttp.MiddlewareHandler interface

func (*RBL) UnmarshalCaddyfile

func (r *RBL) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile implements caddyfile.Unmarshaler

func (*RBL) Validate

func (r *RBL) Validate() error

Validate ensures the module configuration is valid

Jump to

Keyboard shortcuts

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