imagescanner

package
v0.0.0-...-ddeca49 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success TrivyResult = "success"
	Error               = "error"
	Warning             = "warning"
	NoData              = "nodata"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CveDetails

type CveDetails struct {
	Id               string   `json:"id"`
	Package          string   `json:"packageName"`
	InstalledVersion string   `json:"installedVersion"`
	FixedVersion     string   `json:"fixedVersion"`
	Title            string   `json:"title"`
	Description      string   `json:"description"`
	Severity         string   `json:"severity"`
	References       []string `json:"references"`
	Images           []string `json:"imageTags"`
}

type ImageScanResult

type ImageScanResult struct {
	Image       string            `json:"image"`
	ScanResult  string            `json:"scanResult"`
	Description string            `json:"description"`
	Targets     []TrivyScanTarget `json:"targets"`
}

ImageScanResult contains details about all the found vulnerabilities

type ImageScanResultSummary

type ImageScanResultSummary struct {
	Image       string                 `json:"image"`
	ScanResult  string                 `json:"scanResult"`
	Description string                 `json:"description"`
	Counters    []VulnerabilityCounter `json:"counters"`
}

ImageScanResultSummary contains vulnerabilities summary

func (*ImageScanResultSummary) GetScansMessage

func (s *ImageScanResultSummary) GetScansMessage() string

func (*ImageScanResultSummary) GetSeverity

func (s *ImageScanResultSummary) GetSeverity() TrivyResult

type ImageScanner

type ImageScanner struct {
	ScannerURL string
}

ImageScanner base struct

func NewScanner

func NewScanner(url string) *ImageScanner

NewScanner returns a new image-scanner instance.

func (*ImageScanner) GetCve

func (s *ImageScanner) GetCve(id string) (details CveDetails, err error)

GetCve returns detailed cve description

func (*ImageScanner) GetCveSummary

func (s *ImageScanner) GetCveSummary() (details []CveDetails, err error)

GetCveSummary returns All known CVEs summary

func (*ImageScanner) GetScanResult

func (s *ImageScanner) GetScanResult(image string) (scanResult ImageScanResult, err error)

GetScanResult returns detailed single image scan result

func (*ImageScanner) GetScanResults

func (s *ImageScanner) GetScanResults(images []string) (scanResults []ImageScanResultSummary, err error)

GetScanResults returns scan result summary for an array of images

func (*ImageScanner) Scan

func (s *ImageScanner) Scan(images []string)

Scan all images

type TrivyResult

type TrivyResult string

type TrivyScanTarget

type TrivyScanTarget struct {
	Target          string                     `json:"Target"`
	Vulnerabilities []VulnerabilityDescription `json:"Vulnerabilities"`
}

type VulnerabilityCounter

type VulnerabilityCounter struct {
	Severity string `json:"severity"`
	Count    int    `json:"count"`
}

VulnerabilityCounter represents amount of issues with specified severity

type VulnerabilityDescription

type VulnerabilityDescription struct {
	CVE              string   `json:"VulnerabilityID"`
	Package          string   `json:"PkgName"`
	InstalledVersion string   `json:"InstalledVersion"`
	FixedVersion     string   `json:"FixedVersion"`
	Title            string   `json:"Title"`
	Description      string   `json:"Description"`
	Severity         string   `json:"Severity"`
	References       []string `json:"References"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳