- Use two separate //go:generate directives (Ja4Tc for tc_capture.c, Ja4Ssl
for uprobe_ssl.c) to avoid duplicate LICENSE symbol and multi-file clang issue
- Update loader.go to hold tcObjs/sslObjs separately with correct field names:
UprobeSslSetFd, UprobeSslReadEntry, UretprobeSslReadExit,
KprobeAccept4Entry, KretprobeAccept4Exit
- Add systemd-rpm-macros to all three RPM build stages (el8/el9/el10)
so that %{_unitdir} macro resolves correctly
- RPMs now build successfully for el8, el9, el10
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
38 lines
1.3 KiB
Docker
38 lines
1.3 KiB
Docker
FROM golang:1.24-alpine AS builder
|
|
|
|
RUN apk add --no-cache git make libpcap-dev gcc musl-dev linux-headers
|
|
|
|
WORKDIR /build
|
|
|
|
# Copy workspace and shared module first (better caching)
|
|
COPY go.work go.work.sum* ./
|
|
COPY shared/go/ja4common/ ./shared/go/ja4common/
|
|
COPY services/sentinel/go.mod services/sentinel/go.sum* ./services/sentinel/
|
|
COPY services/correlator/go.mod services/correlator/go.sum* ./services/correlator/
|
|
|
|
WORKDIR /build/services/sentinel
|
|
RUN go mod download || true
|
|
|
|
COPY services/sentinel/ /build/services/sentinel/
|
|
|
|
ARG VERSION=dev
|
|
ARG BUILD_TIME=unknown
|
|
ARG GIT_COMMIT=unknown
|
|
|
|
RUN mkdir -p dist && \
|
|
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 \
|
|
CGO_LDFLAGS="-Wl,-Bstatic -lpcap -Wl,-Bdynamic" \
|
|
go build -buildvcs=false \
|
|
-ldflags "-X main.Version=${VERSION} -X main.BuildTime=${BUILD_TIME} -X main.GitCommit=${GIT_COMMIT}" \
|
|
-o dist/sentinel ./cmd/ja4sentinel
|
|
|
|
FROM alpine:latest
|
|
RUN apk add --no-cache ca-certificates
|
|
RUN addgroup -S sentinel && adduser -S sentinel -G sentinel
|
|
RUN mkdir -p /var/lib/sentinel /var/run /etc/sentinel /var/log/sentinel
|
|
COPY --from=builder /build/services/sentinel/dist/sentinel /usr/local/bin/sentinel
|
|
RUN chown -R sentinel:sentinel /var/lib/sentinel /var/log/sentinel
|
|
USER sentinel
|
|
WORKDIR /var/lib/sentinel
|
|
ENTRYPOINT ["/usr/local/bin/sentinel"]
|