daemons

package
v1.13.3-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: AGPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type DaemonRunner

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

DaemonRunner encapsulates daemon dependencies and lifecycle

func NewDaemonRunner

func NewDaemonRunner(
	db shared.DB,
	broker shared.PubSubBroker,
	configService shared.ConfigService,
	rbacProvider shared.RBACProvider,
	integrationAggregate shared.IntegrationAggregate,
	assetVersionService shared.AssetVersionService,
	assetVersionRepository shared.AssetVersionRepository,
	assetRepository shared.AssetRepository,
	projectRepository shared.ProjectRepository,
	orgRepository shared.OrganizationRepository,
	artifactService shared.ArtifactService,
	componentRepository shared.ComponentRepository,
	componentService shared.ComponentService,
	dependencyVulnService shared.DependencyVulnService,
	dependencyVulnRepository shared.DependencyVulnRepository,
	componentProjectRepository shared.ComponentProjectRepository,
	vulnEventRepository shared.VulnEventRepository,
	statisticsService shared.StatisticsService,
	artifactRepository shared.ArtifactRepository,
	cveRepository shared.CveRepository,
	cweRepository shared.CweRepository,
	exploitsRepository shared.ExploitRepository,
	affectedComponentsRepository shared.AffectedComponentRepository,
	scanService shared.ScanService,
	leaderElector shared.LeaderElector,
	maliciousPackageChecker shared.MaliciousPackageChecker,
	vulnDBImportService shared.VulnDBService,
	vexRuleRepository shared.VEXRuleRepository,
	vexRuleRecommendationRepository shared.VEXRuleRecommendationRepository,
	trustedEntityRepository shared.TrustedEntityRepository,
	externalReferenceRepository shared.ExternalReferenceRepository,
	fixedVersionResolver shared.FixedVersionResolver,
	upstreamVEXRuleRepository shared.UpstreamVEXRuleRepository,
	pool *pgxpool.Pool,
) *DaemonRunner

NewDaemonRunner creates a new daemon runner with injected dependencies

func (*DaemonRunner) ApplyVEXRules added in v1.12.5

func (runner *DaemonRunner) ApplyVEXRules(input <-chan assetWithProjectAndOrg, errChan chan<- pipelineError) <-chan assetWithProjectAndOrg

ApplyVEXRules re-applies this asset's VEX rules on a schedule, not only at rule-creation time or against whatever a scan just found. This is what catches a rule that starts matching a vuln later - e.g. an upstream rule ingested by SyncUpstream above, or a rule whose CEL expression changed since it last ran.

False-positive/accepted rules are only evaluated against currently open vulns (closing an already-closed vuln again is a no-op anyway). Reopen rules are the mirror image: they only make sense against vulns a previous rule (or a person) already accepted, so they're evaluated against accepted vulns instead.

func (*DaemonRunner) AutoReopenTickets

func (runner *DaemonRunner) AutoReopenTickets(input <-chan assetWithProjectAndOrg, errChan chan<- pipelineError) <-chan assetWithProjectAndOrg

func (*DaemonRunner) CleanupOrphanedRecords added in v1.2.0

func (runner *DaemonRunner) CleanupOrphanedRecords(ctx context.Context) error

func (*DaemonRunner) CollectStats

func (runner *DaemonRunner) CollectStats(input <-chan assetWithProjectAndOrg, errChan chan<- pipelineError) <-chan assetWithProjectAndOrg

func (*DaemonRunner) DebugMode

func (runner *DaemonRunner) DebugMode() bool

func (*DaemonRunner) DeleteOldAssetVersions

func (runner *DaemonRunner) DeleteOldAssetVersions(input <-chan assetWithProjectAndOrg, errChan chan<- pipelineError) <-chan assetWithProjectAndOrg

func (*DaemonRunner) FetchAllAssetIDs

func (runner *DaemonRunner) FetchAllAssetIDs(ctx context.Context) <-chan uuid.UUID

func (*DaemonRunner) FetchAssetDetails

func (runner *DaemonRunner) FetchAssetDetails(pipelineCtx context.Context, input <-chan uuid.UUID, errChan chan<- pipelineError) <-chan assetWithProjectAndOrg

fetches the asset details for each element in the input channel This approach is intended to avoid overloading the database with large queries or too many concurrent requests.

func (*DaemonRunner) FetchAssetIDs

func (runner *DaemonRunner) FetchAssetIDs(ctx context.Context) <-chan uuid.UUID

func (*DaemonRunner) FetchVulnsToUpdate added in v1.12.5

func (runner *DaemonRunner) FetchVulnsToUpdate(ctx context.Context) ([]fixedVersionJob, error)

fetches all vulns with no component_fixed_version information and deduplicates them based on purl + cve_id

func (*DaemonRunner) RecalculateRiskForVulnerabilities

func (runner *DaemonRunner) RecalculateRiskForVulnerabilities(input <-chan assetWithProjectAndOrg, errChan chan<- pipelineError) <-chan assetWithProjectAndOrg

func (*DaemonRunner) ResolveDifferencesInTicketState

func (runner *DaemonRunner) ResolveDifferencesInTicketState(input <-chan assetWithProjectAndOrg, errChan chan<- pipelineError) <-chan assetWithProjectAndOrg

func (*DaemonRunner) ResolveFixedVersions added in v1.2.0

func (runner *DaemonRunner) ResolveFixedVersions(input <-chan assetWithProjectAndOrg, errChan chan<- pipelineError) <-chan assetWithProjectAndOrg

func (*DaemonRunner) RunAssetPipeline

func (runner *DaemonRunner) RunAssetPipeline(ctx context.Context, forceAll bool)

this creates a channel which will be used to pipeline asset processing in daemons

func (*DaemonRunner) RunDaemonPipelineForAsset

func (runner *DaemonRunner) RunDaemonPipelineForAsset(ctx context.Context, assetID uuid.UUID) error

func (*DaemonRunner) RunResolveFixedVersionsPipeline added in v1.2.0

func (runner *DaemonRunner) RunResolveFixedVersionsPipeline(ctx context.Context, forceAll bool) error

func (*DaemonRunner) RunVEXRuleRecommendationDaemon added in v1.12.0

func (runner *DaemonRunner) RunVEXRuleRecommendationDaemon(ctx context.Context) error

func (*DaemonRunner) ScanAsset

func (runner *DaemonRunner) ScanAsset(input <-chan assetWithProjectAndOrg, errChan chan<- pipelineError) <-chan assetWithProjectAndOrg

func (*DaemonRunner) SetDebugOptions

func (runner *DaemonRunner) SetDebugOptions(options DebugOptions)

func (*DaemonRunner) Start

func (runner *DaemonRunner) Start(ctx context.Context)

Start initiates all background daemons

func (*DaemonRunner) SyncTickets

func (runner *DaemonRunner) SyncTickets(input <-chan assetWithProjectAndOrg, errChan chan<- pipelineError) <-chan assetWithProjectAndOrg

func (*DaemonRunner) SyncUpstream

func (runner *DaemonRunner) SyncUpstream(input <-chan assetWithProjectAndOrg, errChan chan<- pipelineError) <-chan assetWithProjectAndOrg

func (*DaemonRunner) UpdateAllFixedVersions added in v1.12.5

func (runner *DaemonRunner) UpdateAllFixedVersions(ctx context.Context, updatingJobs []fixedVersionJob) error

updates the dependency vulns passed using a <staging table + copy + update> from approach

func (*DaemonRunner) UpdateFixedVersions

func (runner *DaemonRunner) UpdateFixedVersions(ctx context.Context) error

func (*DaemonRunner) UpdateOpenSourceInsightInformation

func (runner *DaemonRunner) UpdateOpenSourceInsightInformation(ctx context.Context) error

func (*DaemonRunner) UpdateVulnDB

func (runner *DaemonRunner) UpdateVulnDB(ctx context.Context) error

type DebugOptions

type DebugOptions struct {
	LimitToAssetVersionSlug string
	// LimitToStages, when non-empty, skips all pipeline stages not in the list.
	// Valid values match the stage method names: "SyncTickets",
	// "ResolveDifferencesInTicketState", "ScanAsset", "SyncUpstream",
	// "CollectStats", "RecalculateRiskForVulnerabilities", "AutoReopenTickets",
	// "DeleteOldAssetVersions", "ResolveFixedVersions".
	LimitToStages []string
	// DryRun skips all database writes. External system mutations are separately
	// intercepted by the dryRunIntegration wrapper.
	DryRun bool
}

Jump to

Keyboard shortcuts

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