scanner

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAsyncAdapterRefreshRate = 20 * time.Second
)

Variables

View Source
var (
	ErrScanRequestIDNotFound       = errors.New("scanRequestID cannot be found")
	ErrVulnerabilityReportNotReady = errors.New("image is being scanned and report is still not ready")
)
View Source
var ErrInlineScanError = errors.New("error executing the inline scanner")

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	GetMetadata() (harbor.ScannerAdapterMetadata, error)
	Scan(req harbor.ScanRequest) (harbor.ScanResponse, error)
	GetVulnerabilityReport(scanResponseID harbor.ScanRequestID) (harbor.VulnerabilityReport, error)
}

func NewBackendAdapter

func NewBackendAdapter(client secure.Client) Adapter

func NewInlineAdapter

func NewInlineAdapter(secureClient secure.Client, k8sClient kubernetes.Interface, secureURL, namespace, secret, extraParams string, verifySSL bool, logger Logger) Adapter

type AsyncAdapter added in v0.6.0

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

AsyncAdapter is just a wrapper of the underlying real adapter (e.g. inlineAdapter) whose only goal is to make all the long-running operations non-blocking.

func NewAsyncAdapter added in v0.6.0

func NewAsyncAdapter(ctx context.Context, toWrap Adapter, logger Logger, refreshRate time.Duration) *AsyncAdapter

func (*AsyncAdapter) GetMetadata added in v0.6.0

func (a *AsyncAdapter) GetMetadata() (harbor.ScannerAdapterMetadata, error)

func (*AsyncAdapter) GetVulnerabilityReport added in v0.6.0

func (a *AsyncAdapter) GetVulnerabilityReport(scanID harbor.ScanRequestID) (harbor.VulnerabilityReport, error)

func (*AsyncAdapter) Scan added in v0.6.0

type BaseAdapter

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

func (*BaseAdapter) CreateScanResponse

func (b *BaseAdapter) CreateScanResponse(repository string, shaDigest string) harbor.ScanResponse

func (*BaseAdapter) DecodeScanResponseID

func (b *BaseAdapter) DecodeScanResponseID(scanResponseID harbor.ScanRequestID) (repository string, shaDigest string)

func (*BaseAdapter) GetMetadata

func (b *BaseAdapter) GetMetadata() (harbor.ScannerAdapterMetadata, error)

func (*BaseAdapter) ToHarborVulnerabilityReport

func (b *BaseAdapter) ToHarborVulnerabilityReport(repository string, shaDigest string, vulnerabilityReport *secure.VulnerabilityReport) (harbor.VulnerabilityReport, error)

type Logger added in v0.4.0

type Logger interface {
	Writer() *io.PipeWriter
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Warn(args ...interface{})
	Warnf(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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