registry

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectPackageManagers

func DetectPackageManagers(candidatePath string) ([]sdk.PackageManager, error)

DetectPackageManagers identifies package managers for a filesystem path.

func DetectorNamesForPackageManager

func DetectorNamesForPackageManager(manager sdk.PackageManager) []string

DetectorNamesForPackageManager returns the built-in detector chain for a package manager.

func DetectorOriginForName

func DetectorOriginForName(name string) sdk.DetectorOrigin

DetectorOriginForName returns the origin for a built-in detector name.

func DetectorTechniqueForName

func DetectorTechniqueForName(name string) sdk.DetectorTechnique

DetectorTechniqueForName returns the detection technique for a built-in detector name.

func EcosystemAliasMap

func EcosystemAliasMap() map[string]string

EcosystemAliasMap returns accepted CLI ecosystem aliases to canonical values.

func EvidencePatternsForPackageManager

func EvidencePatternsForPackageManager(manager sdk.PackageManager) []string

EvidencePatternsForPackageManager returns built-in discovery evidence patterns.

func PackageManagersByDetector

func PackageManagersByDetector(detectorName string) ([]sdk.PackageManager, bool)

PackageManagersByDetector returns package managers whose built-in chain includes detectorName.

func SupportedEcosystems

func SupportedEcosystems() []sdk.Ecosystem

SupportedEcosystems returns ecosystems known to Bomly's built-in support catalog.

func SupportedEcosystemsForDetector

func SupportedEcosystemsForDetector(detectorName string) []sdk.Ecosystem

SupportedEcosystemsForDetector returns ecosystems supported by a built-in detector.

func SupportedPackageManagers

func SupportedPackageManagers() []sdk.PackageManager

SupportedPackageManagers returns package managers known to Bomly's built-in registry.

func SupportedPackageManagersForDetector

func SupportedPackageManagersForDetector(detectorName string) []sdk.PackageManager

SupportedPackageManagersForDetector returns package managers supported by a built-in detector.

Types

type ComponentOptions

type ComponentOptions struct {
	DefaultEnabled bool
	Origin         sdk.DetectorOrigin
}

ComponentOptions records Bomly-owned registry behavior that plugin authors should not declare in public descriptors.

type Configs

type Configs struct {
	// FailOn is the parsed list of --fail-on constraints. The policy
	// auditor evaluates findings against this AND-set; an empty slice
	// preserves the historical behavior of emitting every finding.
	FailOn                []sdk.FailOnConstraint
	AllowVulnerabilityIDs []string
	AllowLicenses         []string
	DenyLicenses          []string
	LicenseExemptPackages []string
	DenyPackages          []string
	DenyGroups            []string
	ProtectedPackages     []string
	TyposquatThreshold    string
	TyposquatMode         string
	OsvAPIBase            string
	OsvCacheDir           string
	OsvCacheTTL           string
	KEVCacheDir           string
	KEVCacheTTL           string
	ScorecardAPIBase      string
	ScorecardCacheDir     string
	ScorecardCacheTTL     string
	HTTPProxy             string
	HTTPNoProxy           string
	HTTPProxyType         string
	HTTPProxyHost         string
	HTTPProxyPort         int
	HTTPProxyUsername     string
	HTTPProxyPassword     string
	HTTPCACertFile        string
	HTTPClientProvider    *sdk.HTTPClientProvider
}

Configs holds built-in registry wiring options resolved by the CLI layer.

type DetectorDiscoveryPlan

type DetectorDiscoveryPlan struct {
	SupportedEcosystems []sdk.Ecosystem
	SupportedManagers   []sdk.PackageManager
	EvidencePatterns    []string
	TargetKinds         []sdk.ExecutionTargetKind
}

DetectorDiscoveryPlan describes how one detector participates in runtime planning.

func (DetectorDiscoveryPlan) Clone

Clone returns a deep copy of the discovery plan.

type Filter

type Filter struct {
	DetectorFilter  sdk.DetectorFilter
	AuditorFilter   sdk.AuditorFilter
	MatcherFilter   sdk.MatcherFilter
	AnalyzerFilter  sdk.AnalyzerFilter
	EcosystemFilter sdk.EcosystemFilter
}

Filter narrows a registry down to the runtime-relevant selections.

type IndexedDetectors

type IndexedDetectors struct {
	Path            string
	PrimaryDetector string
	PackageManagers []sdk.PackageManager
}

IndexedDetectors describes a set of package managers that will be detected by the same primary detector.

type OperatingSystemSupport

type OperatingSystemSupport struct {
	Name          string
	Aliases       []string
	Provider      string
	VersionSource string
}

OperatingSystemSupport records the container OS families Syft documents support for.

func SupportedOperatingSystems

func SupportedOperatingSystems() []OperatingSystemSupport

SupportedOperatingSystems returns the documented OS families supported through Syft container scanning.

type PackageManagerSupport

type PackageManagerSupport struct {
	Manager                    sdk.PackageManager
	Ecosystem                  sdk.Ecosystem
	Aliases                    []string
	EvidencePatterns           []string
	Detectors                  []string
	EvidencePatternsByDetector map[string][]string
}

PackageManagerSupport records Bomly's built-in support metadata for one package manager.

func SupportEntries

func SupportEntries() []PackageManagerSupport

SupportEntries returns Bomly's built-in package-manager support catalog.

func SupportEntriesForTechnique

func SupportEntriesForTechnique(technique sdk.DetectorTechnique) []PackageManagerSupport

SupportEntriesForTechnique returns support entries backed by the requested detector technique.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry holds registered detectors, auditors, matchers, analyzers, and discovery plans.

func NewRegistry

func NewRegistry(configs Configs, logger zap.Logger) *Registry

NewRegistry creates an empty registry.

func (*Registry) AllAnalyzers

func (r *Registry) AllAnalyzers() []sdk.Analyzer

AllAnalyzers returns all registered analyzers in registration order, without any filtering. Intended for introspection (e.g. plugin test/doctor).

func (*Registry) AllAuditors

func (r *Registry) AllAuditors() []sdk.Auditor

AllAuditors returns all registered auditors in registration order, without any filtering. Intended for introspection (e.g. plugin test/doctor).

func (*Registry) AllDetectors

func (r *Registry) AllDetectors() []sdk.Detector

AllDetectors returns all registered detectors in registration order, without any filtering. Intended for introspection (e.g. plugin test/doctor).

func (*Registry) AllMatchers

func (r *Registry) AllMatchers() []sdk.Matcher

AllMatchers returns all registered matchers in registration order, without any filtering. Intended for introspection (e.g. plugin test/doctor).

func (*Registry) AnalyzerDescriptors

func (r *Registry) AnalyzerDescriptors() []sdk.AnalyzerDescriptor

AnalyzerDescriptors returns registered analyzer descriptors sorted by name.

func (*Registry) Analyzers

func (r *Registry) Analyzers(req sdk.AnalyzeRequest) []sdk.Analyzer

Analyzers returns the analyzers that apply to the request, filtered by include/exclude selectors, ecosystem, package manager, language, and mode. Empty SupportedLanguages on a descriptor means "applies to any language".

func (*Registry) AuditorDescriptors

func (r *Registry) AuditorDescriptors() []sdk.AuditorDescriptor

AuditorDescriptors returns registered auditor descriptors sorted by name.

func (*Registry) Auditors

func (r *Registry) Auditors(req sdk.AuditRequest) []sdk.Auditor

Auditors returns matching auditors sorted by priority descending then name.

func (*Registry) Build

func (r *Registry) Build()

Build registers detectors, auditors, matchers, and analyzers.

func (*Registry) DefaultEnabledAnalyzerNames

func (r *Registry) DefaultEnabledAnalyzerNames() []string

DefaultEnabledAnalyzerNames returns the default-selected analyzer names.

func (*Registry) DefaultEnabledAuditorNames

func (r *Registry) DefaultEnabledAuditorNames() []string

DefaultEnabledAuditorNames returns the default-selected auditor names.

func (*Registry) DefaultEnabledDetectorNames

func (r *Registry) DefaultEnabledDetectorNames() []string

DefaultEnabledDetectorNames returns the default-selected detector names.

func (*Registry) DefaultEnabledMatcherNames

func (r *Registry) DefaultEnabledMatcherNames() []string

DefaultEnabledMatcherNames returns the default-selected matcher names.

func (*Registry) DetectorDescriptors

func (r *Registry) DetectorDescriptors() []sdk.DetectorDescriptor

DetectorDescriptors returns registered detector descriptors in registration order.

func (*Registry) DetectorOrigin

func (r *Registry) DetectorOrigin(name string) sdk.DetectorOrigin

DetectorOrigin returns Bomly-owned origin metadata for a registered detector.

func (*Registry) Detectors

func (r *Registry) Detectors(req sdk.DetectionRequest) []sdk.Detector

Detectors returns matching detectors in registration order.

func (*Registry) DiscoveryPlans

func (r *Registry) DiscoveryPlans() map[string]DetectorDiscoveryPlan

DiscoveryPlans returns planning metadata keyed by detector name.

func (*Registry) Filter

func (r *Registry) Filter(filter Filter) *Registry

Filter returns a copy of the registry filtered by the supplied detector, auditor, matcher, and ecosystem selections.

func (*Registry) MatcherDescriptors

func (r *Registry) MatcherDescriptors() []sdk.MatcherDescriptor

MatcherDescriptors returns registered matcher descriptors sorted by name.

func (*Registry) Matchers

func (r *Registry) Matchers(req sdk.MatchRequest) []sdk.Matcher

Matchers returns matching matchers sorted by priority descending then name.

func (*Registry) PlannedDetectors

func (r *Registry) PlannedDetectors(req sdk.DetectionRequest, names []string) []sdk.Detector

PlannedDetectors returns detectors matching the requested names in the provided order.

func (*Registry) RegisterAnalyzer

func (r *Registry) RegisterAnalyzer(analyzer sdk.Analyzer)

RegisterAnalyzer adds an analyzer to the registry.

func (*Registry) RegisterAnalyzerWithOptions

func (r *Registry) RegisterAnalyzerWithOptions(analyzer sdk.Analyzer, options ComponentOptions)

RegisterAnalyzerWithOptions adds an analyzer to the registry with internal behavior metadata.

func (*Registry) RegisterAuditor

func (r *Registry) RegisterAuditor(auditor sdk.Auditor)

RegisterAuditor adds an auditor to the registry.

func (*Registry) RegisterAuditorWithOptions

func (r *Registry) RegisterAuditorWithOptions(auditor sdk.Auditor, options ComponentOptions)

RegisterAuditorWithOptions adds an auditor to the registry with internal behavior metadata.

func (*Registry) RegisterDetector

func (r *Registry) RegisterDetector(detector sdk.Detector)

RegisterDetector adds a detector to the registry.

func (*Registry) RegisterDetectorDiscoveryPlan

func (r *Registry) RegisterDetectorDiscoveryPlan(detectorName string, plan DetectorDiscoveryPlan)

RegisterDetectorDiscoveryPlan records planning metadata for automatic detector discovery.

func (*Registry) RegisterDetectorWithOptions

func (r *Registry) RegisterDetectorWithOptions(detector sdk.Detector, options ComponentOptions)

RegisterDetectorWithOptions adds a detector to the registry with internal behavior metadata.

func (*Registry) RegisterMatcher

func (r *Registry) RegisterMatcher(matcher sdk.Matcher)

RegisterMatcher adds a matcher to the registry.

func (*Registry) RegisterMatcherWithOptions

func (r *Registry) RegisterMatcherWithOptions(matcher sdk.Matcher, options ComponentOptions)

RegisterMatcherWithOptions adds a matcher to the registry with internal behavior metadata.

Jump to

Keyboard shortcuts

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