Upgrade Inspektor Gadget to v0.57.0 via kubescape fork and preserve exec/path semantics
Maintainer thường phản hồi trong vòng 1 ngày
@ANAMASGARD đang làm issue này rồi.
Từ ngày 27/10/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Overview
Upgrade Inspektor Gadget to the latest release, v0.57.0 as of 2026-10-26, through our kubescape/inspektor-gadget fork. Keep the fork replacement and pin a merged fork commit after integrating upstream; do not bypass the fork by switching directly to the upstream Go module.
Current node-agent main (1051d7b7) separately pins the runtime to fork commit 06b0d12baca0 in go.mod and the bundled upstream gadgets to v0.48.1 in Makefile. Updating only the Go dependency will not upgrade trace_exec bytecode.
Problem and verified improvement
The old exec gadget can lose the pathname and arguments when syscall-entry user-memory reads fault, even though exec itself succeeds. This creates false positives for rules interpreting missing arguments as a bare shell, and prevents command-based rules from seeing the command.
Upstream fixed successful-exec capture in PR #5600, first released in v0.54.0: arguments are read from the new process's mm->arg_start/arg_end at sched_process_exec.
An A/B test on an isolated Ubuntu 24.04 amd64 host, kernel 6.8.0-142-generic, glibc 2.39 and musl 1.2.4, produced:
| Workload | v0.48.1 | v0.57.0 |
|---|---|---|
Ordinary glibc system(":") |
30/30 args:null |
30/30 complete |
Ordinary musl wordexp("$(printf :)") |
30/30 args:null |
30/30 complete |
| Controlled cold pathname / argument / argv-vector pages, both libcs | 240/240 incomplete | 240/240 complete |
The cold-page cases retained valid file mappings and dropped present PTEs with MADV_DONTNEED; an actually unmapped pathname was a separate negative control and correctly failed exec with EFAULT. Warm, popen, and invalid-pointer controls were also included. All four runs passed: 1,080 attempts, including 480 successful v0.57.0 execs with complete expected argv.
This used the production ExecTracer and existing node-agent argument decoder in a harness, with runtime fork commit 056ddc9e059f held fixed and only the exec gadget swapped. It was not a full daemon/rules/application replay or full SDK-upgrade test. Published v0.57.0 image digest: sha256:9182278eb6a11b6e2d59a748674b646a8512b715d3563ec3afdf340a2f55d435. The current upstream main and v0.57.0 have identical exec BPF source.
Compatibility caveats
Confirmed behavior and repository contracts
-
args[0]becomes actualargv[0], rather than the requested pathname. For glibcsystem, the new event is["sh", "-c", "--", ":"], while the legacy contract puts"/bin/sh"first.GetExecPathFromEventcurrently treatsargs[0]as the executable path. Audit CEL/rules, alert adapters, profiles and process-tree command lines. Preserve the outward contract or explicitly migrate its consumers; keep requested pathname, resolved executable path and argv distinct. Include custom/spoofedargv[0], symlinks and relative paths in tests. -
Scripts and capture limits change too. Successful script execs now expose committed interpreter/script argv, rather than just the original exec-call arguments. Successful capture is bounded by a 5,120-byte block, replacing the old per-argument/count limits;
args_countis set to a byte-count upper bound on this path. Test shebangs, long individual arguments, many/empty arguments, truncation,execveat, failed execs and non-leader-thread execs. These are described in #5600; post-exec recovery does not recover failed execs. -
Event schemas and derived fields need updating. Newer exec gadgets add TTY device-number and inode-time fields.
TestExecFieldsrejects unexpected fields, so update the expectations and validate consumers against the rebuilt bundle. Verify/dev/pts/0detection usingtty_major/tty_minor; this upgrade also addresses the gadget-version prerequisite in #975. Keep missing/partial capture distinct from a genuinely argument-less shell. -
Preserve fork changes and the vendored
trace_openpatch. Forward-integrate upstream into the active fork without losing its uprobe reattach/cache/streaming, non-Kubernetes namespace filtering, overlayfs inode, bounded-buffer/startup-budget, and mapped-library discovery/retry/lifecycle fixes (merged fork PRs). The vendored open gadget is built locally under the upstream image name and a pinned builder digest; replacing it with an upstream pull would drop the local path-resolution behavior.
Integration checks still required
-
Coordinate runtime, images and build tooling. Update the fork Go pin, hardcoded tracer image references, Makefile versions, CLI/builder pins and CI, and rebuild the complete
tracers.tarand custom gadgets. Upstream changed gadget build internals (#5469) and releases OCI/spec/object resources earlier (#5462, #5461, #5466); audit fork/custom-operator assumptions and load/unload behavior. The gadget-only A/B run does not prove SDK compatibility. -
Audit the Go/API and image-verification upgrades. Reconcile v0.57.0's module graph and replacements, including Docker client migration (#5414); dependency-module
replacedirectives do not propagate to the consuming module. Check newer WASM layer handling, cosign v3 bundle signatures (#5308) and SBOM OCI referrers (#5495) with our actual fork-built, bundled/offline and mirrored image paths. The old runtime skipped the newer WASM layer in the smoke test and used node-agent's own exec operator; that is not validation of the full new operator/signature stack. -
Check discovery assumptions if adopting the corresponding upstream paths. Automatic runtime-socket discovery now uses direct kubelet
/configzandnodes/configzRBAC (#5343); verify applicability, connectivity and fallback. Upstream's reduced-capability mode cannot use fanotify withoutCAP_SYS_ADMIN(#5637); an upgrade alone is not evidence that node-agent can drop capabilities while still discovering new containers.
Acceptance criteria
- Integrate the chosen upstream release into
kubescape/inspektor-gadget, preserve fork fixes, and pin node-agent to a merged fork commit; passscripts/check-inspektor-gadget-pin.sh. - Update runtime/image/builder/CLI pins together; retain the patched open gadget and rebuild all bundled/custom gadgets.
- Resolve and test executable-path versus argv compatibility across rule, alert, profile and process-tree consumers.
- Add regression coverage for the libc/cold-page cases and exec edge cases above; verify the TTY case in #975 and updated field schemas.
- Run build/unit/component checks and full-agent validation on supported kernels and native amd64/arm64, including verifier loading, discovery, restart/reattach, and bundled-image verification. Preserve explicit behavior for unavailable/truncated arguments.
Alternatives and related work
A narrow backport of upstream PR #5600 into the fork is a possible interim fix, but it has the same exec-semantics caveats and would not replace the broader upgrade. Related: #975 (hasTty on /dev/pts/0) and #429 (image-based gadget integration).
- Ngôn ngữ chính
- Go
- Star
- 39
- Fork
- 42
- Merge trung bình
- 1 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 40
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của kubescape/node-agent
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
kubescape/node-agent#1099 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
kubescape/node-agent#1093 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
refactor: consider migrating from hashicorp/golang-lru/v2/expirable to jellydator/ttlcache/v3Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
kubescape/node-agent#1014 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Scan container images for misplaced secretsCó thể làm lại được @khuswant18 đã nhận 48 ngày trước và không có pull request nào đang mở. Đang mở
kubescape/node-agent#987 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
kubescape/node-agent#963 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của kubescape/node-agent
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
evener-transcript-v2-upgrade tool still scans transcript files through bufio's 4 KiB default bufferĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
prime-radiant-inc/evener#6370 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ManageSieve proxy: a backend's NO/BYE greeting is skipped as a capability line and reported as EOFĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Mend: dependency security vulnerability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Mend: dependency security vulnerability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
ManageIQ/manageiq-pods#1476 ·
Maintainer thường phản hồi trong vòng 1 ngày