Commit Graph

56 Commits

Author SHA1 Message Date
2a39f76ecd feat: add INFO, WARNING, ERROR logging for Unix socket output
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 02:23:05 +01:00
fb45c34940 feat: add debug mode for Unix socket output
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 02:22:05 +01:00
e862139fca fix: socket path to network.socket
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 02:14:32 +01:00
61cba76a0f ci: use Docker cache for builds
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 01:51:46 +01:00
f0276b17ab release: version 1.0.6
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 01:49:43 +01:00
40c3fad90e fix: unix socket path to /var/run/logcorrelator/network.sock
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 01:44:55 +01:00
a69de782cb release: version 1.0.5 - fix TCP options detection (NOP/EOL/SACK)
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 01:27:27 +01:00
a3f5d9a50c fix(rpm): move version macro definition before Version field
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
The %{spec_version} macro was being referenced in the Version field
before it was defined, causing RPM packages to show literal '%{spec_version}'
instead of the actual version number.

Moving the macro definition to the top of the spec file ensures it's
expanded correctly during rpmbuild.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 01:15:24 +01:00
a4b691c0b3 release: version 1.0.4
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
- Bump version from 1.0.2 to 1.0.4
- Add changelog entry for sdnotify integration
- Author: Jacquin Antoine <rpm@arkel.fr>

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 01:08:28 +01:00
2a7011162e docs(architecture.yml): document systemd sdnotify integration
- Add systemd_notify section with type, access, protocol details
- Document READY, WATCHDOG, STOPPING signals
- List benefits of sdnotify integration
- Add watchdog_sec: 30 to runtime configuration
- Update integration_rules to mention sdnotify usage

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 01:07:37 +01:00
dcd6bd0a94 feat: add systemd sdnotify support (ready, watchdog, stopping)
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
- Add github.com/coreos/go-systemd/v22/daemon dependency
- Signal SdNotifyReady after configuration is loaded
- Start watchdog goroutine that pings systemd every WatchdogSec/2
- Signal SdNotifyStopping during graceful shutdown
- Update systemd unit file:
  - Type=notify (instead of simple)
  - WatchdogSec=30 (auto-restart if service hangs)
  - NotifyAccess=main (only main process can notify)

Benefits:
- systemd knows when service is truly ready
- Automatic detection of hung/frozen service
- Better integration with systemd supervision
- More accurate service status reporting

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 01:06:20 +01:00
78c9102602 fix(packaging): use version from spec file for RPM builds
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
- Update Makefile to extract PKG_VERSION from spec file
  Reads '%define spec_version 1.0.2' as default version
- Update spec file with proper version macro logic
  Version field now uses %{spec_version}
  Supports override via --define 'build_version X.Y.Z'
  Falls back to 1.0.2 when build_version is not defined

This ensures RPM packages are built with the correct version
defined in the spec file (1.0.2) instead of hardcoded 1.0.0.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 00:38:21 +01:00
9ff0e7f9d2 chore: remove unused files and update CI
- Delete residual editor files:
  - '2) Lancer les tests unitaires' (command already in Makefile)
  - '3) Lancer la vérification statique' (command already in Makefile)
- Delete CHANGELOG.md (changelog maintained in RPM spec)

ci: remove CentOS 7 (el7) from RPM workflow

- Remove el7 build artifacts from build-rpm.yml
- Update release assets to only include el8, el9, el10

docs(architecture.yml): fix test-integration command

- Add --exit-code-from ja4sentinel-test for proper exit code handling

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 00:35:36 +01:00
f80b7a1fa7 fix(api): restore DefaultConfig() and constants used by config loader
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
- Restore api.DefaultConfig() - used by internal/config/loader.go
- Restore DefaultInterface, DefaultPort, DefaultBPFFilter constants
- Restore DefaultFlowTimeout, DefaultPacketBuffer constants
- Remove unused LogLevel* constants (never referenced in codebase)

docs(architecture.yml): update packaging and service sections

- Update packaging tool from fpm to rpmbuild
- Remove CentOS 7 / RHEL 7 from target distros (EOL)
- Update rpm_builder stage description for rpmbuild workflow
- Add spec_file section with version_macro documentation
- Update service to run as root (required for packet capture)
- Update security sandboxing to match current systemd unit
- Remove pid_file (not used)
- Update binary_path from /usr/local/bin to /usr/bin

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 00:29:15 +01:00
1bf0f46ce5 chore: remove unused files and code
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
- Delete obsolete RPM maintainer scripts (postinst, prerm, postrm)
  Scripts are now embedded in ja4sentinel.spec
- Delete unused RPM test script (test-rpm.sh)
  Referenced non-existent el7 builds, not integrated in CI
- Remove unused constants and functions from api/types.go:
  - DefaultInterface, DefaultPort, DefaultBPFFilter
  - DefaultFlowTimeout, DefaultPacketBuffer
  - LogLevelDebug, LogLevelInfo, LogLevelWarn, LogLevelError
  - DefaultConfig() function
- Update Makefile with RPM_DIR variable for consistency

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 00:26:48 +01:00
b137b3df85 fix(packaging): run service as root for packet capture
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
- Change systemd service to run as root instead of ja4sentinel user
- Remove user/group creation from RPM spec (%pre script)
- Update %post to set root:root ownership on directories
- Adjust security hardening for root execution (ProtectSystem=strict)
- Add ReadWritePaths for writable directories

Fixes: systemd error 'Failed at step USER spawning /usr/bin/ja4sentinel: No such process'

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 00:14:23 +01:00
0eff3a77c1 refactor(packaging): migrate from fpm to rpmbuild for RPM packaging
- Replace fpm with native rpmbuild in Dockerfile.package
- Setup proper rpmbuild directory structure (BUILD, RPMS, SOURCES, SPECS)
- Make spec file version dynamic via %{?build_version} macro
- Improve %post script with better systemd detection and error handling
- RPM now correctly uses VERSION build argument

Builds RPM packages for el8, el9, and el10 distributions.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-01 00:12:44 +01:00
d914ba1fa0 fix: add VERSION ARG to rpm-builder stage to fix RPM build cache issue
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
- Declare ARG VERSION in rpm-builder stage for FPM to access
- Add packages/ directory to .gitignore (build artifacts)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-28 23:39:21 +01:00
9172928f0f Add --no-cache to all docker build commands
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-28 23:09:58 +01:00
64fc0db1d9 release: mise à jour spec RPM version 1.0.2
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
- Version: 1.0.1 → 1.0.2
- libpcap >= 1.9.0 (suppression support CentOS 7)
- Mise à jour du changelog RPM
- Description mise à jour (Rocky/Alma/RHEL 8+)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-28 21:29:52 +01:00
f11c6d25f0 release: version 1.0.2 - suppression CentOS 7 + corrections
Nouveautés :
- Abandon support CentOS 7 (EOL juin 2024)
- Minimum : Rocky Linux 8 / AlmaLinux 8 / RHEL 8

Corrections :
- Race condition dans le parser TLS
- Fuite mémoire buffer HelloBuffer
- Gestion reconnexion socket UNIX améliorée
- Validation BPF renforcée
- Permissions fichiers sécurisées (0600)

Ajouts :
- Rotation de fichiers logs (100MB, 3 backups)
- 46 tests unitaires
- Détection race conditions
- Constantes nommées

Voir CHANGELOG.md pour le détail complet.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-28 21:28:48 +01:00
f76bc04879 chore: suppression support CentOS 7 (el7)
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
- CentOS 7 n'est plus supporté (EOL en juin 2024)
- Minimum requis : Rocky Linux 8 / AlmaLinux 8 / RHEL 8
- Nettoyage des fichiers RPM el7
- Mise à jour de la documentation

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-28 21:19:09 +01:00
fec500ba46 fix: correction race conditions et amélioration robustesse
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
- Correction race condition dans tlsparse avec mutex par ConnectionFlow
- Fix fuite mémoire buffer HelloBuffer
- Ajout rotation de fichiers logs (100MB, 3 backups)
- Implémentation queue asynchrone avec reconnexion exponentielle (socket UNIX)
- Validation BPF (caractères, longueur, parenthèses)
- Augmentation snapLen pcap de 1600 à 65535 bytes
- Permissions fichiers sécurisées (0600)
- Ajout 46 tests unitaires (capture, output, logging)
- Passage go test -race sans erreur

Tests: go test -race ./... ✓
Build: go build ./... ✓
Lint: go vet ./... ✓

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-28 21:15:45 +01:00
d14d6d6bf0 chore: bump version to 1.0.1 with changelog updates
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
- Update RPM spec version from 1.0.0 to 1.0.1
- Add comprehensive changelog entries for v1.0.1:
  - Configurable packet channel buffer size
  - Timestamp field in LogRecord
  - Race condition fix in packet capture
  - Strengthened TLS limits and socket timeouts
  - Improved configuration validation
  - Systemd service file inclusion in RPMs
  - Unified Docker-based packaging
  - Added unit tests and Godoc documentation

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-28 20:10:56 +01:00
c7e8fe874f fix: renforcer limites TLS, timeouts socket et validation config
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
Co-authored-by: aider (openrouter/openai/gpt-5.3-codex) <aider@aider.chat>
2026-02-28 20:01:39 +01:00
b15c20b4cc docs: ajouter fichiers de commandes go test et go vet
Co-authored-by: aider (openrouter/openai/gpt-5.3-codex) <aider@aider.chat>
2026-02-28 19:55:26 +01:00
e5bbff5158 fix: inclure le fichier systemd dans les RPM
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
- Ajout de usr/lib/systemd/system/ja4sentinel.service dans les packages fpm
- Correction du COPY pour utiliser le chemin local au lieu du builder
- Testé et validé sur Rocky Linux 9

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-28 18:42:27 +01:00
0be3ea9220 refactor: packaging RPM uniquement avec builder Rocky Linux 9
Some checks failed
Build RPM Package / Build RPM Packages (CentOS 7, Rocky 8/9/10) (push) Has been cancelled
- Suppression complète du support DEB (Debian/Ubuntu)
- Builder Rocky Linux 9 pour compatibilité binaire maximale
- Compilation dynamique avec libpcap comme dépendance runtime
- Activation du dépôt CRB pour libpcap-devel
- RPM générés pour el7, el8, el9, el10
- Mise à jour documentation et workflows GitHub Actions

Fix: erreur 'libpcap.so.0.8: cannot open shared object file' sur Rocky Linux 9

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-28 18:15:46 +01:00
86649b1630 feat: generate RPM packages for CentOS 7, Rocky Linux 8/9/10
Some checks failed
Build RPM Package / Build RPM Package (Rocky Linux) (push) Has been cancelled
Build DEB Package / Build DEB Package (Debian/Ubuntu) (push) Has been cancelled
- Update Dockerfile.package to build RPMs for multiple distributions
  using a unified fpm-based approach
- Add RPM maintainer scripts (postinst, prerm, postrm) for proper
  installation and service management
- Update ja4sentinel.spec for CentOS 7+ compatibility
- Add packaging/systemd/config.yml as default configuration
- Update test-rpm.sh to test installation on all 4 target distributions
- Fix CentOS 7 repository configuration (EOL - vault.centos.org)

Generated RPMs:
- el7: CentOS 7 (libpcap >= 1.4.0)
- el8: Rocky Linux 8 (libpcap >= 1.9.0)
- el9: Rocky Linux 9 (libpcap >= 1.9.0)
- el10: AlmaLinux 10 / Rocky Linux 10 (libpcap >= 1.9.0)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-28 17:02:58 +01:00
27eaa8aa4c refactor: update packaging test scripts to use Docker directly
Some checks failed
Build DEB Package / Build DEB Package (Debian/Ubuntu) (push) Has been cancelled
Build RPM Package / Build RPM Package (Rocky Linux) (push) Has been cancelled
- Remove dependency on Dockerfile.deb and Dockerfile.rpm
- Use debian:latest and rockylinux:8 containers directly
- Simplify test scripts by removing intermediate image builds
- Remove obsolete test-install-deb.sh and test-install-rpm.sh

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-27 16:18:15 +01:00
9c91884b7f refactor: remove obsolete packaging files
Some checks failed
Build DEB Package / Build DEB Package (Debian/Ubuntu) (push) Has been cancelled
Build RPM Package / Build RPM Package (Rocky Linux) (push) Has been cancelled
- Remove Dockerfile.deb and Dockerfile.rpm (replaced by Dockerfile.package)
- Remove build-deb.sh and build-rpm.sh (replaced by fpm in Dockerfile.package)
- Remove test Dockerfiles and old test packages
- Keep only: deb/, rpm/, systemd/ directories with maintainer scripts

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-27 16:06:34 +01:00
5b91f0cfb3 docs: update architecture.yml with unified packaging section
Some checks failed
Build DEB Package / Build DEB Package (Debian/Ubuntu) (push) Has been cancelled
Build RPM Package / Build RPM Package (Rocky Linux) (push) Has been cancelled
- Add packaging section describing DEB and RPM builds with fpm
- Document Dockerfile.package multi-stage build pipeline
- List files, directories, maintainer scripts, and dependencies
- Add verification commands for both package types

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-27 15:41:29 +01:00
f8dc2d4d82 Unify packaging: use Docker + fpm for DEB and RPM builds
- Add Dockerfile.package with multi-stage build (builder, package-builder, output)
- Update Makefile to use new Dockerfile.package for package-deb and package-rpm targets
- Replace dpkg-deb and rpmbuild with fpm for consistent packaging
- Both DEB and RPM packages now built from single Dockerfile

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-27 15:31:55 +01:00
952c929f55 docs(architecture): update api types for new fields
- Add Timestamp field to api.LogRecord (nanoseconds since Unix epoch)
- Add PacketBufferSize field to api.Config (default: 1000)

Reflects changes from commits:
- f362e32 feat(api): add timestamp field to LogRecord
- dfd5e49 feat(config): add configurable packet channel buffer size

Implements evolution.api_stability.rules.document_changes from architecture.yml

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-27 00:23:18 +01:00
f362e325bf feat(api): add timestamp field to LogRecord
Some checks failed
Build DEB Package / Build DEB Package (Debian/Ubuntu) (push) Has been cancelled
Build RPM Package / Build RPM Package (Rocky Linux) (push) Has been cancelled
- Add Timestamp field (int64, nanoseconds since Unix epoch) to LogRecord
- Import time package in api/types.go
- Set timestamp using time.Now().UnixNano() in NewLogRecord()
- Add test assertion to verify timestamp is set

The timestamp is now included in all JSON log outputs

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-27 00:20:40 +01:00
dfd5e49dd9 feat(config): add configurable packet channel buffer size
Some checks failed
Build DEB Package / Build DEB Package (Debian/Ubuntu) (push) Has been cancelled
Build RPM Package / Build RPM Package (Rocky Linux) (push) Has been cancelled
- Add PacketBufferSize field to api.Config struct
- Add DefaultPacketBuffer constant (1000 packets)
- Add JA4SENTINEL_PACKET_BUFFER_SIZE environment variable support
- Update mergeConfigs to handle PacketBufferSize override
- Update main.go to use configurable buffer size with fallback
- Update config.yml.example with packet_buffer_size option

Allows tuning for high-traffic environments by increasing buffer size
via config file or environment variable

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-27 00:07:45 +01:00
e4b8f5ab86 fix(cmd): close packetChan after capture goroutine finishes
- Add close(packetChan) after captureEngine.Run() completes
- Ensures packet processor goroutine exits cleanly when channel is drained
- Prevents potential goroutine leak during shutdown

Fixes potential resource leak identified in architecture audit

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-27 00:05:16 +01:00
34a1aba64d docs(api): add comprehensive Godoc comments for all interfaces
- Add detailed Godoc for Loader, Capture, Parser, Engine interfaces
- Add detailed Godoc for Writer, UnixSocketWriter, MultiWriter, Builder
- Add detailed Godoc for Logger interface
- Enhance NewLogRecord documentation with pointer/omitempty behavior
- Enhance DefaultConfig documentation with default values

Implements code_style.comments.rules.godoc_exported from architecture.yml

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-27 00:04:29 +01:00
56d8164e7f test(cmd): add unit tests for main.go
- Add TestFormatPorts covering empty, single, and multiple ports
- Add TestMain_VersionFlag_VerifiesOutput checking version variables
- Add TestFlagParsing verifying CLI flag parsing behavior
- Fix .gitignore to only ignore root-level binary, not cmd/ja4sentinel/

Implements testing.policy.requirements.test_skeletons from architecture.yml

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-27 00:01:39 +01:00
39033c5424 test(api): add unit tests for types.go helper functions
- Add TestNewLogRecord covering complete records, nil fingerprints, and zero values
- Add TestDefaultConfig verifying default configuration values
- Add TestJoinStringSlice testing edge cases (empty, nil, single, multiple elements)
- Add TestLogRecordConversion verifying TCP options formatting

Implements testing.policy.requirements.test_skeletons from architecture.yml

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-26 23:59:29 +01:00
9280cb545c 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>
2026-02-26 23:24:42 +01:00
410467f099 feat: ajouter pipeline CI complet (tests, build, packages)
Some checks failed
Build DEB Package / Build DEB Package (Debian/Ubuntu) (push) Has been cancelled
Build RPM Package / Build RPM Package (Rocky Linux) (push) Has been cancelled
- Ajout des cibles make ci, ci-test, ci-build, ci-package, ci-package-test
- Correction des chemins de sortie des packages (build/deb, build/rpm)
- Build RPM sur Rocky Linux 9 pour dépendances correctes (libpcap.so.1)
- Fix tests RPM (command -v au lieu de which, fallback libpcap)
- Tous les tests passent (11/11 DEB, 11/11 RPM)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-25 22:43:53 +01:00
84236e27f2 chore: ignorer config locale et artefacts runtime de test
Co-authored-by: aider (openrouter/openai/gpt-5.3-codex) <aider@aider.chat>
2026-02-25 21:46:11 +01:00
6cd6c4c3b8 fix: sécuriser shutdown, config par défaut et reconnexion socket
Co-authored-by: aider (openrouter/openai/gpt-5.3-codex) <aider@aider.chat>
2026-02-25 21:44:40 +01:00
617ecd2014 chore: Ignorer les artefacts de test dans packaging/test/
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-25 21:29:41 +01:00
71011a786d chore: Mise à jour du .gitignore
Ajout des entrées pour:
- Qwen (.qwen/, .qwenignore)
- Build artifacts (dist/, build/, *.so, *.dylib, *.o)
- Go (coverage.*, *.test, go.work*)
- Docker (docker-compose.override.yml)
- IDE (.idea/, .vscode/, *.swp)
- Fichiers temporaires (tmp/, temp/, *.tmp, *.bak)
- Binaires (ja4sentinel, ja4sentinel-linux-amd64)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-25 21:28:08 +01:00
c62101a08e fix: Support Debian Bookworm et Ubuntu pour le package .deb
Cible: Debian Bookworm (12) et Ubuntu 22.04+

Changes:
- packaging/Dockerfile.deb: Build via Docker avec Go 1.24
- packaging/build-deb.sh: Ajout paramètre distribution (debian/ubuntu)
- packaging/test/Dockerfile.deb: Test sur Debian Bookworm
- packaging/test/test-*.sh: Tests spécifiques Debian/Ubuntu
- .github/workflows/build-deb.yml:
  * Nom du job: 'Build DEB Package (Debian/Ubuntu)'
  * TARGET_DIST: debian:bookworm
  * Build simplifié via Docker
- Makefile: package-deb utilise Docker (cohérent avec RPM)

Compatibilité:
- Debian 11 (Bullseye)
- Debian 12 (Bookworm)
- Ubuntu 20.04 LTS
- Ubuntu 22.04 LTS
- Ubuntu 24.04 LTS

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-25 21:25:45 +01:00
6f7c5450f8 fix: Support Rocky Linux 9 pour le package RPM
Cible: Rocky Linux 9 (compatible RHEL/CentOS)

Changes:
- packaging/Dockerfile.rpm: Build pour Rocky Linux
- packaging/build-rpm.sh: Ajout paramètre distribution (rocky/rhel/centos)
- packaging/rpm/ja4sentinel.spec:
  * Condition %if 0%{?rhel} >= 8 pour compatibilité RHEL
  * Description mise à jour avec Rocky Linux
- packaging/test/Dockerfile.rpm: Test sur Rocky Linux 9
- packaging/test/test-*.sh: Tests spécifiques Rocky Linux
- .github/workflows/build-rpm.yml:
  * Nom du job: 'Build RPM Package (Rocky Linux)'
  * TARGET_DIST: rockylinux:9
  * Simplification du build via Docker

Documentation:
- README.md: Instructions d'installation pour .rpm (Rocky/RHEL) et .deb (Debian/Ubuntu)
- Remplacement des instructions de build par installation via packages

Compatibilité:
- Rocky Linux 8.x et 9.x
- RHEL 8.x et 9.x
- CentOS Stream 8 et 9
- AlmaLinux 8.x et 9.x

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-25 21:17:37 +01:00
61bf05454e feat: CI/CD pour packages .deb et .rpm + tests d'installation
Nouveaux workflows GitHub Actions:
- .github/workflows/build-deb.yml : Build et release DEB sur Ubuntu
- .github/workflows/build-rpm.yml : Build et release RPM sur Fedora
- Déclenchement sur tags v*, push main/master, workflow_dispatch
- Upload des artifacts et création automatique de release

Système de build de packages:
- packaging/build-deb.sh : Script de build .deb avec sanitization version
- packaging/build-rpm.sh : Script de build .rpm (via Docker)
- packaging/Dockerfile.deb : Container Ubuntu 22.04 pour build DEB
- packaging/Dockerfile.rpm : Container Go 1.24 + rpm pour build RPM

Fichiers de configuration systemd:
- packaging/systemd/ja4sentinel.service : Unit avec security hardening
  * NoNewPrivileges, ProtectSystem, ProtectHome
  * CAP_NET_RAW, CAP_NET_ADMIN pour packet capture
- packaging/systemd/config.yml : Configuration par défaut

Scripts mainteneur DEB:
- packaging/deb/postinst : Création user/group, dirs, config
- packaging/deb/prerm : Stop service avant upgrade/remove
- packaging/deb/postrm : Cleanup complet en purge

Spec file RPM:
- packaging/rpm/ja4sentinel.spec : Spec complet avec dependencies
  * Requires: systemd, libpcap
  * %pre/%post/%preun/%postun scripts

Tests d'installation dans containers:
- packaging/test/test-deb.sh : Build + test Docker Ubuntu
- packaging/test/test-rpm.sh : Build + test Docker Fedora
- packaging/test/test-install-deb.sh : 11 tests automatisés
- packaging/test/test-install-rpm.sh : 11 tests automatisés
- Dockerfile.deb/rpm : Containers de test dédiés

Makefile:
- package-deb : Build .deb
- package-rpm : Build .rpm via Docker (no-cache)
- package : Build les deux
- test-package-deb : Build + test installation DEB
- test-package-rpm : Build + test installation RPM
- test-package : Test les deux packages

Tests:
-  DEB: 11/11 tests passés (binaire, config, service, user, dirs)
-  RPM: Build réussi (3.3 MB)
- Version sanitization pour git tags (ex: efd4481-dirty → 0.0.0+efd4481-dirty)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-25 21:05:23 +01:00
efd4481729 feat: implémentation complète du pipeline JA4 + Docker + tests
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>
2026-02-25 20:02:52 +01:00