1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Detection module for attack pattern recognition.
//!
//! This module provides detection engines for identifying attack patterns:
//! - Credential stuffing detection with per-entity auth failure tracking
//! - Distributed attack correlation via fingerprint
//! - Account takeover detection (success after failures)
//! - Low-and-slow pattern detection
//!
//! # Architecture
//!
//! - [`CredentialStuffingDetector`] - Main detection engine with concurrent access
//! - [`StuffingConfig`] - Configuration for detection thresholds
//! - [`StuffingVerdict`] - Detection verdict (allow/suspicious/block)
//!
//! # Example
//!
//! ```ignore
//! use synapse_pingora::detection::{
//! CredentialStuffingDetector, AuthAttempt, AuthResult, StuffingConfig,
//! };
//!
//! let detector = CredentialStuffingDetector::new(StuffingConfig::default());
//!
//! // Check if this is an auth endpoint
//! if detector.is_auth_endpoint("/api/login") {
//! // Record the attempt
//! let attempt = AuthAttempt::new("192.168.1.1", "/api/login", now_ms());
//! let verdict = detector.record_attempt(&attempt);
//!
//! // Handle verdict
//! if verdict.is_block() {
//! // Block the request
//! }
//! }
//! ```
pub use ;
pub use ;