Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.7.6 - 2026-07-06¶
Production hardening for the reverse proxy, and full parity with OWASP Coraza on the CRS test corpus.
Added¶
lewaf-proxy --config <file>loads a complete YAML/JSON config — the OWASP CRS (viarule_files), audit logging, storage, and request limits. (--rules-fileonly handles single-line rules and can't load the CRS.)- Structured JSONL audit log — one JSON line per blocked or errored request (timestamp, client IP, method, path, rule id, action), ready to feed a ban scorer or log shipper. Paths never include the query string, so secrets don't leak.
@detectSQLinow uses libinjection (a vendored pure-Python port of the engine Coraza uses) instead of a regex approximation — more accurate SQLi detection, still no C extension.- Forged X-Forwarded-For gate rule (
rules/REQUEST-950-GATE.conf) for deployments behind an nginx that overwrites XFF — blocks requests that arrive already carrying a spoofed XFF header.
Changed¶
- The reverse proxy now fails closed: an internal error returns
503instead of forwarding the request to your app unprotected. - Bundled OWASP CRS upgraded to 4.21 (765 rules). LeWAF now agrees with OWASP Coraza on 100% of the CRS regression corpus (98.8% request / 97.9% response conformance against the corpus itself).
- Closer ModSecurity behavior:
@rxmatches across newlines (DOTALL), rules fire once per matching value (fixing chained and parameter-pollution detection), andARGS_NAMESreports duplicate parameter names.
Fixed¶
- A malformed or missing rule file now fails loudly at load time instead of silently loading a partial ruleset — so a broken config can't deploy with rules quietly missing. (A glob matching no files stays lenient.)
- More accurate CRS matching for Unicode/JS-encoded and high-byte payloads.
- ReDoS protection: every regex match is time-bounded, so a pathological pattern can't hang a request.
Removed¶
- The broken
lewafcommand (it crashed on launch). Uselewaf-proxyandlewaf-validate.
0.7.4 - 2026-06-17¶
Added¶
- Forged X-Forwarded-For gate rule — blocks requests that reach an nginx-fronted deployment already carrying an XFF header (a spoofing attempt).
Changed¶
- nginx now overwrites
X-Forwarded-Forin all docs ($remote_addr, not$proxy_add_x_forwarded_for), so clients can't spoof their IP past IP-based rules and bans.
Fixed¶
- Starlette and Flask now use the real client IP from
X-Forwarded-For(Django already did), so gate and IP-ban rules see the client instead of the proxy. - Reverse proxy works on Starlette 1.x (a
lifespanhandler replaces the removedon_event).
0.7.3 - 2026-01-07¶
Added¶
WAFaccepts aWAFConfigobject directly, and rule files can be loaded by glob (rules/*.conf).Transaction.add_request_headers(), matchingadd_response_headers().
Changed¶
- OWASP CRS loading reached 100% (681 rules, up from 594).
- Standardized middleware: Flask's
FlaskWAFMiddleware→LeWAFMiddlewareandSecLangParser→InlineRuleParser(old names still work), and every framework now takesblock_status/block_body.
0.7.1 - 2025-12-07¶
Added¶
- Pluggable kernel architecture (
KernelProtocol) — a Python reference kernel today, with a path to native (Rust/Zig) acceleration. - More SecLang expressiveness: variable counts (
&ARGS), key negation (!ARGS:foo), and REST path parameters via@restpath(ARGS_PATH). - Engine directives
SecRuleEngine,SecRequestBodyAccess, andSecResponseBodyAccessare now recognized.
Changed¶
- The
redirectandskipactions now work end-to-end, and audit-log actions (auditlog/noauditlog) update transaction state.
Fixed¶
- Starlette middleware reads the request body before inspection, the response-header phase now runs, and config-file loading works.
Documentation¶
- ADR-001/002 (kernel design and native roadmap) and a README "Known Limitations" note for the
dropandexecactions.
0.7.0 - 2025-12-05¶
First public release — a pure-Python Web Application Firewall implementing the ModSecurity SecLang specification, usable as framework middleware or a standalone reverse proxy.
- WAF engine: full 5-phase request/response inspection.
- SecLang rules: ModSecurity-compatible — 32 operators, 45 transformations, 37 actions, ~40 variables, plus chains and macros.
- OWASP CRS protection: SQL injection, XSS, remote code execution, file inclusion (LFI/RFI), path traversal, and protocol enforcement.
- Body inspection: JSON, XML, multipart, and URL-encoded, with automatic content-type detection.
- Persistent state (Memory / File / Redis): rate limiting, brute-force detection, and session anomaly scoring, with TTLs.
- Compliance-ready audit logs: JSON events with PCI-DSS data masking and GDPR IP anonymization.
- Framework integrations: FastAPI, Flask, Django, and Starlette.
- Docs: API reference, per-framework integration guides, and Docker/Kubernetes deployment guides.