Italyfabriziosalmi/caddy-waf
Caddy WAF (Regex Rules, IP and DNS filtering, Rate Limiting, GeoIP, Tor, Anomaly Detection)
Thành tựu nổi bật
Những danh hiệu mới nhất của dự án
#1 Repository Của Tuần
#1 Repository Của Tuần
#1 Repository Của Tuần
🔐 Caddy WAF — Web Application Firewall mạnh mẽ cho Caddy server
Một middleware WAF đa tính năng, kiểm tra request/response qua 4 giai đoạn, dùng Regex RE2 an toàn và scoring phát hiện bất thường.
Caddy WAF là một middleware HTTP handler hoạt động như một Web Application Firewall cho Caddy, được viết bằng ngôn ngữ Go. Dự án đăng ký Caddy module với ID http.handlers.waf và có thể cấu hình qua Caddyfile hoặc JSON.
✨ Điểm nổi bật
- Regex rule engine: Dùng Go
regexp(RE2, đảm bảo thời gian tuyến tính), cache pattern theo rule ID. - Kiểm tra 4 giai đoạn: Headers/pre-request (Phase 1), body (Phase 2), response headers (Phase 3), response body (Phase 4).
- Anomaly scoring: Mỗi rule góp
scorevào tổng số, block khi đạtanomaly_threshold. - IP blacklist: Hỗ trợ IP và CIDR IPv4/IPv6 dùng prefix trie
go-iptrie. - DNS blacklist: Tra cứu host không phân biệt chữ hoa/thường.
- GeoIP & ASN block: Dùng MaxMind GeoLite2 Country và ASN MMDB.
- Tor exit-node block: Tự động cập nhật danh sách từ Tor Project.
- Rate limiting: Per-IP, sliding-window, hỗ trợ per-path regex.
- Hot reload: Theo dõi thay đổi file rule/IP/DNS qua
fsnotify. - Metrics endpoint: JSON tại
metrics_endpoint. - Redaction dữ liệu nhạy: Ẩn query params và log fields nhạy cảm.
- Custom block responses: Trả về response tùy chỉnh theo status code.
💡 Vì sao đáng chú ý
Khác với WAF truyền thống chỉ block dựa trên signature cố định, Caddy WAF dùng cơ chế scoring tích lũy — mỗi rule góp điểm, chỉ block khi vượng ngưỡng, giảm false positive. Kết hợp đa dạng phương thức lọc (Regex, IP, DNS, GeoIP, ASN, Tor, rate limit) trong một middleware nhẹ, phù hợp triển khai nhanh trên Caddy mà không cần thay đổi kiến trúc hệ thống.
#Caddy #WAF #WebSecurity #GoLang #OpenSource #TiniX
Similar Projects
Discover other similar projects and AI models.
Automated OWASP CRS and Bad Bot Detection for Nginx, Apache, Traefik and HaProxy
SafeLine is a self-hosted WAF(Web Application Firewall) / reverse proxy to protect your web apps from attacks and exploits.
An HTTP cache system, RFC compliant, compatible with @tyktechnologies, @traefik, @caddyserver, @go-chi, @bnkamalesh, @beego, @devfeel, @labstack, @gofiber, @go-goyave, @go-kratos, @gin-gonic, @roadrunner-server, @zalando, @zeromicro, @nginx and @apache
OWASP Coraza middleware for Caddy. It provides Web Application Firewall capabilities
Caddy module to block or manipulate requests originating from AIs or cloud services trying to train on your websites
Caddy plugin that sends wake-on-lan magic packets to remote hosts to wake up e.g. reverse proxy targets.