Skip to content

SUB-9486: move to syft v1.55.0 and drop the stereoscope v0.1.9 pin - #1061

Merged
jnathangreeg merged 2 commits into
mainfrom
SUB-9486-syft-v1.55
Nov 2, 2026
Merged

jnathangreeg merged 2 commits into
mainfrom
SUB-9486-syft-v1.55

Conversation

@jnathangreeg

@jnathangreeg jnathangreeg commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Jira: SUB-9486

go.mod / go.sum only — no source changes were needed.

Rebased onto main after #1062 (IG v0.57.0 via the kubescape fork) merged, so this is now a single commit of syft work on top of it.

What moved

  • github.com/anchore/syft v1.42.3 → v1.55.0, fork replace kubescape/syft v1.32.0-ks.2 → v1.55.0-ks.3
  • replace github.com/anchore/stereoscope => v0.1.9 — removed (syft v1.55.0 brings stereoscope v0.3.4)
  • github.com/kubescape/storage v0.0.303 → v0.0.382
  • two new containerd pins alongside the existing runtime-spec one

The inspektor-gadget replace is untouched. It is main's pin from #1062 (9864428b, IG v0.57.0). An earlier revision of this PR moved it; that was reverted, because re-pinning to the fork's main pulled in ~45 IG commits node-agent had never shipped. Moving the IG pin was #1062's job and it has done it.

Blocker 1 — ambiguous github.com/moby/moby/client — RESOLVED by #1062

stereoscope v0.3.x imports github.com/moby/moby/client, which is now its own module but still also lives inside the github.com/moby/moby monolith that inspektor-gadget required. Go reports ambiguous import and no pin can resolve it — the fix had to be in IG.

#1062 moved node-agent to IG v0.57.0, which is off the monolith, so this is handled upstream of this PR. (kubescape/inspektor-gadget#19 fixed the same collision on the older fork line; it is no longer the route taken here.)

Blocker 2 — containerd v1 / containerd/v2 diamond — still real on top of v0.57.0

This is the part IG v0.57.0 does not solve, and I re-verified it rather than assuming. Building this branch on top of #1062 without the containerd pins fails exactly as before:

containerd@v1.7.36/sandbox/bridge.go:36   *grpcBridge does not implement TTRPCSandboxService (missing UpdateSandbox)
containerd/v2@v2.4.1/pkg/oci/spec_opts.go cannot use &limit (*int64) as int64

Upstream IG v0.57.0 still requires and imports containerd v1.7.36 (runtime-spec v1.2.1, api v1.8.0), so both containerd majors remain in the graph and must agree on one containerd/api and one runtime-spec:

containerd/v2 v2.2.0  -> api v1.10.0, runtime-spec v1.2.1   <- compatible
containerd/v2 v2.2.5  -> api v1.10.0, runtime-spec v1.3.0
containerd/v2 v2.4.1  -> api v1.12.0, runtime-spec v1.3.0   <- what syft declares

syft only declares v2.4.1; it compiles against v2.2.0. Hence:

replace github.com/opencontainers/runtime-spec => v1.2.1   (kept)
replace github.com/containerd/containerd/v2    => v2.2.0   (new)
replace github.com/containerd/containerd/api   => v1.10.0  (new)

Measure this on linux. On darwin the IG and node-agent subtrees are excluded by build constraints, so containerd v1 is never compiled and any go list -deps count is misleadingly zero.

Why the storage bump belongs here

v0.0.382 is the first storage release containing kubescape/storage#471, which adds the 28 syft package metadata types new since v1.42.3 plus the snap and oci-model source types.

The source types are the load-bearing half. storage's unpackSrcMetadata has no sentinel, unlike unpackPkgMetadata: an unrecognised non-empty source type is a hard decode failure that loses the whole document, not a lossy fallback. So an SBOM whose source is a snap or an OCI model does not round-trip through an older storage. Readers before writers — node-agent should not ship on syft v1.55 against a storage that cannot decode what it may now emit.

Why ks.3 rather than ks.2

ks.3 adds 03393509, which routes the fork's binutils section pre-filters through the bounded elfutil.NewFile. Without it the golang, rust and elf-package catalogers parse attacker-supplied ELF with debug/elf directly, ahead of the bounded call — the crafted-compression-header OOM elfutil exists to stop. It also fixes the pre-filters silently skipping non-ELF (Mach-O/PE) binaries.

Verified

$ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ./...     # exit 0
$ GOOS=linux GOARCH=amd64 go vet ./pkg/sbommanager/... ./pkg/sbomscanner/...   # clean
$ GOOS=linux GOARCH=amd64 go mod tidy                      # clean

Call sites re-checked against syft v1.55.0:

  • directorysource.Config, directorysource.New and GetDirectoryExclusionFunctions are unchanged — the only upstream delta is a trailing-slash trim bugfix. The in-place rewrite of the exclusion slice still happens, so the slices.Clone guard in syftutil/directory_source.go is still required.
  • file-digest-cataloger, file-metadata-cataloger and file-executable-cataloger all still exist (internal/task/file_tasks.go), so the WithRemovals calls in host_sbom.go, sbom_manager.go and sbomscanner/v1/server.go are not silent no-ops.
  • fileresolver.NewFromDirectory keeps the upstream signature in the fork (the selective-index matcher lives on an unexported constructor), so no call site gains a parameter.

Tests were not executed — node-agent is linux-only and the build host is darwin. The pkg/sbommanager/... test binaries compile for linux/amd64 and then fail to exec locally (exec format error); they need CI or a linux box.

🤖 Generated with Claude Code

@jnathangreeg jnathangreeg added ai-assisted Created through Armosec AI tooling (armosec-shared-rules plugin) ai-reviewed-local labels Oct 29, 2026
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 10 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ea413332-53f0-4c13-bea7-b37b5ef32039
Commits

Reviewing files that changed from the base of the PR and between fc74ccc and cf7ae05.

Files ignored due to path filters: 1
  • go.sum is excluded by !**/*.sum
Files selected for processing: 1
  • go.mod

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7f748dbf-d0da-40ab-b667-fad1010354e6
Commits

Reviewing files that changed from the base of the PR and between 0ad6adb and fc74ccc.

Files ignored due to path filters: 1
  • go.sum is excluded by !**/*.sum
Files selected for processing: 1
  • go.mod

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The module requirements are updated across direct and indirect dependencies. The Syft replacement now targets the Kubescape fork, and containerd replacements are pinned. The stereoscope replacement is removed.

Changes: Module Dependency Refresh

Layer / File(s) Summary
Update direct requirements
go.mod
Direct requirements are upgraded, including Syft and SQLite.
Refresh indirect requirements
go.mod
Indirect dependency versions and membership change across multiple package groups.
Update module replacements
go.mod
The Syft replacement targets the Kubescape fork. Containerd replacements are pinned, and the stereoscope replacement is removed. Comments document the stated compatibility constraints.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related issues

Possibly related PRs

  • kubescape/node-agent#1062: This PR changes the Inspektor Gadget replacement and image versions in go.mod; the supplied context says the two dependency changes affect the resolved module graph.
  • kubescape/node-agent#1054: This PR changes the containerd v1 and Inspektor Gadget requirements that interact with the containerd pins in this change.

Suggested reviewers: matthyx

Merge Risk: Minimal · previous review fc74c

No concrete blocker is established for this dependency refresh. Mergeability remains subject to normal checks; the reported build succeeded, but tests were not executed.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies the main changes: moving to Syft v1.55.0 and removing the stereoscope v0.1.9 pin.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@github-actions

Copy link
Copy Markdown

Performance Benchmark Results

Node-Agent Resource Usage
Metric BEFORE AFTER Delta
Avg CPU (cores) 0.022 0.025 +12.1%
Peak CPU (cores) 0.025 0.028 +12.8%
Peak CPU p95 (cores) 0.024 0.028 +15.6%
Avg Memory (MiB) 263.004 276.786 +5.2%
Peak Memory (MiB) 267.633 287.871 +7.6%
Dedup Effectiveness

No data available.

@matthyx matthyx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Inspektor Gadget replacement in go.mod:511 points to a9e2040fee2f, which is not on the fork’s main branch. The check-ig-pin job fails on this exact head, and the prerequisite kubescape/inspektor-gadget#19 is still open. Please merge the prerequisite and repin to the resulting commit on main before merging this PR, then rerun the affected checks. The draft status also prevents approval at present.

@matthyx matthyx moved this to Waiting on Author in KS PRs tracking Oct 29, 2026
@matthyx matthyx added the release Create release label Oct 29, 2026

@matthyx matthyx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please bump the syft fork to v1.55.0-ks.3:

replace github.com/anchore/syft => github.com/kubescape/syft v1.55.0-ks.3

ks.2 is missing 03393509 ("fix: bound the pre-filter ELF parses with elfutil"). Without that commit, the binutils pre-filters still parse ELF files with debug/elf directly, before the bounded elfutil.NewFile. That leaves the golang, rust and elf-package catalogers open to the crafted-binary OOM. ks.3 is the branch tip feature/selective+prefilter-v1.55.0, which has that fix.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Performance Benchmark Results

Node-Agent Resource Usage
Metric BEFORE AFTER Delta
Avg CPU (cores) 0.026 0.024 -5.8%
Peak CPU (cores) 0.028 0.028 -1.0%
Peak CPU p95 (cores) 0.028 0.027 -1.9%
Avg Memory (MiB) 269.302 273.856 +1.7%
Peak Memory (MiB) 271.508 280.656 +3.4%
Dedup Effectiveness

No data available.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Performance Benchmark Results

Node-Agent Resource Usage
Metric BEFORE AFTER Delta
Avg CPU (cores) 0.025 0.095 +274.8%
Peak CPU (cores) 0.028 0.100 +258.1%
Peak CPU p95 (cores) 0.027 0.098 +257.3%
Avg Memory (MiB) 269.376 372.993 +38.5%
Peak Memory (MiB) 271.430 382.520 +40.9%
Dedup Effectiveness

No data available.

@matthyx

matthyx commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Please update the PR description. It still says the fork replace moves to v1.55.0-ks.2, but the branch now pins v1.55.0-ks.3 (afd0cc2), which has the bounded ELF pre-filter fix.

Also, this PR can't merge before kubescape/inspektor-gadget#19. The IG replace pins a commit from that unmerged branch, so check-ig-pin fails until #19 is merged and this PR is re-pinned to the merged SHA on main. #19 currently has changes requested: RequireKernelVersion in pkg/testing/utils/helpers.go now takes an internal type, which breaks existing callers. Please mention that dependency in the description too.

@matthyx

matthyx commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Please hold this PR until #1062 (inspektor-gadget v0.57.0 via the kubescape fork) lands, and revert the re-pin to 79b3b49b in c6b76fa.

Re-pinning to the fork's main brings in about 45 inspektor-gadget commits node-agent has never shipped: uprobetracer, tracercollection, kfilefields, datasource and container-hook changes. Moving the IG pin is #1062's job, not this PR's. v0.57.0 already uses the standalone github.com/moby/moby/client, so once #1062 is merged, rebase onto it and drop this PR's inspektor-gadget replace change entirely. Please also re-check whether the containerd/v2 and containerd/api pins are still needed on top of IG v0.57.0.

@jnathangreeg

Copy link
Copy Markdown
Contributor Author

Agreed on all three points — reverted in 9c77da7.

You're right that the re-pin was out of scope. The pin is back to a9e2040f (node-agent's own IG commit plus only the moby split-client fix), so container watching moves by nothing. I'd moved it to the fork's main purely because kubescape/inspektor-gadget#19 had merged and check-ig-pin was red — I didn't weigh what else main carried. check-ig-pin is expected to stay red until #1062 lands; that's now deliberate rather than outstanding.

This PR holds for #1062, then rebases onto it and drops the inspektor-gadget replace entirely.

On whether the containerd pins are still needed on top of IG v0.57.0 — yes, they are. v0.57.0 does not move off containerd v1:

$ curl -s https://proxy.golang.org/github.com/inspektor-gadget/inspektor-gadget/@v/v0.57.0.mod
    github.com/containerd/containerd v1.7.36          <- direct
    github.com/opencontainers/runtime-spec v1.2.1
    github.com/containerd/containerd/api v1.8.0       // indirect

So the diamond is unchanged, and if anything tighter than I'd assumed — v0.57.0 wants api v1.8.0 and runtime-spec v1.2.1, while syft/stereoscope declare containerd/v2 v2.4.1, which needs api v1.12.0 and runtime-spec v1.3.0. containerd/v2 v2.2.0 is still the only release that satisfies both sides (api v1.10.0 + runtime-spec v1.2.1, which v1.7.36 tolerates).

Worth noting for #1062: that PR will hit the same wall the moment stereoscope v0.3.4 enters its graph, so the containerd/v2 and containerd/api pins probably need to travel with whichever of the two lands second. Happy to re-verify on linux once #1062 is closer.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Performance Benchmark Results

Node-Agent Resource Usage
Metric BEFORE AFTER Delta
Avg CPU (cores) 0.028 0.000 -100.0%
Peak CPU (cores) 0.033 0.000 -100.0%
Peak CPU p95 (cores) 0.032 0.000 -100.0%
Avg Memory (MiB) 268.377 0.000 -100.0%
Peak Memory (MiB) 276.465 0.000 -100.0%
Dedup Effectiveness

No data available.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Performance Benchmark Results

Node-Agent Resource Usage
Metric BEFORE AFTER Delta
Avg CPU (cores) 0.021 0.023 +8.3%
Peak CPU (cores) 0.024 0.027 +14.8%
Peak CPU p95 (cores) 0.023 0.025 +9.2%
Avg Memory (MiB) 263.850 271.928 +3.1%
Peak Memory (MiB) 267.762 279.102 +4.2%
Dedup Effectiveness

No data available.

@matthyx

matthyx commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@jnathangreeg #1062 has merged

@matthyx matthyx added the needs-rebase PR has merge conflicts and needs to be rebased label Nov 2, 2026
Rebased onto main now that #1062 has merged, and this PR's inspektor-gadget
replace is dropped entirely as requested — the IG pin is #1062's, untouched
here.

What remains is the syft move: require v1.55.0, the fork replace to
kubescape/syft v1.55.0-ks.3, and dropping the stereoscope => v0.1.9 pin, which
syft v1.55.0 cannot use (it needs 0.3.x).

The containerd pins are kept, and re-verified rather than assumed. Building on
top of #1062 without them fails exactly as before:

  containerd@v1.7.36/sandbox/bridge.go:36   grpcBridge missing UpdateSandbox
  containerd/v2@v2.4.1/pkg/oci/spec_opts.go cannot use &limit (*int64) as int64

IG v0.57.0 still requires and imports containerd v1.7.36 (runtime-spec v1.2.1,
api v1.8.0), so the diamond survives the upgrade and containerd/v2 stays at
v2.2.0 with containerd/api at v1.10.0.

Verified with CGO_ENABLED=0 GOOS=linux GOARCH=amd64: builds clean.

Signed-off-by: jnathangreeg <jonathang@armosec.io>

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jnathangreeg
jnathangreeg marked this pull request as ready for review November 2, 2026 13:18
@matthyx matthyx removed the release Create release label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Performance Benchmark Results

Node-Agent Resource Usage
Metric BEFORE AFTER Delta
Avg CPU (cores) 0.030 0.032 +6.4%
Peak CPU (cores) 0.033 0.034 +3.7%
Peak CPU p95 (cores) 0.033 0.034 +4.6%
Avg Memory (MiB) 275.607 208.291 -24.4%
Peak Memory (MiB) 279.254 213.086 -23.7%
Dedup Effectiveness

No data available.

@matthyx

matthyx commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@jnathangreeg thanks for the rebase. The replace set looks right now. Two things before I approve:

  1. Description is out of date. It still says the IG pin is 79b3b49b (trigger workflow #19), and that the fork build deliberately keeps node-agent's current IG commit with only the moby fix. Since the rebase, this PR sits on main's IG v0.57.0 pin (9864428b, from build(deps): upgrade Inspektor Gadget to v0.57.0 via kubescape fork #1062). Please update the "What moved" list, and mark Blocker 1 as resolved by build(deps): upgrade Inspektor Gadget to v0.57.0 via kubescape fork #1062 rather than trigger workflow #19.
  2. Storage bump. kubescape/storage is still at v0.0.303. v0.0.382 includes SUB-9486: bump anchore/syft to v1.55.0 and sync package metadata types storage#471, which adds the 28 new syft package metadata types and the snap / oci-model source types. Without it, SBOMs using those types won't round-trip through storage. Please bump it here so the node-agent release carries it.

v0.0.382 is the first storage release containing kubescape/storage#471, which
adds the 28 syft package metadata types new since v1.42.3 and the "snap" and
"oci-model" source types.

The source types are the load-bearing half. storage's unpackSrcMetadata has no
sentinel, unlike unpackPkgMetadata: an unrecognised non-empty source type is a
hard decode failure that loses the whole document, not a lossy fallback. So an
SBOM whose source is a snap or an OCI model does not round-trip through a
storage older than this. Readers before writers -- node-agent must not ship on
syft v1.55 against a storage that cannot decode what it may now emit.

Verified with CGO_ENABLED=0 GOOS=linux GOARCH=amd64: builds clean.

Signed-off-by: jnathangreeg <jonathang@armosec.io>

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jnathangreeg

Copy link
Copy Markdown
Contributor Author

Both done.

1. Description rewritten. It described the pre-rebase state throughout, not just the pin. "What moved" now lists the IG replace as untouched — it is main's 9864428b from #1062 — and records that the earlier re-pin was reverted because it dragged in ~45 IG commits node-agent had never shipped. Blocker 1 is marked resolved by #1062, with #19 noted only as the fix for the same collision on the older fork line.

Blocker 2 I rewrote rather than just re-labelled, because it is the part v0.57.0 does not solve and I had only asserted that before. Building this branch on top of #1062 without the containerd pins reproduces both errors verbatim:

containerd@v1.7.36/sandbox/bridge.go:36   *grpcBridge does not implement TTRPCSandboxService (missing UpdateSandbox)
containerd/v2@v2.4.1/pkg/oci/spec_opts.go cannot use &limit (*int64) as int64

v0.57.0 still requires and imports containerd v1.7.36 (runtime-spec v1.2.1, api v1.8.0), so the diamond survives the upgrade and the three pins stay.

2. Storage bumped to v0.0.382 in cf7ae05d. Verified it contains #471 (merge commit 3dece5a6 is an ancestor of the tag) rather than trusting the version number.

You are right that this belongs here, and the source types are the sharp end: unpackSrcMetadata has no sentinel, unlike unpackPkgMetadata, so an unrecognised non-empty source type is a hard decode failure that loses the whole document rather than degrading to raw JSON. A snap or oci-model source simply would not round-trip. Readers before writers.

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ./... clean after both changes; vet clean. Tests still unexecuted locally — linux-only binaries on a darwin host, so they need CI.

@matthyx matthyx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, both points are addressed. Storage is now on v0.0.382, and the description matches the rebased state. The replace set is right: IG stays on main's 9864428b, syft is on v1.55.0-ks.3, and the containerd/v2 v2.2.0, containerd/api v1.10.0 and runtime-spec v1.2.1 pins hold the containerd diamond together. I reproduced that build failure and the fix locally on main. The syft-related tests in sbommanager and sbomscanner pass.

@matthyx matthyx removed the needs-rebase PR has merge conflicts and needs to be rebased label Nov 2, 2026
@jnathangreeg
jnathangreeg merged commit 22f8642 into main Nov 2, 2026
40 checks passed
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

Performance Benchmark Results

Node-Agent Resource Usage
Metric BEFORE AFTER Delta
Avg CPU (cores) 0.110 0.028 -74.3%
Peak CPU (cores) 0.123 0.034 -72.5%
Peak CPU p95 (cores) 0.122 0.032 -74.0%
Avg Memory (MiB) 363.111 214.625 -40.9%
Peak Memory (MiB) 373.035 222.195 -40.4%
Dedup Effectiveness

No data available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Created through Armosec AI tooling (armosec-shared-rules plugin) ai-reviewed-local

Projects

Status: To Archive

Development

Successfully merging this pull request may close these issues.

2 participants