Documentation
¶
Index ¶
- func BuiltinDetectors() []plugin.Detector
- func DetectPackageManagers(candidatePath string) ([]model.PackageManager, error)
- func DetectorNamesForPackageManager(manager model.PackageManager) []string
- func DetectorOriginForName(name string) plugin.DetectorOrigin
- func DetectorTechniqueForName(name string) plugin.DetectorTechnique
- func EcosystemAliasMap() map[string]string
- func EvidencePatternsForPackageManager(manager model.PackageManager) []string
- func PackageManagersByDetector(detectorName string) ([]model.PackageManager, bool)
- func SupportedEcosystems() []model.Ecosystem
- func SupportedEcosystemsForDetector(detectorName string) []model.Ecosystem
- func SupportedPackageManagers() []model.PackageManager
- func SupportedPackageManagersForDetector(detectorName string) []model.PackageManager
- type ComponentOptions
- type Configs
- type DetectorDiscoveryPlan
- type Filter
- type IndexedDetectors
- type OperatingSystemSupport
- type PackageManagerSupport
- type Registry
- func (r *Registry) AllAnalyzers() []plugin.Analyzer
- func (r *Registry) AllAuditors() []plugin.Auditor
- func (r *Registry) AllDetectors() []plugin.Detector
- func (r *Registry) AllMatchers() []plugin.Matcher
- func (r *Registry) AnalyzerDescriptors() []plugin.AnalyzerDescriptor
- func (r *Registry) Analyzers(req plugin.AnalyzeRequest) []plugin.Analyzer
- func (r *Registry) AuditorDescriptors() []plugin.AuditorDescriptor
- func (r *Registry) Auditors(req plugin.AuditRequest) []plugin.Auditor
- func (r *Registry) Build()
- func (r *Registry) BuildContext(ctx context.Context)
- func (r *Registry) Close() error
- func (r *Registry) ComponentConfig(kind plugin.PluginKind, name string) map[string]any
- func (r *Registry) ComponentOrigin(kind plugin.PluginKind, name string) plugin.DetectorOrigin
- func (r *Registry) DefaultEnabled(kind plugin.PluginKind, name string) bool
- func (r *Registry) DefaultEnabledAnalyzerNames() []string
- func (r *Registry) DefaultEnabledAuditorNames() []string
- func (r *Registry) DefaultEnabledDetectorNames() []string
- func (r *Registry) DefaultEnabledMatcherNames() []string
- func (r *Registry) DetectorDescriptors() []plugin.DetectorDescriptor
- func (r *Registry) DetectorOrigin(name string) plugin.DetectorOrigin
- func (r *Registry) Detectors(req plugin.DetectionRequest) []plugin.Detector
- func (r *Registry) DiscoveryPlans() map[string]DetectorDiscoveryPlan
- func (r *Registry) Filter(filter Filter) *Registry
- func (r *Registry) MatcherDescriptors() []plugin.MatcherDescriptor
- func (r *Registry) Matchers(req plugin.MatchRequest) []plugin.Matcher
- func (r *Registry) PlannedDetectors(req plugin.DetectionRequest, names []string) []plugin.Detector
- func (r *Registry) RegisterAnalyzer(analyzer plugin.Analyzer)
- func (r *Registry) RegisterAnalyzerWithOptions(analyzer plugin.Analyzer, options ComponentOptions)
- func (r *Registry) RegisterAuditor(auditor plugin.Auditor)
- func (r *Registry) RegisterAuditorWithOptions(auditor plugin.Auditor, options ComponentOptions)
- func (r *Registry) RegisterDetector(detector plugin.Detector)
- func (r *Registry) RegisterDetectorDiscoveryPlan(detectorName string, plan DetectorDiscoveryPlan)
- func (r *Registry) RegisterDetectorWithOptions(detector plugin.Detector, options ComponentOptions)
- func (r *Registry) RegisterMatcher(matcher plugin.Matcher)
- func (r *Registry) RegisterMatcherWithOptions(matcher plugin.Matcher, options ComponentOptions)
- func (r *Registry) RegisterModule(m plugin.Module, opts ComponentOptions) error
- func (r *Registry) SelectedAuditors(filter plugin.AuditorFilter) []plugin.Auditor
- func (r *Registry) Without(kind plugin.PluginKind, names []string) *Registry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuiltinDetectors ¶ added in v0.18.0
BuiltinDetectors returns fresh instances of every built-in detector in the support catalog. Callers use it to aggregate detector-declared metadata (discovery ignore rules, native multi-module support) when no runtime registry is available, e.g. in diagnostics that run before registry construction.
func DetectPackageManagers ¶
func DetectPackageManagers(candidatePath string) ([]model.PackageManager, error)
DetectPackageManagers identifies package managers for a filesystem path.
func DetectorNamesForPackageManager ¶
func DetectorNamesForPackageManager(manager model.PackageManager) []string
DetectorNamesForPackageManager returns the built-in detector chain for a package manager.
func DetectorOriginForName ¶
func DetectorOriginForName(name string) plugin.DetectorOrigin
DetectorOriginForName returns the origin for a built-in detector name.
func DetectorTechniqueForName ¶
func DetectorTechniqueForName(name string) plugin.DetectorTechnique
DetectorTechniqueForName returns the detection technique for a built-in detector name.
func EcosystemAliasMap ¶
EcosystemAliasMap returns accepted CLI ecosystem aliases to canonical values.
func EvidencePatternsForPackageManager ¶
func EvidencePatternsForPackageManager(manager model.PackageManager) []string
EvidencePatternsForPackageManager returns built-in discovery evidence patterns.
func PackageManagersByDetector ¶
func PackageManagersByDetector(detectorName string) ([]model.PackageManager, bool)
PackageManagersByDetector returns package managers whose built-in chain includes detectorName.
func SupportedEcosystems ¶
SupportedEcosystems returns ecosystems known to Bomly's built-in support catalog.
func SupportedEcosystemsForDetector ¶
SupportedEcosystemsForDetector returns ecosystems supported by a built-in detector.
func SupportedPackageManagers ¶
func SupportedPackageManagers() []model.PackageManager
SupportedPackageManagers returns package managers known to Bomly's built-in registry.
func SupportedPackageManagersForDetector ¶
func SupportedPackageManagersForDetector(detectorName string) []model.PackageManager
SupportedPackageManagersForDetector returns package managers supported by a built-in detector.
Types ¶
type ComponentOptions ¶
type ComponentOptions struct {
DefaultEnabled bool
Origin plugin.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. Vulnerability
// constraints form an AND-set; other auditors may consume independent
// finding-family constraints.
FailOn []model.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
GrypeDBUpdateDisabled bool
GrypeDBMaxAge string
GrypeDBUpdateCheckInterval string
HTTPProxy string
HTTPNoProxy string
HTTPProxyType string
HTTPProxyHost string
HTTPProxyPort int
HTTPProxyUsername string
HTTPProxyPassword string
HTTPCACertFile string
HTTPClientProvider *httpkit.ClientProvider
// PluginConfigs carries kind-scoped per-component configuration blocks so
// embedded components can decode the same block managed plugins receive.
PluginConfigs config.PluginConfigs
// CoreVersion is the running bomly core version, surfaced to embedded
// components through plugin.HostContext.Runtime(). Empty when unknown.
CoreVersion string
}
Configs holds built-in registry wiring options resolved by the CLI layer.
type DetectorDiscoveryPlan ¶
type DetectorDiscoveryPlan struct {
SupportedEcosystems []model.Ecosystem
SupportedManagers []model.PackageManager
EvidencePatterns []string
TargetKinds []plugin.ExecutionTargetKind
}
DetectorDiscoveryPlan describes how one detector participates in runtime planning.
func (DetectorDiscoveryPlan) Clone ¶
func (p DetectorDiscoveryPlan) Clone() DetectorDiscoveryPlan
Clone returns a deep copy of the discovery plan.
type Filter ¶
type Filter struct {
DetectorFilter plugin.DetectorFilter
AuditorFilter plugin.AuditorFilter
MatcherFilter plugin.MatcherFilter
AnalyzerFilter plugin.AnalyzerFilter
EcosystemFilter model.EcosystemFilter
}
Filter narrows a registry down to the runtime-relevant selections.
type IndexedDetectors ¶
type IndexedDetectors struct {
Path string
PrimaryDetector string
PackageManagers []model.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 model.PackageManager
Ecosystem model.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 plugin.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 ¶
NewRegistry creates an empty registry.
func (*Registry) AllAnalyzers ¶
AllAnalyzers returns all registered analyzers in registration order, without any filtering. Intended for introspection (e.g. plugin test/doctor).
func (*Registry) AllAuditors ¶
AllAuditors returns all registered auditors in registration order, without any filtering. Intended for introspection (e.g. plugin test/doctor).
func (*Registry) AllDetectors ¶
AllDetectors returns all registered detectors in registration order, without any filtering. Intended for introspection (e.g. plugin test/doctor).
func (*Registry) AllMatchers ¶
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() []plugin.AnalyzerDescriptor
AnalyzerDescriptors returns registered analyzer descriptors sorted by name.
func (*Registry) Analyzers ¶
func (r *Registry) Analyzers(req plugin.AnalyzeRequest) []plugin.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() []plugin.AuditorDescriptor
AuditorDescriptors returns registered auditor descriptors sorted by name.
func (*Registry) Auditors ¶
func (r *Registry) Auditors(req plugin.AuditRequest) []plugin.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, with no command lifetime: for a registry built only to inspect descriptors. A registry whose components run uses BuildContext.
func (*Registry) BuildContext ¶ added in v0.30.0
BuildContext registers detectors, auditors, matchers, and analyzers, and constructs every embedded module component under ctx -- the owning command's context -- so a component's lifetime ends with the command's. The owner calls Close when the command is done.
func (*Registry) Close ¶ added in v0.30.0
Close ends the lifetime of every embedded component the registry constructed, newest first, running each one's cleanups at most once. Every scope is closed even when an earlier one fails; the failures are joined, each naming its component. Safe to call more than once.
func (*Registry) ComponentConfig ¶ added in v0.22.0
ComponentConfig returns the resolved configuration block for a registered component, or nil when none is configured. Embedded components can decode the same kind-scoped block that managed plugins receive.
func (*Registry) ComponentOrigin ¶ added in v0.22.0
func (r *Registry) ComponentOrigin(kind plugin.PluginKind, name string) plugin.DetectorOrigin
ComponentOrigin returns Bomly-owned origin metadata for a registered component.
func (*Registry) DefaultEnabled ¶ added in v0.30.0
func (r *Registry) DefaultEnabled(kind plugin.PluginKind, name string) bool
DefaultEnabled reports whether the registry selects the named component of kind when the user's selector does not mention it.
func (*Registry) DefaultEnabledAnalyzerNames ¶
DefaultEnabledAnalyzerNames returns the default-selected analyzer names.
func (*Registry) DefaultEnabledAuditorNames ¶
DefaultEnabledAuditorNames returns the default-selected auditor names.
func (*Registry) DefaultEnabledDetectorNames ¶
DefaultEnabledDetectorNames returns the default-selected detector names.
func (*Registry) DefaultEnabledMatcherNames ¶
DefaultEnabledMatcherNames returns the default-selected matcher names.
func (*Registry) DetectorDescriptors ¶
func (r *Registry) DetectorDescriptors() []plugin.DetectorDescriptor
DetectorDescriptors returns registered detector descriptors in registration order.
func (*Registry) DetectorOrigin ¶
func (r *Registry) DetectorOrigin(name string) plugin.DetectorOrigin
DetectorOrigin returns Bomly-owned origin metadata for a registered detector.
func (*Registry) Detectors ¶
func (r *Registry) Detectors(req plugin.DetectionRequest) []plugin.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 ¶
Filter returns a copy of the registry filtered by the supplied detector, auditor, matcher, and ecosystem selections.
func (*Registry) MatcherDescriptors ¶
func (r *Registry) MatcherDescriptors() []plugin.MatcherDescriptor
MatcherDescriptors returns registered matcher descriptors sorted by name.
func (*Registry) Matchers ¶
func (r *Registry) Matchers(req plugin.MatchRequest) []plugin.Matcher
Matchers returns matching matchers sorted by priority descending then name.
func (*Registry) PlannedDetectors ¶
PlannedDetectors returns detectors matching the requested names in the provided order.
func (*Registry) RegisterAnalyzer ¶
RegisterAnalyzer adds an analyzer to the registry.
func (*Registry) RegisterAnalyzerWithOptions ¶
func (r *Registry) RegisterAnalyzerWithOptions(analyzer plugin.Analyzer, options ComponentOptions)
RegisterAnalyzerWithOptions adds an analyzer to the registry with internal behavior metadata.
func (*Registry) RegisterAuditor ¶
RegisterAuditor adds an auditor to the registry.
func (*Registry) RegisterAuditorWithOptions ¶
func (r *Registry) RegisterAuditorWithOptions(auditor plugin.Auditor, options ComponentOptions)
RegisterAuditorWithOptions adds an auditor to the registry with internal behavior metadata.
func (*Registry) RegisterDetector ¶
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 plugin.Detector, options ComponentOptions)
RegisterDetectorWithOptions adds a detector to the registry with internal behavior metadata.
func (*Registry) RegisterMatcher ¶
RegisterMatcher adds a matcher to the registry.
func (*Registry) RegisterMatcherWithOptions ¶
func (r *Registry) RegisterMatcherWithOptions(matcher plugin.Matcher, options ComponentOptions)
RegisterMatcherWithOptions adds a matcher to the registry with internal behavior metadata.
func (*Registry) RegisterModule ¶ added in v0.22.0
func (r *Registry) RegisterModule(m plugin.Module, opts ComponentOptions) error
RegisterModule validates an execution-neutral module, constructs its component with an embedded HostContext, and registers it with the supplied component options. It is the registration path composition entries use.
func (*Registry) SelectedAuditors ¶ added in v0.30.0
func (r *Registry) SelectedAuditors(filter plugin.AuditorFilter) []plugin.Auditor
SelectedAuditors returns every auditor filter selects, before ecosystem and package-manager matching narrows the set for one request. A component audit selects by the queried package's ecosystem, which planning cannot know in advance, so planning has to see all of them.
func (*Registry) Without ¶ added in v0.30.0
func (r *Registry) Without(kind plugin.PluginKind, names []string) *Registry
Without returns a view of the registry that leaves out the named components of one kind and shares every other registration. Runtime preflight uses it to hold a component back from a stage without touching the selection filters the component itself is sent.
The view owns no component lifetime: closing it ends nothing, because the registry it came from still owns every component it constructed.