feat: version 1.0.0 avec corrections critiques et nommage de packages
Ajout du point d'entrée principal : - cmd/ja4sentinel/main.go : pipeline complet avec gestion des signaux - Intégration des modules (capture, tlsparse, fingerprint, output) - Shutdown propre avec context.Context Corrections du parsing TLS : - Flow key unidirectionnel (client → serveur uniquement) - Timeout de flux configurable via FlowTimeoutSec - Structure ConnectionFlow simplifiée Améliorations de l'API : - Champs TCPMSS et TCPWScale en pointeurs (omitempty correct) - NewLogRecord mis à jour pour les champs optionnels Mise à jour de l'architecture : - architecture.yml : documentation des champs optionnels - Règles de flux unidirectionnel documentées Système de packages : - Version par défaut : 1.0.0 - Nommage cohérent : ja4sentinel_1.0.0_amd64.deb - Scripts build-deb.sh et build-rpm.sh simplifiés - Extraction correcte des checksums Tests : - TestFlowKey mis à jour pour le format unidirectionnel - Tous les tests passent (go test ./...) - go vet clean Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
19
api/types.go
19
api/types.go
@ -75,8 +75,8 @@ type LogRecord struct {
|
||||
|
||||
// Flattened TCPMeta fields
|
||||
TCPWindow uint16 `json:"tcp_meta_window_size"`
|
||||
TCPMSS uint16 `json:"tcp_meta_mss,omitempty"`
|
||||
TCPWScale uint8 `json:"tcp_meta_window_scale,omitempty"`
|
||||
TCPMSS *uint16 `json:"tcp_meta_mss,omitempty"`
|
||||
TCPWScale *uint8 `json:"tcp_meta_window_scale,omitempty"`
|
||||
TCPOptions string `json:"tcp_meta_options"` // comma-separated list
|
||||
|
||||
// Fingerprints
|
||||
@ -161,6 +161,17 @@ func NewLogRecord(ch TLSClientHello, fp *Fingerprints) LogRecord {
|
||||
opts = joinStringSlice(ch.TCPMeta.Options, ",")
|
||||
}
|
||||
|
||||
// Helper to create pointer from value for optional fields
|
||||
var mssPtr *uint16
|
||||
if ch.TCPMeta.MSS != 0 {
|
||||
mssPtr = &ch.TCPMeta.MSS
|
||||
}
|
||||
|
||||
var wScalePtr *uint8
|
||||
if ch.TCPMeta.WindowScale != 0 {
|
||||
wScalePtr = &ch.TCPMeta.WindowScale
|
||||
}
|
||||
|
||||
rec := LogRecord{
|
||||
SrcIP: ch.SrcIP,
|
||||
SrcPort: ch.SrcPort,
|
||||
@ -171,8 +182,8 @@ func NewLogRecord(ch TLSClientHello, fp *Fingerprints) LogRecord {
|
||||
IPID: ch.IPMeta.IPID,
|
||||
IPDF: ch.IPMeta.DF,
|
||||
TCPWindow: ch.TCPMeta.WindowSize,
|
||||
TCPMSS: ch.TCPMeta.MSS,
|
||||
TCPWScale: ch.TCPMeta.WindowScale,
|
||||
TCPMSS: mssPtr,
|
||||
TCPWScale: wScalePtr,
|
||||
TCPOptions: opts,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user