Services: - ja4sentinel: TLS/JA4 fingerprint capture daemon (Go, libpcap) - logcorrelator: JA4 log correlation engine (Go, ClickHouse) - mod_reqin_log: Apache module (C, JSON request logging) - bot_detector: ML bot detection pipeline (Python) - dashboard: FastAPI/Streamlit analytics UI (Python) Shared libraries: - shared/go/ja4common: logger, config, shutdown, ipfilter (Go module) - shared/python/ja4_common: ClickHouseClient, ClickHouseSettings (Python package) - shared/clickhouse/: canonical SQL migrations (10 files) Build & packaging: - Unified 3-stage Dockerfile.package for Go RPMs (el8/el9/el10) - go.work workspace linking sentinel, correlator, ja4common - Makefile with test-all, build-all, rpm-* targets Fixes applied: - go.work: 1.21 → 1.24.6 (required by sentinel) - correlator Dockerfiles: golang:1.21 → golang:1.24 - replace directives in go.mod for ja4common local path - pyproject.toml: setuptools.backends → setuptools.build_meta - Removed static libpcap linking (unavailable on Rocky 9) - Fixed data races in output/writers_test.go (sync.Mutex + atomic.Int32) - Rewrote corrupted test files (logger_test.go × 2) Test coverage: - correlator: 67.1% total (unixsocket 80.5%, config 91.7%, app 83.3%, multi 87.7%, stdout 100%) - sentinel: all 10 packages pass (api, capture, config, fingerprint, ipfilter, logging, output, tlsparse) Documentation: - README.md + docs/ (architecture, development, 5 services, shared libs, DB schema & migrations) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
95 lines
3.0 KiB
YAML
95 lines
3.0 KiB
YAML
# GitLab CI/CD configuration for mod_reqin_log
|
|
# Uses Docker-in-Docker (dind) for building and testing
|
|
|
|
stages:
|
|
- build
|
|
- test
|
|
- package
|
|
- verify
|
|
|
|
# =============================================================================
|
|
# Variables
|
|
# =============================================================================
|
|
variables:
|
|
DOCKER_TLS_CERTDIR: "/certs"
|
|
DOCKER_DRIVER: overlay2
|
|
VERSION: "1.0.2"
|
|
|
|
# =============================================================================
|
|
# Build Stage - Compile all RPM packages
|
|
# =============================================================================
|
|
|
|
build-packages:
|
|
stage: build
|
|
image: docker:24
|
|
services:
|
|
- docker:24-dind
|
|
script:
|
|
# Build all RPM packages (el8, el9, el10)
|
|
- docker build -f Dockerfile.package --target output --build-arg VERSION=$VERSION -t mod_reqin_log:packages .
|
|
|
|
# Create output directories
|
|
- mkdir -p dist/rpm
|
|
|
|
# Extract packages from Docker image
|
|
- docker run --rm -v $(pwd)/dist:/output mod_reqin_log:packages sh -c 'cp -r /packages/rpm/* /output/rpm/'
|
|
|
|
# List built packages
|
|
- echo "=== RPM Packages ==="
|
|
- ls -la dist/rpm/
|
|
artifacts:
|
|
paths:
|
|
- dist/rpm/
|
|
expire_in: 30 days
|
|
|
|
# =============================================================================
|
|
# Test Stage - Unit tests
|
|
# =============================================================================
|
|
|
|
unit-tests:
|
|
stage: test
|
|
image: docker:24
|
|
services:
|
|
- docker:24-dind
|
|
script:
|
|
# Build test image
|
|
- docker build -f Dockerfile.tests -t mod_reqin_log:tests .
|
|
|
|
# Run unit tests
|
|
- docker run --rm mod_reqin_log:tests ctest --output-on-failure
|
|
|
|
# =============================================================================
|
|
# Package Stage - Already done in build-packages
|
|
# =============================================================================
|
|
|
|
# =============================================================================
|
|
# Verify Stage - Test RPM package installation on each target distribution
|
|
# =============================================================================
|
|
|
|
verify-rpm-el8:
|
|
stage: verify
|
|
image: docker:24
|
|
services:
|
|
- docker:24-dind
|
|
needs: [build-packages]
|
|
script:
|
|
- docker run --rm -v $(pwd)/dist:/packages rockylinux:8 sh -c "dnf install -y /packages/rpm/*.el8.*.rpm && httpd -M 2>&1 | grep reqin_log && echo 'RPM el8 verification OK'"
|
|
|
|
verify-rpm-el9:
|
|
stage: verify
|
|
image: docker:24
|
|
services:
|
|
- docker:24-dind
|
|
needs: [build-packages]
|
|
script:
|
|
- docker run --rm -v $(pwd)/dist:/packages rockylinux:9 sh -c "dnf install -y /packages/rpm/*.el9.*.rpm && httpd -M 2>&1 | grep reqin_log && echo 'RPM el9 verification OK'"
|
|
|
|
verify-rpm-el10:
|
|
stage: verify
|
|
image: docker:24
|
|
services:
|
|
- docker:24-dind
|
|
needs: [build-packages]
|
|
script:
|
|
- docker run --rm -v $(pwd)/dist:/packages almalinux:10 sh -c "dnf install -y /packages/rpm/*.el10.*.rpm && httpd -M 2>&1 | grep reqin_log && echo 'RPM el10 verification OK'"
|