Skip to content

Commit 13ca721

Browse files
committed
fix(kamaji): overlay patched x/net, x/crypto and otel/sdk modules
The kamaji source up to the 26.6.4-edge tag pins Go modules that carry known advisories compiled into the manager binary: golang.org/x/net below 0.55.0, golang.org/x/crypto below 0.52.0 and go.opentelemetry.io/otel/sdk below 1.43.0. Unlike the distroless OS-package findings, these advisories ship inside the Go binary and are reported against the deployed image. Force the fixed module versions during the build, after applying the source patches and before compiling, so the binary embeds them. No edge tag ships the fixes, and the tags that advance these modules also bring the k8s 1.36 kubeadm change that regresses tenant control-plane RBAC, so a source version bump is not a viable alternative. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 7e4af79 commit 13ca721

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎packages/system/kamaji/images/kamaji/Dockerfile‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ RUN curl -sSL https://github.com/clastix/kamaji/archive/refs/tags/${VERSION}.tar
1212
COPY patches /patches
1313
RUN git apply /patches/*.diff
1414

15+
# Overlay patched Go modules. The kamaji edge tags up to 26.6.4 still pin
16+
# vulnerable golang.org/x/net (< 0.55.0), golang.org/x/crypto (< 0.52.0) and
17+
# go.opentelemetry.io/otel/sdk (< 1.43.0). These advisories ship inside the
18+
# compiled binary, so force the fixed versions before building.
19+
RUN go get golang.org/x/[email protected] golang.org/x/[email protected] go.opentelemetry.io/otel/[email protected] && \
20+
go mod tidy
21+
1522
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=0 go build \
1623
-ldflags "-X github.com/clastix/kamaji/internal.GitRepo=$GIT_REPO -X github.com/clastix/kamaji/internal.GitTag=$GIT_LAST_TAG -X github.com/clastix/kamaji/internal.GitCommit=$GIT_HEAD_COMMIT -X github.com/clastix/kamaji/internal.GitDirty=$GIT_MODIFIED -X github.com/clastix/kamaji/internal.BuildTime=$BUILD_DATE" \
1724
-a -o kamaji main.go

0 commit comments

Comments
 (0)