imagescan

package
v3.0.9 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package imagescan provides a service to scan images for vulnerabilities and helpers to set it up.

At the moment, the package uses Grype as the engine that scans images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExceedsSeverityThreshold

func ExceedsSeverityThreshold(scanResults *models.PresenterConfig, severity vulnerability.Severity) bool

ExceedsSeverityThreshold returns true if vulnerabilities in the scan results exceed the severity threshold, false otherwise.

Values equal to the threshold are considered failing, too.

func NewDefaultDBConfig

func NewDefaultDBConfig() (db.Config, bool)

func NewVulnerabilityDB

func NewVulnerabilityDB(cfg db.Config, update bool) (*store.Store, *db.Status, *db.Closer, error)

func ParseSeverity

func ParseSeverity(severity string) vulnerability.Severity

ParseSeverity returns a Grype severity given a severity string

Used as a thin wrapper for ease of access from one image scan package

Types

type RegistryCredentials

type RegistryCredentials struct {
	Username string
	Password string
}

func (RegistryCredentials) IsEmpty

func (c RegistryCredentials) IsEmpty() bool

type Service

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

Service is a facade for image scanning functionality.

It performs image scanning and everything needed in between.

func NewScanService

func NewScanService(dbCfg db.Config) Service

func (*Service) Scan

func (s *Service) Scan(ctx context.Context, userInput string, creds RegistryCredentials) (*models.PresenterConfig, error)

Jump to

Keyboard shortcuts

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