Documentation
¶
Index ¶
- Variables
- func BuildDatabase(opts BuildDatabaseOptions) ([]byte, error)
- func Create(req Request, opts CreateOptions) error
- func Discover(opts DiscoverOptions) error
- func ExportCSV(opts ExportOptions) (io.Reader, error)
- func ExportYAML(opts ExportOptions) (io.Reader, error)
- func Update(req Request, opts UpdateOptions) error
- func Validate(opts ValidateOptions) error
- type BuildDatabaseOptions
- type CreateOptions
- type DiscoverOptions
- type ExportOptions
- type Request
- type UpdateOptions
- type ValidateOptions
Constants ¶
This section is empty.
Variables ¶
var ErrNoPackageSecurityData = errors.New("no package security data found")
Functions ¶
func BuildDatabase ¶
func BuildDatabase(opts BuildDatabaseOptions) ([]byte, error)
BuildDatabase builds a security database from the given options.
func Create ¶
func Create(req Request, opts CreateOptions) error
Create creates a new advisory in the `advisories` section of the document at the provided path.
func Discover ¶
func Discover(opts DiscoverOptions) error
Discover searches for new vulnerabilities that match packages in a config index, and adds new advisories to configs for vulnerabilities that haven't been noted yet.
func ExportCSV ¶ added in v0.1.6
func ExportCSV(opts ExportOptions) (io.Reader, error)
ExportCSV returns a reader of advisory data encoded as CSV.
func ExportYAML ¶ added in v0.1.6
func ExportYAML(opts ExportOptions) (io.Reader, error)
ExportYAML returns a reader of advisory data encoded as YAML.
func Update ¶
func Update(req Request, opts UpdateOptions) error
Update adds a new event to an existing advisory (named by the vuln parameter) in the document at the provided path.
func Validate ¶
func Validate(opts ValidateOptions) error
Types ¶
type BuildDatabaseOptions ¶
type BuildDatabaseOptions struct {
AdvisoryDocIndices []*configs.Index[v2.Document]
URLPrefix string
Archs []string
Repo string
}
BuildDatabaseOptions contains the options for building a database.
type CreateOptions ¶
type CreateOptions struct {
// AdvisoryDocs is the Index of advisory documents on which to operate.
AdvisoryDocs *configs.Index[v2.Document]
}
CreateOptions configures the Create operation.
type DiscoverOptions ¶
type DiscoverOptions struct {
// SelectedPackages is a list of packages to include in search. If empty, all
// packages will be included in search.
SelectedPackages []string
// BuildCfgs is the Index of build configurations on which to operate.
BuildCfgs *configs.Index[config.Configuration]
// AdvisoryDocs is the Index of advisory documents on which to operate.
AdvisoryDocs *configs.Index[v2.Document]
// PackageRepositoryURL is the URL to the distro's package repository (e.g.
// "https://packages.wolfi.dev/os").
PackageRepositoryURL string
// The Arches to select during discovery (e.g. "x86_64").
Arches []string
// VulnerabilityDetector is how Discover finds vulnerabilities for packages.
VulnerabilityDetector vuln.Detector
}
type Request ¶
Request specifies the parameters for creating a new advisory or updating an existing advisory.