Documentation
¶
Overview ¶
Package processor orchestrates the import and query workflows.
Import workflow:
- Parse scanner JSON output
- Auto-detect scanner format via converter registry
- Convert to normalized Vulnerability structures
- Deduplicate by SHA256 hash of exposure+package+version
- Store via target importer
Query workflow:
- Validate query options
- Determine query type (images, digests, exposure, packages, etc.)
- Execute via target querier
- Format output (JSON or SARIF)
Example import:
opts := &processor.ImportOptions{
Source: "docker.io/redis:latest",
File: "grype-output.json",
Target: "sqlite://vulns.db",
}
err := processor.Import(ctx, opts)
Example query:
opts := &query.Options{
Image: "docker.io/redis",
Target: "sqlite://vulns.db",
Format: query.FormatJSON,
}
result, err := processor.QueryWithContext(ctx, opts)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConverterNames ¶ added in v0.7.0
func GetConverterNames() []string
GetConverterNames returns the names of all available converters.
func Import ¶ added in v0.5.0
func Import(opt *ImportOptions) error
Import imports the vulnerability report to the target data store.
func ImportWithContext ¶ added in v0.7.0
func ImportWithContext(ctx context.Context, opt *ImportOptions) error
ImportWithContext imports the vulnerability report to the target data store with context support.
Types ¶
type ImportOptions ¶ added in v0.5.0
type ImportOptions struct {
// Source is the URI of the image from which the report was generated.
Source string
// File path to the vulnerability report to import.
File string
// Scanners is the list of scanners to use.
Scanners string
// Target is the target data store uri.
Target string
// contains filtered or unexported fields
}
ImportOptions represents the input options.
Click to show internal directories.
Click to hide internal directories.