From e06b41b604832f99bd5ff25ebb7960ed7cf6a590 Mon Sep 17 00:00:00 2001 From: fuomag9 <1580624+fuomag9@users.noreply.github.com> Date: Fri, 6 Mar 2026 15:32:56 +0100 Subject: [PATCH] fix WAF detection mode and payload logging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DetectionOnly mode: add SecAction to set anomaly score thresholds to 9999999 so rule 949110/980130 never fires; works around coraza-caddy bug where is_interrupted=true still causes a 403 in detection mode - Switch SecAuditEngine back to On (from RelevantOnly) so DetectionOnly hits are captured, now safe because body parts are excluded - SecAuditLogParts: ABIJDEFHZ → ABFHZ, dropping request body (I), multipart files (J), intermediate response headers (D), and response body (E) — prevents multi-MB payloads being written to audit log - Parser: store both blocked and detected events; filter on rule matched OR is_interrupted instead of is_interrupted only - Add blocked column to waf_events (migration 0014); existing rows default to blocked=true - WAF Events UI: Blocked/Detected chip in table and drawer header - Fix misleading help text that said to use Detection Only to observe traffic before blocking Co-Authored-By: Claude Sonnet 4.6 --- app/(dashboard)/settings/SettingsClient.tsx | 4 ++-- app/(dashboard)/waf-events/WafEventsClient.tsx | 13 ++++++++++++- drizzle/0014_waf_blocked.sql | 3 +++ src/lib/caddy.ts | 13 ++++++++++++- src/lib/db/schema.ts | 1 + src/lib/models/waf-events.ts | 2 ++ src/lib/waf-log-parser.ts | 12 +++++++----- 7 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 drizzle/0014_waf_blocked.sql diff --git a/app/(dashboard)/settings/SettingsClient.tsx b/app/(dashboard)/settings/SettingsClient.tsx index f6ea59ef..dc22a172 100644 --- a/app/(dashboard)/settings/SettingsClient.tsx +++ b/app/(dashboard)/settings/SettingsClient.tsx @@ -874,8 +874,8 @@ export default function SettingsClient({ - WAF audit events are stored for 90 days and viewable under WAF Events in the sidebar. - Set mode to Detection Only first to observe traffic before enabling blocking. + WAF events (blocked requests) are stored for 90 days and viewable under WAF Events in the sidebar. + Events only appear when the engine is set to On (Blocking) — Detection Only mode matches rules without blocking and produces no events here.