Skip to main content

DetectConfig

Struct DetectConfig 

Source
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: usize

detection_max_content_length (semantic budget, truncation budget).

§max_full_scan_bytes: usize

detection_max_body_inspect_bytes (the preprocessor’s full-scan cap).

§preserve_attack_patterns: bool

detection_preserve_attack_patterns.

§semantic_threshold: f64

detection_semantic_threshold.

§threat_score_threshold: f64

detection_threat_score_threshold.

§binary_min_run_length: usize

detection_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: usize

detection_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: usize

detection_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: usize

detection_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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DetectConfig

Source§

impl Debug for DetectConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DetectConfig

Source§

fn default() -> Self

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).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.