WAPP: Safe Learning of Positive Security WAF Policies from Live Traffic
Organizations: Cyshield Company, Cairo, Egypt · Ethical Hacking and Cybersecurity, Coventry University – Egypt Branch, hosted at The Knowledge Hub Universities, New Cairo, Egypt
Abstract
Web Application Firewalls (WAFs) mainly rely on signatures to detect known attacks, which can leave gaps against modified or previously unseen payloads. Positive security provides a complementary approach by learning legitimate traffic and blocking inputs that fall outside the learned profile. However, learning directly from live traffic can be unsafe when malicious requests contaminate the training data. This paper presents the Whitelisting Autonomous Policy Producer (WAPP), a framework that combines trust filtering, deterministic rule synthesis, confidence scoring, and validation before enforcement. WAPP is evaluated on three controlled applications using a live Coraza and OWASP Core Rule Set (CRS) stack. Results show that, on the tested DVWA username field, unfiltered learning becomes Degraded at 0.2% poisoned traffic and Broken at 0.5%, while the evaluated free text field can admit malicious inputs even without poisoning. On the frozen poisoning dataset, the ablation configuration with all seven candidate signals improves the measured poisoning resilience from 53% to 90%, compared with 62% for the Kruegel--Vigna baseline. The deterministic synthesizer provides attack blocking comparable to the tested language model without model inference cost. WAPP blocks confirmed CRS bypasses on constrained fields, while free text inputs remain a precision challenge that requires character level operator control.
Figures & tables
| Signal | Default | Grounded in | Role in WAPP |
|---|---|---|---|
| WAF attack flags + per source ban | On / 3 strikes | CRS anomaly scoring [ 34 ] ; IP reputation [ 7 ] . | Drop flagged records and suppress repeatedly flagged sources. |
| HTTP status allowlist | On / success | Successful response learning [ 24 ] , [ 18 ] , [ 27 ] . | Learn only from successful application responses. |
| Distinct IP cardinality | On / 50 IPs | Imperva default 50; F5 learning gate [ 18 ] , [ 27 ] . | Require cross source evidence before synthesis. |
| Observation count | On / 50 obs. | Imperva 50; Avi 100; FortiWeb 400 [ 24 ] , [ 27 ] , [ 4 ] . | Require sufficient repeated evidence. |
| Temporal spread | On / 12 h | Imperva 12 h; temporal evaluation discipline [ 37 ] , [ 27 ] . | Avoid learning short bursts or scans as stable behaviour. |
| Per IP volume cap | Off / 30 if enabled | Rate limiting and RFC 6585 [ 36 ] , [ 8 ] , [ 20 ] . | Optional limit on dominance by one source. |
| Poison % | Injected | PER | WCR | PFS | Tier | FPR |
|---|---|---|---|---|---|---|
| 0.00 | 0 | 0.00 | 0.00 | 0.000 | Resilient | 0.00 |
| 0.99 | 8 | 0.90 | 1.00 | 0.947 | Broken | 0.00 |
| 2.91 | 24 | 1.00 | 1.00 | 1.000 | Broken | 0.00 |
| 4.99 | 42 | 1.00 | 1.00 | 1.000 | Broken | 0.00 |
| 9.91 | 88 | 1.00 | 1.00 | 1.000 | Broken | 0.00 |
| 20.00 | 200 | 1.00 | 1.00 | 1.000 | Broken | 0.00 |
| App / field | 0% result | Sub 1% bracket | 1% result | Legitimate FPR / notes |
|---|---|---|---|---|
| Airport free text comment | PER 0.30; PFS 0.462; Broken | Already Broken at 0% | PER 1.00; PFS 1.00; Broken | 0.00 on 15 value live holdout; 0.26 (13/50) on a separate 50 value deconfounding holdout (PER 0.20 in that arm) |
| DVWA login username | PER 0.00; PFS 0.00; Resilient | 0.2%: mean PER 0.1667, SD 0.0577, Degraded ; 0.5%: mean PER 0.50, SD 0.10, Broken (3 seeds) | PER 1.00; PFS 1.00; Broken | 0.00 on 15 value live holdout |
| Juice Shop feedback | Excluded because captcha returns pre WAF HTTP 500 | Not measured | Excluded | Measured later in RQ3 with the captcha satisfied |
| Configuration | WCR | PER | Effect. | Shapley | Main effect | |
|---|---|---|---|---|---|---|
| Empty filter | 0.7273 | 0.3485 | 1.0000 | 0.5288 | n/a | none |
| Per IP cap (disabled by default) | 0.7273 | 0.3485 | 1.0000 | 0.5288 | 0.0000 | no contribution at tested poison level |
| Distinct IP cardinality | 0.6667 | 0.3182 | 1.0000 | 0.5692 | 0.0094 | low evidence / invented endpoints |
| Observation count | 0.6667 | 0.3182 | 1.0000 | 0.5692 | 0.0094 | low evidence / invented endpoints |
| Temporal spread | 0.6667 | 0.3182 | 0.6552 | 0.5692 | 0.0094 | bursts / invented endpoints |
| WAF attack flags | 0.5455 | 0.1818 | 0.6897 | 0.7273 | 0.0968 | flagged burst poison |
| Floor | WCR | PER | Legit FPR | Effectiveness |
|---|---|---|---|---|
| Off | 0.4444 | 0.1515 | 0.0222 | 0.7740 |
| 0.70 | 0.1111 | 0.0909 | 0.0222 | 0.9000 |
| 0.80 | 0.1111 | 0.0909 | 0.0222 | 0.9000 |
| 0.90 (default) | 0.1111 | 0.0909 | 0.0222 | 0.9000 |
| 0.95 | 0.1111 | 0.0909 | 0.0222 | 0.9000 |
| Measure | RQ2 result |
|---|---|
| Adaptive cells | 20 |
| Topology constraints | 60 distinct IPs (gate ) and temporal spread hours |
| Maximum targeted metacharacter frequency | 0.50, below the 0.90 value frequency floor |
| Maximum PER / WCR | 0.00 / 0.00 |
| Benign control admit rate | 1.00 |
| All seven signal effectiveness | 0.9000 across five attacker profiles |
| Endpoint / field | Static PER | Static FPR | LLM PER | LLM FPR |
|---|---|---|---|---|
| DVWA login / username | 0.00 | 0.76 (38/50) | 0.00 | 0.00 (0/50) |
| Juice Shop search / q | 0.00 | 0.14 (7/50) | 0.00 | 0.00 (0/50) |
| Juice Shop login / email | 0.00 | 0.00 (0/50) | 0.00 | 0.00 (0/50) |
| Airport comment / JSON | 0.00 | 0.78 (39/50) | 0.20 | 0.26 (13/50) |
| Airport comment / form | 0.00 | 0.78 (39/50) | 0.20 | 0.26 (13/50) |
| Airport search / q | 0.00 | 0.14 (7/50) | 0.00 | 0.00 (0/50) |
| Score | Tier | False positives / 108 | Genuine attack block | Cells / guardrail |
|---|---|---|---|---|
| 0.0000 | floor | 60 (55.6%) | 100% | 1 / violated |
| 0.4287 | low | 60 (55.6%) | 100% | 1 / violated |
| 0.4787 | low | 60 (55.6%) | 100% | 1 / violated |
| 0.5873 | medium | 0 (0%) | 100% | 3 / met |
| 0.7709 | high | 0 (0%) | 100% | 3 / met |
| 0.8271 | rich | 0 (0%) | 100% | 3 / met |
Cybersecurity
Cybersecurity develops methods to protect digital and cyber-physical systems from attacks, vulnerabilities, data loss, and misuse.
See all 355 papers