Nouveaux modules: - cmd/ja4sentinel/main.go : point d'entrée avec pipeline capture→parse→fingerprint→output - internal/config/loader.go : chargement YAML + env (JA4SENTINEL_*) + validation - internal/tlsparse/parser.go : extraction ClientHello avec suivi d'état de flux (NEW/WAIT_CLIENT_HELLO/JA4_DONE) - internal/fingerprint/engine.go : génération JA4/JA3 via psanford/tlsfingerprint - internal/output/writers.go : StdoutWriter, FileWriter, UnixSocketWriter, MultiWriter Infrastructure: - Dockerfile (multi-stage), Dockerfile.dev, Dockerfile.test-server - Makefile (build, test, lint, docker-build-*) - docker-compose.test.yml pour tests d'intégration - README.md (276 lignes) avec architecture, config, exemples API (api/types.go): - Ajout Close() aux interfaces Capture et Parser - Ajout FlowTimeoutSec dans Config (défaut: 30s, env: JA4SENTINEL_FLOW_TIMEOUT) - ServiceLog: +Timestamp, +TraceID, +ConnID - LogRecord: champs flatten (ip_meta_*, tcp_meta_*, ja4*) - Helper NewLogRecord() pour conversion TLSClientHello+Fingerprints→LogRecord Architecture (architecture.yml): - Documentation module logging + interfaces LoggerFactory/Logger - Section service.systemd complète (unit, security, capabilities) - Section logging.strategy (JSON lines, champs, règles) - api.Config: +FlowTimeoutSec documenté Fixes/cleanup: - Suppression internal/api/types.go (consolidé dans api/types.go) - Correction imports logging (ja4sentinel/api) - .dockerignore / .gitignore - config.yml.example Tests: - Tous les modules ont leurs tests (*_test.go) - Tests unitaires : capture, config, fingerprint, output, tlsparse - Tests d'intégration via docker-compose.test.yml Build: - Binaires dans dist/ (make build → dist/ja4sentinel) - Docker runtime avec COPY --from=builder /app/dist/ Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
50 lines
1.1 KiB
YAML
50 lines
1.1 KiB
YAML
# Docker Compose for integration testing
|
|
# Based on architecture.yml testing.levels.integration
|
|
version: '3.8'
|
|
|
|
services:
|
|
# TLS test server for generating test traffic
|
|
tls-server:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.test-server
|
|
image: ja4sentinel-test-server:latest
|
|
networks:
|
|
- test-network
|
|
ports:
|
|
- "8443:8443"
|
|
command: ["-port", "8443"]
|
|
|
|
# ja4sentinel integration test runner
|
|
ja4sentinel-test:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.dev
|
|
image: ja4sentinel-dev:latest
|
|
networks:
|
|
- test-network
|
|
cap_add:
|
|
- NET_RAW
|
|
- NET_ADMIN
|
|
volumes:
|
|
- ./test-results:/app/test-results
|
|
environment:
|
|
- JA4SENTINEL_INTERFACE=eth0
|
|
- JA4SENTINEL_PORTS=8443
|
|
depends_on:
|
|
- tls-server
|
|
command: ["make", "test-integration"]
|
|
|
|
# Test client that generates TLS traffic
|
|
tls-client:
|
|
image: curlimages/curl:latest
|
|
networks:
|
|
- test-network
|
|
depends_on:
|
|
- tls-server
|
|
command: ["curl", "-kv", "https://tls-server:8443/"]
|
|
|
|
networks:
|
|
test-network:
|
|
driver: bridge
|