Open core · Apache-2.0

The open engine underneath.

A reverse-proxy web application firewall in Rust. It inspects every request at Layer 7, accumulates an anomaly score, and returns a verdict — in under a millisecond on the common path. Complete and standalone on its own.

Apache-2.0 · open sourceRust · HTTP/1.1 + HTTP/2< 1 ms p99 common path
waf-proxy
# install the `waf` binary from crates.io
$ cargo install waf-proxy

# run it against your backend (listens :8080)
$ waf --config config.toml

# benign → forwarded, attack → blocked
$ curl -o /dev/null -w "%{http_code}\n" localhost:8080/
200
$ curl -o /dev/null -w "%{http_code}\n" \
    "localhost:8080/?q=1' OR '1'='1"
403
How it decides

Inspect, score, decide.

Every module that matches contributes points to a cumulative anomaly score (a CRS-style model). When the score crosses your block threshold, the request is denied — and the full breakdown is emitted in the decision log.

allow — forwardedblock — 403reject — 400 | 429
Detection pipeline

Phased inspection, cooperative scoring.

Modules run in phases as the request is read; each contributes to the same score. No single rule blocks on its own unless it's worth it.

ConnectionHeadersBodybackend
SQLiXSSRCE / command injectionPath traversalLFI / RFISSRFLDAP injectionNoSQL injectionSSTISSIXXEMail-header injectionHeader injection (CRLF)Request smuggling (CL/TE)WebshellsMSSQL proceduresScanner fingerprinting

Structural protocol validation

GraphQL and gRPC operations are validated on their shape — depth, aliases, fields, batch size — not just their content, to cap abuse of typed APIs.

Anti-evasion normalization

Double-encoding-aware percent-decoding, NFKC, and pipeline-wide overlong-collapse fold evasions into a canonical form before inspection. OWASP CRS / ModSecurity rules import via a native seclang parser.

More than a matcher

A production reverse proxy.

Detection is one part. The core is a real edge proxy with the operational pieces you need to put it in front of traffic.

TLS termination

rustls with HTTP/1.1 and HTTP/2 over ALPN, certificates from file, optional mutual-TLS — all fail-closed.

L7 rate limiting

A per-client token bucket at connection time; block with 429 or add to the anomaly score.

Client-IP resolution

Trusted-proxy / X-Forwarded-For handling, resolved once and fail-safe: unconfigured means un-spoofable.

Request limits

Structural caps on body, headers, params, cookies and JSON depth — oversized or malformed requests are rejected.

Resilience posture

Explicit fail-open / fail-closed policy per scenario: upstream error, module panic, bad reload, parser limit.

Hot reload

SIGHUP re-reads the config with validate-then-swap — a bad reload keeps the last-good config running.

Performance

Fast by construction.

A WAF sits in the request path, so its overhead is a feature. The core is built to stay out of the way of clean traffic.

< 1 msp99 on the common path

A fast path for benign traffic

A RegexSet content prefilter lets clean requests skip the heavy per-rule matching — only suspicious input pays for full inspection.

Rust, async, no GC

Built on Tokio with no garbage collector — no pause spikes on the request path, and a small, predictable memory footprint.

Phased & short-circuiting

Inspection runs in phases as the request is read and stops as soon as a verdict is reached — work you don't need never runs.

Fast, and proven correct. A versioned 260-case malicious/benign corpus gates accuracy and guards against regressions, so tuning for speed never quietly drops coverage. The benchmark and corpus live in the open repository.

Observe & extend

Instrumented, and built to extend — not to fork.

The core emits a stable telemetry contract and exposes typed extension seams, so you add capability by injection, not by patching.

Observability

Prometheus /metrics and a structured JSON decision log — including the per-rule score contributions behind every verdict. This is the exact contract the enterprise control plane consumes.

Extension seams

A builder wires in typed seams — the distributed StateStore, the TlsCertSource — and a WASM plugin runtime (Proxy-Wasm on wasmi) loads your own modules. The enterprise tier plugs in here, without touching the core.

On crates.io

Six crates, one workspace.

The core is published to crates.io — build against the pieces you need, or run the proxy binary directly.

Get started

Running in two minutes.

Install the waf binary from crates.io, or build from source — it needs only Rust and cargo, and listens on :8080.

Install & run

# install the `waf` binary from crates.io
$ cargo install waf-proxy
$ waf --config config.toml

# …or build from source
$ git clone https://github.com/0x00spor3/Light-WAF
$ cd Light-WAF && cargo run -p waf-proxy -- --config config.toml

Minimal config

# config.toml
[proxy]
listen  = "0.0.0.0:8080"
backend = "http://127.0.0.1:3000"

[waf]
mode = "blocking"
block_threshold = 5

Read it, run it, extend it.

The whole engine is open source under Apache-2.0. Star it, file issues, or build a plugin.