json

package
v0.2.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: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cvss

type Cvss struct {
	BaseScore           float64  `json:"baseScore"`
	ExploitabilityScore *float64 `json:"exploitabilityScore,omitempty"`
	ImpactScore         *float64 `json:"impactScore,omitempty"`
	Vector              string   `json:"vector"`
}

type Document

type Document struct {
	Matches   []Match         `json:"matches"`
	Image     *syftJson.Image `json:"image,omitempty"`
	Directory *string         `json:"directory,omitempty"`
}

Document represents the JSON document to be presented

func NewDocument

func NewDocument(catalog *pkg.Catalog, s scope.Scope, matches match.Matches, metadataProvider vulnerability.MetadataProvider) (Document, error)

NewDocument creates and populates a new Document struct, representing the populated JSON document.

type Match

type Match struct {
	Vulnerability Vulnerability     `json:"vulnerability"`
	MatchDetails  MatchDetails      `json:"matchDetails"`
	Artifact      syftJson.Artifact `json:"artifact"`
}

Match is a single item for the JSON array reported

type MatchDetails

type MatchDetails struct {
	Matcher   string                 `json:"matcher"`
	SearchKey map[string]interface{} `json:"searchKey"`
	MatchInfo map[string]interface{} `json:"matchedOn"`
}

MatchDetails contains all data that indicates how the result match was found

type Presenter

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

Presenter is a generic struct for holding fields needed for reporting

func NewPresenter

func NewPresenter(matches match.Matches, catalog *pkg.Catalog, theScope scope.Scope, metadataProvider vulnerability.MetadataProvider) *Presenter

NewPresenter is a *Presenter constructor

func (*Presenter) Present

func (pres *Presenter) Present(output io.Writer) error

Present creates a JSON-based reporting

type Vulnerability

type Vulnerability struct {
	ID             string   `json:"id"`
	Severity       string   `json:"severity,omitempty"`
	Links          []string `json:"links,omitempty"`
	Description    string   `json:"description,omitempty"`
	CvssV2         *Cvss    `json:"cvssV2,omitempty"`
	CvssV3         *Cvss    `json:"cvssV3,omitempty"`
	FixedInVersion string   `json:"fixedInVersion,omitempty"`
}

func NewVulnerability

func NewVulnerability(m match.Match, metadata *vulnerability.Metadata) Vulnerability

Jump to

Keyboard shortcuts

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