v0.3: 6-layer architecture complete
Layers: Layer 1: XDP/eBPF — TCP state machine, SYN throttle, blacklist, ringbuf Layer 2: PoW Challenge — SHA-256 hashcash, dynamic difficulty, constant-time verify Layer 3: Rust Core — HMAC handshake, rate limit, death code (existing) Layer 4: Velocity — Physics check, CAPTCHA, protocol verification Layer 5: Paper — Heartbeat, auto-registration (existing) Layer 6: Traffic Intel — EWMA, 168h profiling, reputation, alerts Infra: XDP→Prometheus metrics, ClickHouse + Grafana dashboard, Docker Compose Testing: 100-IP DDoS simulation, MHDDoS ref analysis, load test report Fixes: VarInt sign extension UB, pure ACK deadlock, RST/FIN cleanup Ref: MHDDoS, Sonar, LimboFilter, AtomGuard, Infrarust, MC-XDP-eBPF, PowGo
This commit is contained in:
parent
414d3be659
commit
6d76a7eeb1
66 changed files with 4529 additions and 1003 deletions
|
|
@ -23,6 +23,10 @@ pub struct Config {
|
|||
pub logging: LoggingConfig,
|
||||
#[serde(default)]
|
||||
pub metrics: MetricsConfig,
|
||||
#[serde(default)]
|
||||
pub pow: PowConfig,
|
||||
#[serde(default)]
|
||||
pub whitelist: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, Deserialize)]
|
||||
|
|
@ -139,6 +143,7 @@ pub struct StoreConfig {
|
|||
pub redis_url: Option<String>,
|
||||
#[serde(default = "default_blacklist_cache_ttl")]
|
||||
pub blacklist_cache_ttl_secs: u64,
|
||||
pub clickhouse_url: Option<String>,
|
||||
}
|
||||
|
||||
fn default_blacklist_cache_ttl() -> u64 {
|
||||
|
|
@ -150,6 +155,7 @@ impl Default for StoreConfig {
|
|||
Self {
|
||||
redis_url: None,
|
||||
blacklist_cache_ttl_secs: 300,
|
||||
clickhouse_url: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -247,6 +253,31 @@ impl Default for DeathCodeConfig {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct PowConfig {
|
||||
#[serde(default = "default_pow_enabled")]
|
||||
pub enabled: bool,
|
||||
#[serde(default = "default_pow_difficulty")]
|
||||
pub difficulty: u8,
|
||||
}
|
||||
|
||||
fn default_pow_enabled() -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn default_pow_difficulty() -> u8 {
|
||||
4
|
||||
}
|
||||
|
||||
impl Default for PowConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
enabled: true,
|
||||
difficulty: 4,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Config {
|
||||
pub fn from_file(path: &str) -> anyhow::Result<Self> {
|
||||
let contents = fs::read_to_string(path)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue