Skip to content

PRX-WAF

PRX-WAF is a web application firewall built as a 7-crate Rust workspace on top of Cloudflare’s Pingora proxy framework. It inspects HTTP traffic through a 17-phase detection pipeline and supports YAML, ModSecurity, and JSON rule formats.

PRX-WAF is organized as a Rust workspace with seven crates:

CrateRole
prx-waf-corePingora integration, request/response lifecycle, phase orchestration
prx-waf-rulesRule parsing (YAML, ModSecurity, JSON), rule engine
prx-waf-detectionDetection logic for all 17 phases
prx-waf-adminVue 3 admin dashboard and management API
prx-waf-notificationAlert delivery (webhook, Telegram, email)
prx-waf-clusterQUIC-based cluster synchronization
prx-waf-cliCommand-line interface

Every HTTP request passes through these phases in order. A match at any phase can terminate processing with a configured action.

PhaseNameDescription
1IP WhitelistAllow requests from trusted IPs (bypass all subsequent phases)
2IP BlacklistBlock requests from known-bad IPs
3URL WhitelistAllow requests to trusted URL paths
4URL BlacklistBlock requests to forbidden URL paths
5CC/DDoSRate limiting and connection flood detection
6Scanner DetectionIdentify automated vulnerability scanners (Nikto, sqlmap, etc.)
7Bot DetectionDistinguish bots from humans (fingerprinting, challenge)
8SQL InjectionDetect SQLi payloads in parameters, headers, and body
9XSSDetect cross-site scripting payloads
10RCEDetect remote code execution attempts (command injection, SSRF)
11Directory TraversalDetect path traversal attempts (../, encoded variants)
12Custom Rules (Rhai)User-defined detection logic written in Rhai scripting language
13OWASP CRSCompatibility layer for OWASP Core Rule Set
14Sensitive DataDetect sensitive data in responses (credit cards, SSNs, API keys)
15Anti-HotlinkingPrevent unauthorized embedding of your resources
16CrowdSecIntegration with CrowdSec community blocklists
17GeoIPBlock or allow traffic by country/region

PRX-WAF supports three rule formats, allowing teams to use their preferred syntax or import existing rule sets:

- id: sql-injection-union
phase: 8
description: "Detect UNION-based SQL injection"
match:
field: args
pattern: "(?i)union\\s+(all\\s+)?select"
action: block
severity: critical
SecRule ARGS "@rx (?i)union\s+(all\s+)?select" \
"id:1001,phase:2,deny,status:403,msg:'SQL Injection'"
{
"id": "xss-script-tag",
"phase": 9,
"match": {"field": "args", "pattern": "<script[^>]*>"},
"action": "block"
}

PRX-WAF ships with 50+ rule files covering common attack patterns across all detection phases.

When a rule matches, PRX-WAF can take one of these actions:

ActionDescription
blockReturn a 403 response and terminate the request
allowExplicitly allow the request (skip remaining phases)
logLog the match but allow the request to continue
redirectRedirect the client to a specified URL

Actions are configured per rule and can be overridden by global policy.

PRX-WAF pushes real-time alerts when threats are detected:

ChannelConfiguration
WebhookHTTP POST with JSON payload to any endpoint
TelegramBot API with chat ID
EmailSMTP with configurable sender/recipient

Notifications include the matched rule, request details (IP, URL, headers), severity, and the action taken.

PRX-WAF supports WebSocket real-time streams for live monitoring:

  • Live request log with detection results
  • Attack frequency metrics
  • Top blocked IPs and attack types

The admin dashboard connects to these streams for a real-time security overview.

For multi-node deployments, PRX-WAF nodes synchronize state over QUIC:

  • Shared IP blocklists and rate-limit counters
  • Rule updates propagated across nodes
  • Consistent GeoIP and CrowdSec data

The Vue 3 admin dashboard provides:

  • Real-time traffic and threat visualization
  • Rule management (create, edit, enable/disable)
  • IP whitelist/blacklist management
  • Detection phase configuration
  • Notification channel setup
  • Cluster node status
Terminal window
# Build all crates
cargo build --release
# Run with config
./target/release/prx-waf --config /etc/prx-waf/config.yaml
# CLI: test a rule against a sample request
./target/release/prx-waf-cli test-rule --rule rules/sqli.yaml --request sample.http