Expand description
Public detection entry point: the spec 4.0.2 SusPatternsManager.detect
pipeline (preprocess, four scan views, semantic analysis, scoring).
View passes mirror the reference mixins:
- processed view (
raw_view_only=False): excludes raw-view-only and URL-decoded-view-only patterns; - raw signal-preserving view (
raw_view_only=True): raw-view-only patterns plus the recon rows (the processed views fold LDAP hex escapes such as\defaultbefore the tables run; duplicates against the processed view are dropped on merge); - decoded-view path-traversal check (processed vs raw view counts);
- URL-decoded view (
url_decoded_view_only=True): only URL-decoded-view patterns, content is the precomputed decoded view truncated safely; - decode-budget exhaustion threat when a decode pass hit its budget;
- short-base64 additive view (no view exclusion);
- semantic analysis over the processed content (skipped for binary-looking raw content).
Scoring follows _regex_anomaly / _calculate_threat_score: is_threat
is sum(regex weights) >= threat_score_threshold or any semantic threat;
threat_score is min(max(regex anomaly, semantic max), 1.0) when any
threat exists, else 0.0.
Structs§
- Detect
Config - Knob mapping for one detect call (spec
config_knobs). - Detect
Verdict - Full verdict (
SusPatternsManager.detectreturn shape, minus timing). - Semantic
Threat - Semantic threat with the full analysis payload (
_check_semantic_threats).
Enums§
- Threat
- One threat, regex or semantic, exactly as the reference emits it.
Constants§
Functions§
- detect
- The reference
detectpipeline over one request content, under a fresh default scan time budget (DEFAULT_MAX_SCAN_SECONDS) for this call. - detect_
with_ budget detect_with_semantic_skipover a caller-ownedScanTimeBudget.- detect_
with_ semantic_ skip detectwith the semantic analyzer optionally skipped.- normalize_
context _normalize_context: keep the part before the first:, map unknown contexts tounknown.