Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrImageNotFound indicates that the image provided was not found in the // registry. ErrImageNotFound = errors.New("image not found") // ErrSchemaV1NotSupported indicates that the image provided is using a v1 // schema which is not supported. ErrSchemaV1NotSupported = errors.New("schema v1 manifest not supported by trivy") )
Functions ¶
func WithImageScanner ¶ added in v1.1.0
func WithImageScanner(is ImageScanner) func(s *Scanner)
WithImageScanner allows providing a specific ImageScanner implementation for a Scanner instance.
Types ¶
type ImageScanner ¶ added in v1.1.0
type ImageScanner interface { // ScanImage scans the provided image for security vulnerabilities, // returning a report in json format. ScanImage(image string) ([]byte, error) }
ImageScanner describes the methods an ImageScanner implementation must provide. An image scanner is responsible of scanning a container image for security vulnerabilities.
type ImageScannerMock ¶ added in v1.1.0
ImageScannerMock is an ImageScanner mock implementation.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner is in charge of scanning packages' snapshots for security vulnerabilities. It relies on an image scanner to scan all the containers images listed on the snapshot.
func New ¶ added in v1.1.0
func New( ctx context.Context, cfg *viper.Viper, ec hub.ErrorsCollector, opts ...func(s *Scanner), ) *Scanner
New creates a new Scanner instance.
func (*Scanner) Scan ¶
func (s *Scanner) Scan(sn *hub.SnapshotToScan) (*hub.SnapshotSecurityReport, error)
Scan scans the provided package's snapshot for security vulnerabilities returning a report with the results.
type TrivyScanner ¶
type TrivyScanner struct {
// contains filtered or unexported fields
}
TrivyScanner is an ImageScanner implementation that uses Trivy to scan containers images for security vulnerabilities.