cataloger

package
v0.0.0-...-0710af2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: Apache-2.0 Imports: 42 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 Exclude

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

Exclude 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 exclude was implemented as a way to help resolve: https://github.com/anchore/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.GoCatalogerOpts
	LinuxKernel                     kernel.LinuxCatalogerConfig
	Python                          python.CatalogerConfig
	Catalogers                      []string
	Parallelism                     int
	ExcludeBinaryOverlapByOwnership bool
}

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

func DefaultConfig

func DefaultConfig() Config

func (Config) Java

func (c Config) Java() java.Config

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 apkdb provides a concrete Cataloger implementation for Alpine DB files.
Package apkdb provides a concrete Cataloger implementation for Alpine DB 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 deb provides a concrete Cataloger implementation for Debian package DB status files.
Package deb provides a concrete Cataloger implementation for Debian package DB status files.
Package elixir provides a concrete Cataloger implementation for elixir specific package manger files.
Package elixir provides a concrete Cataloger implementation for elixir specific package manger files.
Package erlang provides a concrete Cataloger implementation for erlang specific package manger files.
Package erlang provides a concrete Cataloger implementation for erlang specific package manger files.
Package golang provides a concrete Cataloger implementation for go.mod files.
Package golang provides a concrete Cataloger implementation for go.mod files.
internal
Package java provides a concrete Cataloger implementation for Java archives (jar, war, ear, par, sar, jpi, hpi, and native-image formats).
Package java provides a concrete Cataloger implementation for Java archives (jar, war, ear, par, sar, jpi, hpi, and native-image formats).
Package javascript provides a concrete Cataloger implementation for JavaScript ecosystem files (yarn and npm).
Package javascript provides a concrete Cataloger implementation for JavaScript ecosystem files (yarn and npm).
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 php provides a concrete Cataloger implementation for PHP ecosystem files.
Package php provides a concrete Cataloger implementation for PHP ecosystem files.
Package portage provides a concrete Cataloger implementation for Gentoo Portage.
Package portage provides a concrete Cataloger implementation for Gentoo Portage.
r
Package rpm provides a concrete DBCataloger implementation for RPM "Package" DB files and a FileCataloger for RPM files.
Package rpm provides a concrete DBCataloger implementation for RPM "Package" DB files and a FileCataloger for RPM files.
Package ruby bundler provides a concrete Cataloger implementation for Ruby Gemfile.lock bundler files.
Package ruby bundler provides a concrete Cataloger implementation for Ruby Gemfile.lock bundler files.
Package rust provides a concrete Cataloger implementation for Cargo.lock files.
Package rust provides a concrete Cataloger implementation for Cargo.lock files.
Package swift provides a concrete Cataloger implementation for Podfile.lock and Package.resolved files.
Package swift provides a concrete Cataloger implementation for Podfile.lock and Package.resolved files.

Jump to

Keyboard shortcuts

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