Files
ja4-platform/services/ja4ebpf/Makefile
Jacquin Antoine 382683710a feat(ebpf): add nginx HTTP capture infrastructure via kretprobe recvfrom
Add supporting infrastructure for nginx HTTP capture using kretprobe
on __x64_sys_recvfrom to replace the blocked tracepoint sys_exit_recvfrom.

Changes:
- bpf/bpf_types.h: Add nginx_pid_map for filtering recvfrom by PID
- cmd/ja4ebpf/main.go: Add Uprobes configuration section
- Makefile: Add test targets for recvfrom validation
- internal/loader: Generate nginx HTTP event structures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-20 13:30:41 +02:00

44 lines
1.4 KiB
Makefile

# =============================================================================
# Makefile — Cibles de build, test et packaging pour ja4ebpf
# =============================================================================
BINARY := ja4ebpf
IMAGE := ja4ebpf
VERSION ?= 0.1.0
.PHONY: generate build test docker-build help
## generate: Compile les sources eBPF C → Go via bpf2go (dans Docker)
generate:
docker build --target go-builder \
--build-arg SKIP_BINARY=true \
-f Dockerfile \
-t $(IMAGE)-generated:$(VERSION) \
../../
## build: Construit l'image Docker de production complète
build: ## Construit l'image Docker finale
docker build -t $(IMAGE):$(VERSION) -f Dockerfile ../../
## test: Exécute les tests unitaires Go dans Docker
test:
docker build -f Dockerfile.tests -t $(IMAGE)-tests:$(VERSION) ../../ && \
docker run --rm $(IMAGE)-tests:$(VERSION)
## docker-build: Alias combiné generate + build
docker-build: build
## test-recvfrom-vm: Teste les alternatives recvfrom sur VM Rocky 9
test-recvfrom-vm:
@bash scripts/test-vm-recvfrom.sh rocky9
## test-recvfrom-docker: Teste les alternatives recvfrom dans Docker
test-recvfrom-docker:
@docker build -f Dockerfile.test-recvfrom -t ja4-recvfrom-test ../../
@docker run --rm --privileged ja4-recvfrom-test
## help: Affiche cette aide
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'