scanner

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrImageNotFound = errors.New("image not found")

ErrImageNotFound represents that the image provided was not found in the repository.

Functions

func ScanSnapshot

func ScanSnapshot(
	ctx context.Context,
	scanner Scanner,
	snapshot *hub.SnapshotToScan,
) (*hub.SnapshotSecurityReport, error)

ScanSnapshot scans the provided package's snapshot for security vulnerabilities returning a report with the results.

Types

type Mock

type Mock struct {
	mock.Mock
}

Mock is a mock implementation of the Scanner interface.

func (*Mock) Scan

func (m *Mock) Scan(image string) ([]byte, error)

Scan implements the Scanner interface.

type Scanner

type Scanner interface {
	Scan(image string) ([]byte, error)
}

Scanner describes the methods a Scanner implementation must provide.

type Target

type Target struct {
	Vulnerabilities []*Vulnerability `json:"Vulnerabilities"`
}

Target represents a target in a security report.

type TrivyScanner

type TrivyScanner struct {
	Ctx context.Context
	URL string
}

TrivyScanner is an implementation of the Scanner interface that uses Trivy.

func (*TrivyScanner) Scan

func (s *TrivyScanner) Scan(image string) ([]byte, error)

Scan implements the Scanner interface.

type Vulnerability

type Vulnerability struct {
	Severity string `json:"Severity"`
}

Vulnerability represents a vulnerability in a security report target.

Jump to

Keyboard shortcuts

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