24 lines
373 B
Go
24 lines
373 B
Go
// Package traefik_botfilter is a Traefik middleware plugin that blocks known scans
|
|
// and applies a bounded, in-memory per-IP suspicion score.
|
|
package botfilter
|
|
|
|
import (
|
|
"bufio"
|
|
"context"
|
|
"fmt"
|
|
"io"
|
|
"net"
|
|
"net/http"
|
|
"net/netip"
|
|
"strconv"
|
|
"time"
|
|
)
|
|
|
|
type botFilter struct {
|
|
next http.Handler
|
|
config *compiledConfig
|
|
cache *clientCache
|
|
logger filterLogger
|
|
}
|
|
|