chore: suppression des services obsolètes (sentinel, correlator, mod-reqin-log)

Remplacés par l'agent ja4ebpf (eBPF CO-RE). Nettoyage complet :

Supprimé :
- old/ (archive de l'ancienne architecture)
- services/correlator/ (logcorrelator Go)
- services/sentinel/ (capture pcap Go)
- services/mod-reqin-log/ (module Apache C)
- shared/go/ja4common/ (lib Go partagée — plus importée par ja4ebpf)
- tests/integration/platform/ (test correlator+sentinel+httpd)
- tests/integration/docker-compose.yml (compose ancienne archi)
- tests/integration/run-tests.sh (runner correlator/sentinel)
- tests/integration/verify_mvs.py (script orphelin)

Nettoyé :
- go.work : retire ./shared/go/ja4common
- services/ja4ebpf/go.mod : retire replace ja4common (jamais importé)
- services/ja4ebpf/Dockerfile* : retire les COPY ja4common inutiles
- Makefile : retire test-ja4common-python, test-integration*, targets obsolètes
- tests/integration/README.md : réécrit pour l'architecture ja4ebpf

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
toto
2026-04-12 01:48:14 +02:00
parent dc6ffd6474
commit 9734e21fe3
252 changed files with 34 additions and 67348 deletions

View File

@ -1,98 +1,42 @@
# Tests d'intégration full-stack — ja4-platform
# Tests d'intégration — ja4-platform
## Architecture
## Architecture de test
```
┌─────────────────────────────────────────────────────┐
│ platform (Rocky Linux 9) │
│ │
│ ┌──────────┐ http.socket ┌────────────┐ │
│ │ Apache │───────────────→│ │ │
│ │+ mod-reqin│ │ correlator │──→ ClickHouse
│ └──────────┘ │ │ │
│ ┌──────────┐ network.socket │ │ │
│ │ sentinel │───────────────→│ │ │
│ │(TLS pcap) │ └────────────┘ │
│ └──────────┘ │
│ cap_add: NET_RAW, NET_ADMIN │
└─────────────────────────────────────────────────────┘
↑ HTTPS │
test traffic ja4_logs.http_logs_raw
┌──────────────────┐
│ ClickHouse │
│ ja4_logs │
│ ja4_processing │
└──────────────────┘
↑ ↑
┌──────┘ └──────┐
┌──────────────┐ ┌──────────────┐
│ bot-detector │ │ dashboard │
│ (ML/Python) │ │ (FastAPI) │
└──────────────┘ └──────────────┘
```
Chaque stack lance deux containers Docker :
- **platform** : serveur web (Apache/nginx/varnish/hitch) + agent **ja4ebpf** (eBPF CO-RE)
- **clickhouse** : base ClickHouse locale avec le schéma complet
## Utilisation
Le générateur de trafic envoie 300 requêtes HTTPS et vérifie que la chaîne
complète fonctionne : TC ingress (L3/L4) → uprobe SSL (L7) → `http_logs_raw` → MV → `http_logs`.
## Stacks disponibles
| Stack | Serveur TLS | Backend |
|-------|-------------|---------|
| `apache` | Apache httpd + mod_ssl + mod_http2 | — |
| `nginx` | nginx + HTTP/2 | — |
| `nginx-varnish` | nginx (TLS) | Varnish (`-p feature=+http2`) |
| `hitch-varnish` | hitch (TLS offload, ALPN h2) | Varnish (`-p feature=+http2`) |
## Commandes
```bash
# Lancer les tests (build + start + test + teardown)
./run-tests.sh
# Stack unique (Rocky Linux 9)
make test-apache
make test-nginx
make test-nginx-varnish
make test-hitch-varnish
# Garder le stack actif après les tests (debug)
./run-tests.sh --no-down
# Toutes les stacks (Rocky Linux 9)
make test-all-stacks
# Build uniquement (pas de tests)
./run-tests.sh --build-only
# Ou depuis la racine du monorepo :
make test-integration
# Matrice multi-distro (el8 / el9 / el10)
make test-matrix
make test-matrix MATRIX_STACKS=nginx,nginx-varnish MATRIX_DISTROS=el9
```
## Conteneurs
## Matrice de compatibilité
| Conteneur | Image | Rôle |
|-----------|-------|------|
| `clickhouse` | clickhouse/clickhouse-server:24.8 | Base de données, schema auto-init |
| `platform` | Rocky Linux 9 (build custom) | Apache HTTPS + mod-reqin-log + sentinel + correlator |
| `bot-detector` | Python 3.11 | Détection d'anomalies ML |
| `dashboard` | Python 3.11 / FastAPI | API SOC |
## Capabilities réseau
Le conteneur `platform` a besoin de :
- `NET_RAW` — pour la capture de paquets réseau (sentinel/pcap)
- `NET_ADMIN` — pour la configuration de l'interface réseau
Ces capabilities sont déclarées dans `docker-compose.yml` :
```yaml
platform:
cap_add:
- NET_RAW
- NET_ADMIN
```
## Phases de test
1. **Schema ClickHouse** — vérifie les 2 bases, tables clés, utilisateurs
2. **Génération de trafic** — 50+ requêtes HTTPS vers Apache
3. **Pipeline de données** — vérifie les logs bruts et parsés dans ClickHouse
4. **Dashboard API** — vérifie /health et /api/metrics
5. **Bot-detector** — vérifie que le processus tourne
6. **Sentinel** — vérifie la capture réseau
## Debug
```bash
# Logs du platform (Apache + correlator + sentinel)
docker compose logs platform
# Logs corrélés
docker compose exec platform cat /var/log/logcorrelator/correlated.log
# Requête ClickHouse directe
docker compose exec clickhouse clickhouse-client \
-q "SELECT time, src_ip, method, host, path FROM ja4_logs.http_logs ORDER BY time DESC LIMIT 10"
# Shell dans le platform
docker compose exec platform bash
```
| Stack | el8 (AlmaLinux 8) | el9 (Rocky Linux 9) | el10 (AlmaLinux 10) |
|-------|:-----------------:|:-------------------:|:-------------------:|
| apache | ✓ | ✓ | ✓ |