cataloger

package
v0.98.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Overview

Package cataloger provides the ability to process files from a container image or file system and discover packages (gems, wheels, jars, rpms, debs, etc). Specifically, this package contains both a catalog function to utilize all catalogers defined in child packages as well as the interface definition to implement a cataloger.

Index

Constants

View Source
const AllCatalogersPattern = "all"

Variables

This section is empty.

Functions

func AllCatalogers

func AllCatalogers(cfg Config) []pkg.Cataloger

AllCatalogers returns all implemented catalogers

func Catalog

func Catalog(resolver file.Resolver, _ *linux.Release, parallelism int, catalogers ...pkg.Cataloger) (*pkg.Collection, []artifact.Relationship, error)

Catalog a given source (container image or filesystem) with the given catalogers, returning all discovered packages. In order to efficiently retrieve contents from a underlying container image the content fetch requests are done in bulk. Specifically, all files of interest are collected from each catalogers and accumulated into a single request.

func DirectoryCatalogers

func DirectoryCatalogers(cfg Config) []pkg.Cataloger

DirectoryCatalogers returns a slice of locally implemented catalogers that are fit for detecting packages from index files (and select installations)

func ExcludeBinaryByFileOwnershipOverlap

func ExcludeBinaryByFileOwnershipOverlap(r artifact.Relationship, c *pkg.Collection) bool

ExcludeBinaryByFileOwnershipOverlap will remove packages from a collection given the following properties are true 1) the relationship between packages is OwnershipByFileOverlap 2) the parent is an "os" package 3) the child is a synthetic package generated by the binary cataloger 4) the package names are identical This was implemented as a way to help resolve: https://github.com/gsoc2/syft/issues/931

func ImageCatalogers

func ImageCatalogers(cfg Config) []pkg.Cataloger

ImageCatalogers returns a slice of locally implemented catalogers that are fit for detecting installations of packages.

func RequestedAllCatalogers

func RequestedAllCatalogers(cfg Config) bool

Types

type Config

type Config struct {
	Search                          SearchConfig
	Golang                          golang.CatalogerConfig
	LinuxKernel                     kernel.LinuxKernelCatalogerConfig
	Python                          python.CatalogerConfig
	Java                            java.ArchiveCatalogerConfig
	Catalogers                      []string
	Parallelism                     int
	ExcludeBinaryOverlapByOwnership bool
}

TODO: these field naming vs helper function naming schemes are inconsistent.

func DefaultConfig

func DefaultConfig() Config

func (Config) JavaConfig

func (c Config) JavaConfig() java.ArchiveCatalogerConfig

JavaConfig merges relevant config values from Config to return a java.Config struct. Values like IncludeUnindexedArchives and IncludeIndexedArchives are used across catalogers and are not specific to Java requiring this merge.

type Monitor

type Monitor struct {
	FilesProcessed     progress.Monitorable // the number of files selected and contents analyzed from all registered catalogers
	PackagesDiscovered progress.Monitorable // the number of packages discovered from all registered catalogers
}

Monitor provides progress-related data for observing the progress of a Catalog() call (published on the event bus).

type SearchConfig

type SearchConfig struct {
	IncludeIndexedArchives   bool
	IncludeUnindexedArchives bool
	Scope                    source.Scope
}

func DefaultSearchConfig

func DefaultSearchConfig() SearchConfig

Directories

Path Synopsis
Package alpine provides a concrete Cataloger implementations for packages relating to the Alpine linux distribution.
Package alpine provides a concrete Cataloger implementations for packages relating to the Alpine linux distribution.
Package arch provides a concrete Cataloger implementations for packages relating to the Arch linux distribution.
Package arch provides a concrete Cataloger implementations for packages relating to the Arch linux distribution.
Package binary provides a concrete Cataloger implementations for surfacing possible packages based on signatures found within binary files.
Package binary provides a concrete Cataloger implementations for surfacing possible packages based on signatures found within binary files.
common
cpe
cpe/dictionary/index-generator
This program downloads the latest CPE dictionary from NIST and processes it into a JSON file that can be embedded into Syft for more accurate CPE results.
This program downloads the latest CPE dictionary from NIST and processes it into a JSON file that can be embedded into Syft for more accurate CPE results.
Package cpp provides a concrete Cataloger implementations for the C/C++ language ecosystem.
Package cpp provides a concrete Cataloger implementations for the C/C++ language ecosystem.
Package dart provides a concrete Cataloger implementations for the Dart language ecosystem.
Package dart provides a concrete Cataloger implementations for the Dart language ecosystem.
Package debian provides a concrete Cataloger implementation relating to packages within the Debian linux distribution.
Package debian provides a concrete Cataloger implementation relating to packages within the Debian linux distribution.
Package dotnet provides a concrete Cataloger implementation relating to packages within the C#/.NET language/runtime ecosystem.
Package dotnet provides a concrete Cataloger implementation relating to packages within the C#/.NET language/runtime ecosystem.
Package elixir provides a concrete Cataloger implementation relating to packages within the Elixir language ecosystem.
Package elixir provides a concrete Cataloger implementation relating to packages within the Elixir language ecosystem.
Package erlang provides a concrete Cataloger implementation relating to packages within the Erlang language ecosystem.
Package erlang provides a concrete Cataloger implementation relating to packages within the Erlang language ecosystem.
Package gentoo provides a concrete Cataloger implementation related to packages within the Gentoo linux ecosystem.
Package gentoo provides a concrete Cataloger implementation related to packages within the Gentoo linux ecosystem.
Package githubactions provides a concrete Cataloger implementation for GitHub Actions packages (both actions and workflows).
Package githubactions provides a concrete Cataloger implementation for GitHub Actions packages (both actions and workflows).
Package golang provides a concrete Cataloger implementation relating to packages within the Go language ecosystem.
Package golang provides a concrete Cataloger implementation relating to packages within the Go language ecosystem.
Package haskell provides a concrete Cataloger implementation relating to packages within the Haskell language ecosystem.
Package haskell provides a concrete Cataloger implementation relating to packages within the Haskell language ecosystem.
internal
Package java provides a concrete Cataloger implementation for packages relating to the Java language ecosystem.
Package java provides a concrete Cataloger implementation for packages relating to the Java language ecosystem.
Package javascript provides a concrete Cataloger implementation for packages relating to the JavaScript language ecosystem.
Package javascript provides a concrete Cataloger implementation for packages relating to the JavaScript language ecosystem.
Package kernel provides a concrete Cataloger implementation for linux kernel and module files.
Package kernel provides a concrete Cataloger implementation for linux kernel and module files.
Package nix provides a concrete Cataloger implementation for packages within the Nix packaging ecosystem.
Package nix provides a concrete Cataloger implementation for packages within the Nix packaging ecosystem.
Package php provides a concrete Cataloger implementation relating to packages within the PHP language ecosystem.
Package php provides a concrete Cataloger implementation relating to packages within the PHP language ecosystem.
Package python provides a concrete Cataloger implementation relating to packages within the Python language ecosystem.
Package python provides a concrete Cataloger implementation relating to packages within the Python language ecosystem.
r
Package r provides a concrete Cataloger implementation relating to packages within the R language ecosystem.
Package r provides a concrete Cataloger implementation relating to packages within the R language ecosystem.
Package redhat provides a concrete DBCataloger implementation relating to packages within the RedHat linux distribution.
Package redhat provides a concrete DBCataloger implementation relating to packages within the RedHat linux distribution.
Package ruby provides a concrete Cataloger implementation relating to packages within the Ruby language ecosystem.
Package ruby provides a concrete Cataloger implementation relating to packages within the Ruby language ecosystem.
Package rust provides a concrete Cataloger implementation relating to packages within the Rust language ecosystem.
Package rust provides a concrete Cataloger implementation relating to packages within the Rust language ecosystem.
Package sbom provides a concrete Cataloger implementation for capturing packages embedded within SBOM files.
Package sbom provides a concrete Cataloger implementation for capturing packages embedded within SBOM files.
Package swift provides a concrete Cataloger implementation relating to packages within the swift language ecosystem.
Package swift provides a concrete Cataloger implementation relating to packages within the swift language ecosystem.

Jump to

Keyboard shortcuts

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