Documentation
¶
Overview ¶
Package nodejs contains components for interrogating nodejs packages in container layers.
Index ¶
- Constants
- Variables
- func GeneratePURL(ctx context.Context, ir *claircore.IndexRecord) (packageurl.PackageURL, error)
- func NewCoalescer(_ context.Context) (indexer.Coalescer, error)
- func NewEcosystem(_ context.Context) *indexer.Ecosystem
- func ParsePURL(ctx context.Context, purl packageurl.PackageURL) ([]*claircore.IndexRecord, error)
- type Matcher
- func (*Matcher) Filter(record *claircore.IndexRecord) bool
- func (*Matcher) Name() string
- func (*Matcher) Query() []driver.MatchConstraint
- func (*Matcher) VersionAuthoritative() bool
- func (*Matcher) VersionFilter()
- func (*Matcher) Vulnerable(_ context.Context, _ *claircore.IndexRecord, _ *claircore.Vulnerability) (bool, error)
- type Scanner
Constants ¶
const (
// PURLType is the type of package URL for Node.js packages.
PURLType = "npm"
)
Variables ¶
var (
Repository = claircore.Repository{
Name: repository,
URI: "https://www.npmjs.com/",
}
)
Functions ¶
func GeneratePURL ¶ added in v1.5.49
func GeneratePURL(ctx context.Context, ir *claircore.IndexRecord) (packageurl.PackageURL, error)
GeneratePURL generates a Node.js PURL for a given claircore.IndexRecord. Example: pkg:npm/express@4.18.2
func NewEcosystem ¶
NewEcosystem provides the set of scanners for the nodejs ecosystem.
func ParsePURL ¶ added in v1.5.49
func ParsePURL(ctx context.Context, purl packageurl.PackageURL) ([]*claircore.IndexRecord, error)
ParsePURL parses a Node.js PURL into a list of [claircore.IndexRecord]s. The matcher needs the NormalizedVersion to be set.
Types ¶
type Matcher ¶
type Matcher struct{}
Matcher attempts to correlate discovered nodejs packages with reported vulnerabilities.
func (*Matcher) Filter ¶
func (*Matcher) Filter(record *claircore.IndexRecord) bool
Filter implements driver.Matcher.
func (*Matcher) Query ¶
func (*Matcher) Query() []driver.MatchConstraint
Query implements driver.Matcher.
func (*Matcher) VersionAuthoritative ¶
func (*Matcher) VersionFilter ¶
func (*Matcher) VersionFilter()
func (*Matcher) Vulnerable ¶
func (*Matcher) Vulnerable(_ context.Context, _ *claircore.IndexRecord, _ *claircore.Vulnerability) (bool, error)
Vulnerable implements driver.Matcher.
type Scanner ¶
type Scanner struct{}
Scanner implements the scanner.PackageScanner interface.
It looks for files that seem like package.json and looks at the metadata recorded there.
The zero value is ready to use.
func (*Scanner) DefaultRepository ¶
func (*Scanner) DefaultRepository(_ context.Context) *claircore.Repository
DefaultRepository implements indexer.DefaultRepoScanner.