Repository navigation
feat: inventory language runtimes on all platforms and Windows system packages - #261
Draft
swarit-stepsecurity wants to merge 7 commits into
Draft
swarit-stepsecurity wants to merge 7 commits into
swarit-stepsecurity wants to merge 7 commits into
Conversation
… packages Add a runtime inventory (node, python, php, java, go, ruby, deno, bun, dotnet) that finds installs on disk regardless of installer, and collect Windows system packages from the Uninstall registry keys, Chocolatey, Scoop and winget portable packages.
Report truncated_roots when only per-root budgets ran out, so the backend can replace installs outside those roots instead of merging everything. Give /Applications and Program Files a larger budget and walk only pnpm's nodejs dir, not its package store.
From a Fedora end-to-end run: - skip version-manager launchers (links to a non-runtime binary, scripts, scoop .shim) and conda's pkgs cache - accept versioned distro binary names (node-22, ruby-mri) - read distro runtime versions from rpm/dpkg (version_source "pkg") and versioned executable names - read ruby's version from MAJOR/MINOR/TEENY when RUBY_PROGRAM_VERSION is a template - attribute ~/.volta, ~/sdk/go*, ~/.dotnet; mark runtimes inside another snap as bundled by it
- scoop: read scoop-manifest.json / scoop-install.json (Scoop 0.6) with the old names as fallback - choco: vendor from nuspec authors, maintainer from owners; install time from the package dir, not the packaged nuspec - runtimes: skip version-manager shim directories (volta, scoop shims, chocolatey bin, pyenv/rbenv/asdf/mise shims) and the stdlib venv launcher templates; bundled detection covers Electron resources/app and Eclipse's justj JRE; walk winget portable packages deeper
When no version file exists (single-binary installs, VS Code Server's node), stream the executable for the runtime's own version string (nodejs.org release URL, Deno/x.y.z, Bun/x.y.z) and report it with version_source "binary". The binary is read, never executed; the scan is capped at 256 MiB and the highest match wins.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A customer asked for Windows coverage on System Packages after a Node.js fire drill. Qualys finds node by running
node -von PATH and misses everything else: nvm, fnm, Volta, Scoop, zips, and copies bundled inside other apps. Today the Windows tab is greyed out, and none of the three platforms has a way to answer "where is every install of runtime X".This PR adds two collectors (phase 1 of 3; agent-api and console follow).
Runtime inventory (macOS, Linux, Windows): new phase
runtime_scan, new payload fieldruntime_scan.node_version.h,patchlevel.h, Javarelease, GoVERSION,rbconfig.rb,php_version.h)unknownbundled_by(Xcode, Visual Studio, JetBrains jbr, VS Code Server/extensions, Adobe, …).truncated.node_modules, VCS dirs, the Go module cache and virtualenvs (the python scan covers venvs). It never follows symlinks or junctions, and resolved binaries are deduped by real path.--disable-runtime-scan/enable_runtime_scanturns it off.Windows system packages: sent in the existing
system_package_scanswith newscan_typesarp,choco,scoopandwinget.wingetnorWin32_Productis invoked.SystemPackagegainsscope(machine/user).Backend note: agent-api has no platform discriminator on system packages yet, so until phase 2 lands, Windows rows would show up under the Linux tab. Merge this after (or together with) the agent-api change.
Testing:
reg querytwin tests for ARP filtering, plus Chocolatey, Scoop and winget parsing.--jsonrun on macOS found 21 installs in about 1.8 s. That run caught three bugs, each now covered by a test:#defineparsing ateNODE_MAJOR_VERSIONafter an include guard, thePython.framework/.../Pythondylib matched as an interpreter, and the walk was depth-first so the budget starved later subtrees.