Expand description
Request capture for Light WAF: keep the full HTTP request (method, path, query, headers, cookies, body) of every request the WAF blocks or rejects, and ship it to the control plane for the event drill-down. Optional, default off.
Three pieces, no change to the core:
CaptureModule— a detection module that never scores: it clones each request into a boundedCaptureRingkeyed by request id (cheap: the body is a ref-countedBytes).CaptureLayer— atracinglayer that watches therequest blocked/request rejecteddecision-log events and pulls the matching capture out of the ring.CaptureShipper— a bounded queue with best-effort retry that POSTs captures to the control plane’s/ingest/captures; it drops on overflow and never puts backpressure on the datapath.
Privacy: capture is raw by default; RedactionConfig replaces header and body-field values with
***REDACTED*** on the node, and CaptureConfig::max_body_bytes caps the body. Retention and
access control are enforced by the control plane.
Structs§
- Capture
Config - Typed configuration for the request-capture feature. Built by the enterprise wiring from the
[enterprise.capture]TOML section. Every field has a fail-safe default and the feature is OFF by default, so a config without the section behaves exactly like the plain enterprise proxy. - Capture
Handle - Handle shared between the installed
CaptureLayerandmain.mainkeeps one clone toarmafter loading the config; the layer keeps another to read it. - Capture
Layer - The layer. Zero-cost while disarmed; on a denial event it does one ring
take+ one non-blocking enqueue. - Capture
Module - Observer module that mirrors each request into the ring. Holds an
Arcto the ring it shares with the verdict-join layer; themodule_factoryrebuilds the module on reload but keeps the same ring, so in-flight captures survive a config reload. - Capture
Ring - Bounded ring buffer of captures. Cheap to clone the
Arcaround it; interior-mutable so the capture module can insert through a shared&self. - Capture
Shipper - Spawns and owns the background shipping task.
- Capture
Sink - The producer half held by the verdict-join layer: a non-blocking handle onto the shipper queue. Cloneable and cheap; dropping the last clone closes the channel and ends the shipper task.
- Captured
Request - A captured HTTP request — the full request the WAF denied, as forwarded to the control-plane
drill-down. Built by
CapturedRequest::from_ctxwith redaction + truncation already applied. - Redaction
Config - Which header names and body field names to strip from a capture before it is stored/shipped.
Constants§
- REDACTED
- The placeholder a redacted value is replaced with.