72ad73819f
ENHANCEMENT: Multi-signal threat intelligence for SYN floods
PROBLEM:
SYN flood detection used only connection count for scoring.
Missing contextual intelligence signals that identify real threats:
- No AbuseIPDB reputation checking
- No geographic risk assessment
- No persistence tracking (sustained vs transient)
- No escalation detection (increasing attack intensity)
SOLUTION - 6 Intelligence Layers:
1. THREAT INTELLIGENCE LOOKUP (lines 2254-2295)
On first detection:
- AbuseIPDB confidence check (background, non-blocking)
* High confidence (≥75%): +30 points
* Medium confidence (≥50%): +15 points
- Geographic risk assessment: +5 points for high-risk countries
- Whitelisting check: Skip known-good services
- Data cached for subsequent detections
2. BASE CONNECTION SCORING (lines 2307-2316)
- 20-50 connections: +15 points (moderate threat)
- 50-100 connections: +25 points (high threat)
- 100+ connections: +40 points (critical threat)
3. PERSISTENCE DETECTION (lines 2318-2324)
Repeated detections = sustained attack (not transient spike)
- 5+ detections: +20 points (persistent attacker)
- 3-4 detections: +10 points (repeated attack)
Pattern: IP keeps appearing with high connection counts
4. ESCALATION DETECTION (lines 2326-2336)
Rising connection count = intensifying attack
- Increase ≥50 connections: +25 points (rapidly escalating)
- Increase ≥20 connections: +15 points (escalating)
Example: 30 conns → 80 conns → 150 conns = DANGER
5. ATTACK VELOCITY (existing, lines 2347-2349)
- 20+ attacks/hour: +30 points (extreme velocity)
- 10-19 attacks/hour: +20 points (high velocity)
- 10+ in 5 minutes: +15 points (rapid fire)
6. COORDINATED ATTACK DETECTION (existing, lines 2351-2378)
- Multiple attack vectors: +20 points (sophisticated)
- Subnet-wide attacks: +15 points (botnet/DDoS)
- Timing patterns: +10 points (automated)
SCORING EXAMPLES:
Example 1 - Transient False Positive:
- 25 connections, first detection, clean AbuseIPDB
- Score: 15 (base) = 15 total
- Result: Monitored, not blocked
Example 2 - Known Malicious Actor:
- 45 connections, AbuseIPDB 80% confidence, China
- Score: 15 (base) + 30 (AbuseIPDB) + 5 (geo) = 50 total
- Result: High threat, blocked if persists
Example 3 - Escalating Attack:
- Hit 1: 30 conns = 15 points
- Hit 2: 60 conns (+30 increase) = 25 + 15 (escalation) = 55 total
- Hit 3: 120 conns (+60 increase) = 40 + 25 (rapid esc) + 10 (repeat) = 130 → 100
- Result: INSTANT_BLOCK on 3rd detection
Example 4 - Persistent Botnet:
- Hit 5: 40 conns, part of /24 subnet attack, high velocity
- Score: 15 (base) + 20 (persistent) + 15 (subnet) + 20 (velocity) = 70
- Hit 6: Score 70 + 25 (base) = 95 → AUTO_BLOCK
This creates intelligent, context-aware blocking that distinguishes
real threats from noise.