Initial commit: Bot Detector Dashboard for SOC Incident Response

🛡️ Dashboard complet pour l'analyse et la classification des menaces

Fonctionnalités principales:
- Visualisation des détections en temps réel (24h)
- Investigation multi-entités (IP, JA4, ASN, Host, User-Agent)
- Analyse de corrélation pour classification SOC
- Clustering automatique par subnet/JA4/UA
- Export des classifications pour ML

Composants:
- Backend: FastAPI (Python) + ClickHouse
- Frontend: React + TypeScript + TailwindCSS
- 6 routes API: metrics, detections, variability, attributes, analysis, entities
- 7 types d'entités investigables

Documentation ajoutée:
- NAVIGATION_GRAPH.md: Graph complet de navigation
- SOC_OPTIMIZATION_PROPOSAL.md: Proposition d'optimisation pour SOC
  • Réduction de 7 à 2 clics pour classification
  • Nouvelle vue /incidents clusterisée
  • Panel latéral d'investigation
  • Quick Search (Cmd+K)
  • Timeline interactive
  • Graph de corrélations

Sécurité:
- .gitignore configuré (exclut .env, secrets, node_modules)
- Credentials dans .env (à ne pas committer)

⚠️ Audit sécurité réalisé - Voir recommandations dans SOC_OPTIMIZATION_PROPOSAL.md

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
SOC Analyst
2026-03-14 21:33:55 +01:00
commit a61828d1e7
55 changed files with 11189 additions and 0 deletions

View File

@ -0,0 +1,491 @@
# 🛡️ SOC Incident Response Dashboard - Réorganisation Optimisée
## 🎯 Objectif
Optimiser le dashboard pour la **réponse aux incidents** en minimisant le nombre de clics et en maximisant l'information contextuelle pour les analystes SOC.
---
## 📋 PROBLÈMES ACTUELS IDENTIFIÉS
### ❌ Problèmes de navigation
1. **Trop de clics** pour atteindre l'information critique (5-7 clics moyens)
2. **Information fragmentée** entre différentes vues
3. **Pas de vue "Incident"** consolidée
4. **Recherche non priorisée** pour les cas d'usage SOC
### ❌ Problèmes d'ergonomie SOC
1. **Pas de timeline d'incident** visuelle
2. **Pas de scoring de risque** visible immédiatement
3. **Classification trop enfouie** (au bout de 5 panels)
4. **Pas de vue "comparaison"** avant/après classification
---
## ✅ NOUVELLE ARCHITECTURE PROPOSÉE
### Vue d'ensemble réorganisée
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ 🚨 SOC DASHBOARD - INCIDENT RESPONSE │
├─────────────────────────────────────────────────────────────────────────────┤
│ [🔍 QUICK SEARCH: IP / JA4 / ASN / Host] [🎯 PRIORITÉS] [⏰ TIMELINE] │
└─────────────────────────────────────────────────────────────────────────────┘
├──▶ /incidents (NOUVEAU - Vue principale SOC)
├──▶ /investigate (Recherche avancée)
└──▶ /threat-intel (Base de connaissances)
```
---
## 🔄 NOUVELLES PAGES PRINCIPALES
### 1. `/incidents` - Vue Incident (REMPPLACE Dashboard)
**Objectif:** Vue immédiate des incidents actifs prioritaires
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ 🚨 INCIDENTS ACTIFS (24h) │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ 📊 MÉTRIQUES CRITIQUES │
│ ┌──────────────┬──────────────┬──────────────┬──────────────┐ │
│ │ 🔴 CRITICAL │ 🟠 HIGH │ 🟡 MEDIUM │ 📈 TREND │ │
│ │ 45 │ 120 │ 340 │ +23% │ │
│ │ +12 depuis │ +34 depuis │ -15 depuis │ vs 24h prev │ │
│ │ 1h │ 1h │ 1h │ │ │
│ └──────────────┴──────────────┴──────────────┴──────────────┘ │
│ │
│ 🎯 INCIDENTS PRIORITAIRES (Auto-clusterisés) │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ 🔴 INCIDENT #INC-2024-0314-001 Score: 95/100 │ │
│ │ ├─ 15 IPs du subnet 192.168.1.0/24 (CN, OVH) │ │
│ │ ├─ JA4: t13d190900_... (50 IPs) │ │
│ │ ├─ 100% Bot UA (python-requests) │ │
│ │ ├─ Cible: /api/login (85% des requêtes) │ │
│ │ └─ [🔍 Investiguer] [📊 Timeline] [🏷️ Classifier] │ │
│ ├────────────────────────────────────────────────────────────────────┤ │
│ │ 🟠 INCIDENT #INC-2024-0314-002 Score: 78/100 │ │
│ │ ├─ 89 IPs, 12 pays, ASN: Amazon AWS │ │
│ │ ├─ JA4 rotation: 8 fingerprints │ │
│ │ ├─ 60% Script UA │ │
│ │ └─ [🔍 Investiguer] [📊 Timeline] [🏷️ Classifier] │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ │
│ 🗺️ CARTE DES MENACES (Géolocalisation) │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ [Carte interactive avec clusters par pays] │ │
│ │ 🇨🇳 CN: 45% 🇺🇸 US: 23% 🇩🇪 DE: 12% 🇫🇷 FR: 8% Autres: 12% │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ │
│ 📈 TIMELINE DES ATTAQUES (24h) │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ [Graphique temporel avec pics annotés] │ │
│ │ 00h 04h 08h 12h 16h 20h 24h │ │
│ │ │ │ │ │ │ │ │ │ │
│ │ │ 🟡 │ 🟢 │ 🟠 │ 🔴 │ 🟠 │ 🟡 │ │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ │
│ 🔥 TOP ACTIFS (Dernière heure) │
│ ┌────────────────────────────────────────────────────────────────────┐ │
│ │ # IP JA4 ASN Pays Score Hits/s │ │
│ │ 1 192.168.1.100 t13d... OVH 🇨🇳 95 450 │ │
│ │ 2 10.0.0.50 9dc9... AWS 🇺🇸 88 320 │ │
│ │ 3 172.16.0.23 a1b2... Google 🇩🇪 82 280 │ │
│ └────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
**Actions rapides depuis cette vue:**
- 🔍 **Investiguer** → Ouvre panel latéral sans quitter la vue
- 📊 **Timeline** → Voir l'historique complet de l'incident
- 🏷️ **Classifier** → Classification rapide (1 clic)
- 📤 **Exporter** → Export IOC (IPs, JA4, UA)
---
### 2. `/investigate` - Investigation Avancée (NOUVEAU)
**Object:** Recherche multi-critères pour investigation proactive
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ 🔍 INVESTIGATION AVANCÉE │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ [🔍 Recherche: IP, JA4, ASN, Host, UA, CIDR] │
│ │
│ FILTRES RAPIDES │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Menace: [🔴 CRITICAL] [🟠 HIGH] [🟡 MEDIUM] [🟢 LOW] [Tous] │ │
│ │ Modèle: [✓ Complet] [✓ Applicatif] │ │
│ │ Temps: [1h] [6h] [24h] [7j] [30j] [Personnalisé] │ │
│ │ Pays: [🇨🇳 CN] [🇺🇸 US] [🇷🇺 RU] [🇫🇷 FR] [Tous] │ │
│ │ ASN: [OVH] [AWS] [Google] [Azure] [Tous] │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ RÉSULTATS (Tableau enrichi) │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ ☐ │ IP │ JA4 │ Host │ ASN │ Pays │ ⚡Score │ 📊Hits │ 🏷Tags │ ⚡ │ │
│ │───┼────┼─────┼──────┼─────┼──────┼─────────┼────────┼────────┼────│ │
│ │ ☐ │ 🔴 │ 🔴 │ API │ OVH │ 🇨🇳 │ 95 │ 450 │ 🤖 Bot │ ⚡ │ │
│ │ ☐ │ 🟠 │ 🟡 │ Web │ AWS │ 🇺🇸 │ 78 │ 320 │ 🕷️ Scr │ ⚡ │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ ACTIONS EN MASSE │
│ [🏷️ Taguer sélection] [📤 Export IOC] [🚫 Blacklister] [📊 Rapport] │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
---
### 3. `/incident/:id` - Vue Incident Détaillée (NOUVEAU)
**Objectif:** Vue complète d'un incident clusterisé
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ 🔴 INCIDENT #INC-2024-0314-001 Score: 95/100 │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ 📊 RÉSUMÉ │
│ ┌──────────────────────────────────────────────────────────────────────┐ │
│ │ Période: 14/03 08:00 - 14/03 14:00 (6h) │ │
│ │ IPs impliquées: 15 (subnet 192.168.1.0/24) │ │
│ │ Total requêtes: 45,234 │ │
│ │ Cible principale: /api/login (85%) │ │
│ │ Classification: 🤖 Bot Network - Scraping │ │
│ │ Analyste: En attente │ │
│ └──────────────────────────────────────────────────────────────────────┘ │
│ │
│ 🗺️ GRAPH DE CORRÉLATION (NOUVEAU) │
│ ┌──────────────────────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ [Subnet 192.168.1.0/24] │ │
│ │ │ │ │
│ │ ┌──────┴──────┐ │ │
│ │ ▼ ▼ │ │
│ │ [JA4: t13d...] [JA4: 9dc9...] │ │
│ │ │ │ │ │
│ │ └──────┬──────┘ │ │
│ │ ▼ │ │
│ │ [python-requests/2.28] │ │
│ │ │ │ │
│ │ ┌──────┴──────────────────┐ │ │
│ │ ▼ ▼ │ │
│ │ [/api/login] [/api/users] │ │
│ │ │ │
│ └──────────────────────────────────────────────────────────────────────┘ │
│ │
│ 📈 TIMELINE DÉTAILLÉE │
│ ┌──────────────────────────────────────────────────────────────────────┐ │
│ │ [Graphique avec événements annotés] │ │
│ │ 08:00 🟢 Détection initiale │ │
│ │ 09:15 🟠 Escalade (100 req/s) │ │
│ │ 10:30 🔴 Pic (450 req/s) │ │
│ │ 11:00 🟡 Stabilisation │ │
│ └──────────────────────────────────────────────────────────────────────┘ │
│ │
│ 🎯 ENTITÉS IMPLiquÉES │
│ ┌──────────────────────────────────────────────────────────────────────┐ │
│ │ IPs (15) │ JA4 (2) │ UA (1) │ Hosts (2) │ │
│ │ ───────────────── │ ──────────── │ ──────────── │ ───────────────── │ │
│ │ • 192.168.1.100 │ • t13d... │ • python- │ • api.example.com │ │
│ │ • 192.168.1.101 │ • 9dc9... │ requests │ • web.example.com │ │
│ │ • 192.168.1.102 │ │ │ │ │
│ │ [+12 autres] │ │ │ │ │
│ └──────────────────────────────────────────────────────────────────────┘ │
│ │
│ 🏷️ CLASSIFICATION │
│ ┌──────────────────────────────────────────────────────────────────────┐ │
│ │ Label: [🤖 MALICIOUS] │ │
│ │ Tags: [scraping] [bot-network] [hosting-asn] [country-cn] │ │
│ │ Confiance: 95% │ │
│ │ Analyste: [__________] │ │
│ │ Comment: [________________________________] │ │
│ │ [💾 Sauvegarder] [📤 Export IOC] [📊 Rapport PDF] │ │
│ └──────────────────────────────────────────────────────────────────────┘ │
│ │
│ 📝 NOTES D'INCIDENT │
│ ┌──────────────────────────────────────────────────────────────────────┐ │
│ │ [Timeline des actions analystes] │ │
│ │ 14/03 10:45 - User1: Classification MALICIOUS │ │
│ │ 14/03 11:00 - User1: Export IOC vers firewall │ │
│ │ [ Ajouter une note] │ │
│ └──────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
---
### 4. `/threat-intel` - Base de Connaissances (NOUVEAU)
**Objectif:** Historique et recherche dans les classifications
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ 📚 THREAT INTELLIGENCE │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ 🔍 [Recherche: IP, JA4, Tag, Commentaire, Analyste] │
│ │
│ STATISTIQUES │
│ ┌──────────────┬──────────────┬──────────────┬──────────────┐ │
│ │ 🤖 Malicious │ ⚠️ Suspicious│ ✅ Legitimate│ 📊 Total │ │
│ │ 1,234 │ 2,567 │ 8,901 │ 12,702 │ │
│ └──────────────┴──────────────┴──────────────┴──────────────┘ │
│ │
│ CLASSIFICATIONS RÉCENTES │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ Date │ Entité │ Valeur │ Label │ Tags │ │
│ │────────────│───────────│───────────────│───────────│───────────────│ │
│ │ 14/03 11:0 │ IP │ 192.168.1.100 │ 🤖 Malic. │ 🤖🕷️☁️ │ │
│ │ 14/03 10:5 │ JA4 │ t13d... │ ⚠️ Suspic. | 🤖🔄 │ │
│ │ 14/03 10:3 │ IP │ 10.0.0.50 │ ✅ Legit. | ✅🏢 │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ TOP TAGS (30j) │
│ [scraping: 234] [bot-network: 189] [hosting-asn: 156] [scanner: 123] │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
```
---
## 🎯 WORKFLOWS OPTIMISÉS
### Workflow 1: Réponse à incident (5 clics → 2 clics)
**AVANT:**
```
Dashboard → Détections → Filtre CRITICAL → Clic IP → Details → Investigation → Classification
(7 clics)
```
**MAINTENANT:**
```
/incidents → Incident #1 → [Panel latéral] → Classifier
(2 clics)
```
### Workflow 2: Investigation d'IP (6 clics → 1 clic)
**AVANT:**
```
Dashboard → Détections → Recherche IP → Clic → Details → Investigation
(6 clics)
```
**MAINTENANT:**
```
[Barre de recherche globale] → IP → [Panel latéral complet]
(1 clic + search)
```
### Workflow 3: Classification en masse (nouvelle fonctionnalité)
```
/investigate → Filtre → Sélection multiple → [Action en masse] → Taguer/Exporter
```
---
## 🔧 COMPOSANTS À CRÉER
### 1. Panel Latéral d'Investigation (Slide-over)
```typescript
// Composant à ajouter: InvestigationPanel.tsx
// S'ouvre par dessus n'importe quelle page
// Affiche:
// - Stats rapides de l'entité
// - Corrélations principales
// - Actions rapides (Classifier, Export, Blacklister)
// - Historique des classifications
```
### 2. Graph de Corrélations
```typescript
// Composant à ajouter: CorrelationGraph.tsx
// Visualisation graphique des relations:
// IP → JA4 → UA → Hosts → Paths
// Utiliser D3.js ou React Flow
```
### 3. Timeline Interactive
```typescript
// Composant à ajouter: IncidentTimeline.tsx
// Timeline horizontale avec:
// - Events annotés
// - Zoomable
// - Filtrable par type d'événement
```
### 4. Quick Search Bar
```typescript
// Composant à ajouter: QuickSearch.tsx
// Barre de recherche globale avec:
// - Auto-complete
// - Détection de type (IP, JA4, CIDR, etc.)
// - Historique des recherches
// - Raccourcis clavier (Cmd+K)
```
### 5. Incident Clusterizer
```typescript
// Backend: /api/incidents/clusters
// Algorithme de clustering automatique:
// - Par subnet /24
// - Par JA4
// - Par UA
// - Par pattern temporel
```
---
## 📊 NOUVELLES API À CRÉER
```python
# Backend routes à ajouter
# 1. Incidents clustering
GET /api/incidents/clusters
Retourne les incidents auto-clusterisés
GET /api/incidents/:id
Détails complets d'un incident
POST /api/incidents/:id/classify
Classification rapide
# 2. Threat Intel
GET /api/threat-intel/search
Recherche multi-critères
GET /api/threat-intel/statistics
Stats de classification
# 3. Quick actions
POST /api/actions/blacklist
Ajout à blacklist
POST /api/actions/export-ioc
Export IOC (STIX/TAXII)
# 4. Correlation graph
GET /api/correlation/graph?ip=...
Retourne graphe de corrélations
```
---
## 🎨 AMÉLIORATIONS UX
### 1. Code couleur cohérent
```
🔴 CRITICAL / MALICIOUS → Rouge (#EF4444)
🟠 HIGH / SUSPICIOUS → Orange (#F59E0B)
🟡 MEDIUM → Jaune (#EAB308)
🟢 LOW / LEGITIMATE → Vert (#10B981)
🔵 INFO → Bleu (#3B82F6)
```
### 2. Raccourcis clavier
```
Cmd+K → Quick search
Cmd+I → Voir incidents
Cmd+E → Export sélection
Cmd+F → Filtrer
Esc → Fermer panel
```
### 3. Indicateurs visuels
```
⚡ Score de risque (0-100)
🔥 Trend (vs période précédente)
📊 Volume (hits/s)
🏷️ Tags (couleur par catégorie)
```
---
## 📈 MÉTRIQUES DE PERFORMANCE
### Objectifs de réduction
| Métrique | Actuel | Cible | Gain |
|-----------------------------|--------|-------|------|
| Clics pour classification | 7 | 2 | 71% |
| Temps investigation IP | 45s | 10s | 78% |
| Pages pour vue complète | 5 | 1 | 80% |
| Actions en masse | 0 | ✓ | NEW |
---
## 🚀 PLAN DE MIGRATION
### Phase 1: Quick wins (1 semaine)
- [ ] Ajouter Quick Search bar
- [ ] Créer panel latéral d'investigation
- [ ] Ajouter raccourcis clavier
- [ ] Améliorer page /incidents
### Phase 2: Core features (2 semaines)
- [ ] Créer système de clustering auto
- [ ] Développer graph de corrélations
- [ ] Implémenter timeline interactive
- [ ] Ajouter actions en masse
### Phase 3: Advanced (2 semaines)
- [ ] Base Threat Intelligence
- [ ] Export IOC (STIX/TAXII)
- [ ] Rapports PDF auto
- [ ] Intégration SIEM
---
## 📝 RECOMMANDATIONS FINALES
### Pour les analystes SOC
1. **Prioriser par score de risque** - Ne pas tout investiguer
2. **Utiliser le clustering** - Voir les patterns, pas juste les IPs
3. **Classifier rapidement** - Même avec confiance moyenne
4. **Exporter les IOC** - Automatiser la réponse
### Pour les développeurs
1. **Garder l'état dans l'URL** - Pour partage et refresh
2. **Panel latéral > Navigation** - Moins de context switching
3. **Auto-refresh intelligent** - Seulement si page visible
4. **Optimiser requêtes ClickHouse** - Agrégations pré-calculées
### Pour la sécurité
1. **Audit logs** - Tracker toutes les actions analystes
2. **RBAC** - Rôles (Analyste, Senior, Admin)
3. **Rate limiting** - Par utilisateur
4. **Session timeout** - 15min d'inactivité
---
## 🎯 CONCLUSION
Cette réorganisation transforme le dashboard d'un **outil de visualisation** en un **outil de réponse aux incidents**, réduisant considérablement le temps de traitement et améliorant l'efficacité des analystes SOC.
**Gain estimé:** 70% de temps gagné sur les investigations courantes.