Documentation
¶
Overview ¶
Package binary provides a concrete Cataloger implementations for surfacing possible packages based on signatures found within binary files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCataloger ¶
func NewCataloger(cfg CatalogerConfig) pkg.Cataloger
Types ¶
type Cataloger ¶
type Cataloger struct {
// contains filtered or unexported fields
}
Cataloger is the cataloger responsible for surfacing evidence of a very limited set of binary files, which have been identified by the classifiers. The Cataloger is _NOT_ a place to catalog any and every binary, but rather the specific set that has been curated to be important, predominantly related to toolchain- related runtimes like Python, Go, Java, or Node. Some exceptions can be made for widely-used binaries such as busybox.
type CatalogerConfig ¶ added in v0.100.0
type CatalogerConfig struct {
Classifiers []Classifier `yaml:"classifiers" json:"classifiers" mapstructure:"classifiers"`
}
func DefaultCatalogerConfig ¶ added in v0.100.0
func DefaultCatalogerConfig() CatalogerConfig
func (CatalogerConfig) MarshalJSON ¶ added in v0.101.0
func (cfg CatalogerConfig) MarshalJSON() ([]byte, error)
type Classifier ¶ added in v0.100.0
type Classifier struct { Class string `json:"class"` // FileGlob is a selector to narrow down file inspection using the **/glob* syntax FileGlob string `json:"fileGlob"` // EvidenceMatcher is what will be used to match against the file in the source // location. If the matcher returns a package, the file will be considered a candidate. EvidenceMatcher EvidenceMatcher `json:"-"` // Package is the name to use for the package Package string `json:"package"` // PURL is the Package URL to use when generating a package PURL packageurl.PackageURL `json:"purl"` // CPEs are the specific CPEs we want to include for this binary with updated version information CPEs []cpe.CPE `json:"cpes"` }
Classifier is a generic package classifier that can be used to match a package definition to a file that meets the given content criteria of the EvidenceMatcher.
func DefaultClassifiers ¶ added in v0.100.0
func DefaultClassifiers() []Classifier
func (Classifier) MarshalJSON ¶ added in v0.101.0
func (cfg Classifier) MarshalJSON() ([]byte, error)
type EvidenceMatcher ¶ added in v0.100.0
type EvidenceMatcher func(resolver file.Resolver, classifier Classifier, location file.Location) ([]pkg.Package, error)
EvidenceMatcher is a function called to catalog Packages that match some sort of evidence
func FileContentsVersionMatcher ¶ added in v0.100.0
func FileContentsVersionMatcher(pattern string) EvidenceMatcher