ecosystems

package
v3.59.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package ecosystems resolves the on-disk locations where a project's dependencies are installed/cached, per programming-language / package-manager ecosystem. The malscan-engine is content-agnostic — it scans a directory tree it is handed — so the CLI is responsible for pointing it at the right places: the project-local install dirs (node_modules, .venv/site-packages, vendor, …) and, when asked, the user-scoped/home caches shared across all projects (~/.npm, ~/go/pkg/mod, ~/.cargo/registry, ~/.m2, …).

The table below is the single source of truth. Each entry maps an ecosystem to its malscan-engine slug (used to select the right STIX IOC feed) and the dirs to scan. Resolve returns only the targets that actually exist on disk so the engine never walks phantom paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScanSkipDirs

func ScanSkipDirs() []string

ScanSkipDirs is the directory-prune set the malscan engine should use for a dependency-tree scan. Unlike the engine's default (which prunes node_modules and vendor — the very dirs we are scanning), this prunes only version-control metadata, so nested package dirs inside node_modules/vendor ARE walked.

Types

type Target

type Target struct {
	Ecosystem  string // human ecosystem label, e.g. "javascript", "python"
	EngineSlug string // malscan-engine feed slug: npm|pypi|go|cargo|rubygems|nuget|homebrew|generic
	Path       string // absolute path that exists on disk
	UserScoped bool   // true when sourced from a home/user cache (gated by --include-home)
	Label      string // short human label for output, e.g. "node_modules" or "~/.cargo/registry"
}

Target is one resolved scan location handed to the malscan engine.

func Resolve

func Resolve(root string, includeHome bool) []Target

Resolve returns every dependency install/cache location that exists for the given scan root. Project-local dirs are always considered; user-scoped/home caches are added only when includeHome is true. Results are de-duplicated by absolute path (first ecosystem to claim a path wins), so a shared "vendor" directory is never scanned twice.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL