pub struct DetectConfig {
pub max_content_length: usize,
pub max_full_scan_bytes: usize,
pub preserve_attack_patterns: bool,
pub semantic_threshold: f64,
pub threat_score_threshold: f64,
pub binary_min_run_length: usize,
pub max_scan_values: usize,
pub max_scan_chars: usize,
pub max_json_depth: usize,
}Expand description
Knob mapping for one detect call (spec config_knobs).
Fields§
§max_content_length: usizedetection_max_content_length (semantic budget, truncation budget).
max_full_scan_bytes: usizedetection_max_body_inspect_bytes (the preprocessor’s full-scan cap).
preserve_attack_patterns: booldetection_preserve_attack_patterns.
semantic_threshold: f64detection_semantic_threshold.
threat_score_threshold: f64detection_threat_score_threshold.
binary_min_run_length: usizedetection_binary_min_run_length (reference bounds 4..=1024, default
16): minimum code-point length a printable run inside a binary-dense
multipart file-part payload must reach before the run is handed to the
pattern scan (see crate::binary_islands).
max_scan_values: usizedetection_max_scan_values (reference default 512): the per-request
scan budget counting values handed to detect; once the count
crosses the cap the remaining request values are not scanned (the
fail-open signal the reference logs once).
max_scan_chars: usizedetection_max_scan_chars (reference default 65536): the
per-request character budget, accounted at the same per-value point
as max_scan_values; once the consumed count reaches the cap the
remaining request values are not scanned.
max_json_depth: usizedetection_max_json_depth (reference default 32): the JSON walk’s
semantic depth cap; containers at or beyond this nesting serialize
back to compact JSON and scan as text (see crate::json_walk).
Trait Implementations§
Source§impl Clone for DetectConfig
impl Clone for DetectConfig
Source§fn clone(&self) -> DetectConfig
fn clone(&self) -> DetectConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DetectConfig
Source§impl Debug for DetectConfig
impl Debug for DetectConfig
Source§impl Default for DetectConfig
impl Default for DetectConfig
Source§fn default() -> DetectConfig
fn default() -> DetectConfig
The reference defaults from _security_config_fields.py: the
reference detection_max_content_length (ten thousand), the
reference detection_max_body_inspect_bytes (262,144), preserved
patterns, the 0.7 / 1.0 thresholds, the reference binary run
length (16), the reference detection_max_scan_values (512), the
reference detection_max_scan_chars (65,536), and the reference
detection_max_json_depth (32).