Repository navigation
fix(kamaji): close Go stdlib and module CVEs in the shipped binary - #3033
Conversation
The shipped kamaji binary was compiled with go1.26.3, which trivy flags for the standard-library CVEs fixed in go1.26.4: crypto/x509 CVE-2026-27145, mime CVE-2026-42504, and net/textproto CVE-2026-42507. The image base is distroless/static, so the remaining OS-package CVEs from the scan do not apply to it. Advance the build source from 26.3.5-edge to 26.3.6-edge, the next patch on the same edge line (identical k8s.io/api v0.35.0 and controller-runtime v0.22.4, staying clear of the k8s 1.36 line that regresses tenant control-plane RBAC). The version change busts the build-layer cache so the release rebuild compiles against the current golang:1.26 toolchain, which resolves to 1.26.4 and closes the stdlib CVEs. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdates the Kamaji image build to use ChangesKamaji image build update
Sequence Diagram(s)Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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]>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses multiple security vulnerabilities identified in the Kamaji manager binary. By updating the build source version and explicitly overriding specific Go module dependencies, the changes ensure that the resulting container image is free of known exploitable advisories that were previously present in the pinned dependencies. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the Kamaji image version to 26.3.6-edge and overlays patched Go modules (golang.org/x/net, golang.org/x/crypto, and go.opentelemetry.io/otel/sdk) in the Dockerfile to address security vulnerabilities. The reviewer noted that the pull request description is missing the required release-note block as specified in the repository style guide, and reminded the author to ensure commits follow the Conventional Commits format and include a Signed-off-by: trailer.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| FROM golang:1.26 AS builder | ||
|
|
||
| ARG VERSION=26.3.5-edge | ||
| ARG VERSION=26.3.6-edge |
There was a problem hiding this comment.
The pull request description is missing the required release-note block. According to the Repository Style Guide (lines 51-59), the PR body must contain a release note block in the following format:\n\ntext\nrelease-note\ntype(scope): human-readable changelog entry\n\n\n\nPlease update the PR description to include this block. Also, please ensure that all commits follow the Conventional Commits format and have a Signed-off-by: trailer.
References
- PR body must contain a release note block and commits must follow Conventional Commits format and have a Signed-off-by: trailer. (link)
VerdictLGTM with non-blocking notes. Minimal, well-scoped image-rebuild patch: source bump Findings[NIT] Claim mismatches
Caveats
Red-team concerns
Recommended follow-ups
|
IvanHunters
left a comment
There was a problem hiding this comment.
LGTM with non-blocking notes — full review in PR comment above.
What
Rebuild the kamaji image and force the fixed versions of three Go modules whose advisories are compiled into the manager binary. Two build changes:
26.3.5-edgeto26.3.6-edge, recompiling on the currentgolang:1.26toolchain (1.26.4) to close the Go stdlib advisories.go build, rungo get golang.org/x/[email protected] golang.org/x/[email protected] go.opentelemetry.io/otel/[email protected] && go mod tidyto pull the patched module versions into the build.Why
The pinned image is flagged for a set of CVEs that fall into three groups:
gcr.io/distroless/static:nonroot, which ships no OS packages, so these do not apply to the image — false positives.stdlibfinding: the binary was compiled with a go1.26 patch older than 1.26.4. The26.3.6-edgerebuild on the current toolchain closes it (crypto/x509 CVE-2026-27145, mime CVE-2026-42504, net/textproto CVE-2026-42507).26.3.6-edgepinsgolang.org/x/net v0.51.0,golang.org/x/crypto v0.49.0andgo.opentelemetry.io/otel/sdk v1.41.0, all carrying published advisories:golang.org/x/net< 0.55.0: CVE-2026-42506, CVE-2026-42502, CVE-2026-39821, CVE-2026-25680, CVE-2026-25681, CVE-2026-27136 (plus CVE-2026-33814, fixed at 0.53.0). Target 0.55.0.golang.org/x/crypto< 0.52.0: 13 advisories ingolang.org/x/crypto/ssh(e.g. CVE-2026-39827, CVE-2026-46595, CVE-2026-46598). Target 0.52.0.go.opentelemetry.io/otel/sdk< 1.43.0: CVE-2026-39883 (GHSA-hfvc-g4fc-pqhx), a PATH-hijack on BSD/Solaris only; the affected code path does not run on the Linux distroless target, but the bump clears the finding at no runtime cost. Target 1.43.0.A source-version bump cannot close the module advisories: no kamaji edge tag up to
26.6.4-edgeships the fixed module versions (it still pins x/net 0.53.0, x/crypto 0.51.0, otel/sdk 1.41.0), and the tags that advance the k8s line to 1.36 regress tenant control-plane RBAC. Forcing the modules during the build is the minimal correct lever, and the overlay already triggers a fresh compile, so it subsumes the stdlib rebuild.Verification
Built the image source end to end: extracted
26.3.6-edge, applied the patch, ran the overlay (go get+go mod tidy, clean), and compiled withCGO_ENABLED=0 go build -a -o kamaji main.go. The build succeeds andgo version -mon the binary embedsgolang.org/x/net v0.55.0,golang.org/x/crypto v0.52.0and thego.opentelemetry.io/otelset at v1.43.0. The source has novendor/directory, sogo get+go mod tidyis sufficient. Advisory IDs and fixed boundaries verified against the OSV database.After this change the shipped binary carries no Go advisory with an available fix; the only residual scanner entries are in
k8s.io/kuberneteswith no upstream fix, which no version bump can close.Closes #2885
Summary by CodeRabbit