Skip to content

Make it easier to opt into transitive enrichers #2537

@another-rex

Description

@another-rex

Related: #2327

Right now in:

plugins := scalibrplugin.Resolve(actions.PluginsEnabled, actions.PluginsDisabled)
// TODO: Use Enricher.RequiredPlugins to check this generically
if !actions.TransitiveScanning.Disabled && isRequirementsExtractorEnabled(plugins) {
p, err := transitivedependencyrequirements.New(&cpb.PluginConfig{
UserAgent: actions.RequestUserAgent,
})
if err != nil {
log.Errorf("Failed to make transitivedependencyrequirements enricher: %v", err)
} else {
plugins = append(plugins, p)

it forcibly enables the transitive plugins.

I think we need to rework this logic a bit, right now I think a viable solution is:

  1. Put all the transitive enrichers into a preset
  2. If transitive scanning is not disabled, add that preset to the list of enabled plugins (or default to having it in the list of enabled, and disable the preset of transitive scanning is disabled.)
  3. All plugin in resolve should check its requirements, and remove itself if from the list of enabled plugins if it does not have the prereqs. (This is the TODO comment basically)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions