Documentation ¶
Index ¶
Constants ¶
View Source
const ( ClassOSPkg = "os-pkgs" ClassLangPkg = "lang-pkgs" ClassConfig = "config" )
View Source
const (
SchemaVersion = 2
)
Variables ¶
View Source
var Now = time.Now
Now returns the current time
Functions ¶
Types ¶
type JSONWriter ¶ added in v0.13.0
JSONWriter implements result Writer
func (JSONWriter) Write ¶ added in v0.13.0
func (jw JSONWriter) Write(report Report) error
Write writes the results in JSON format
type Metadata ¶ added in v0.19.0
type Metadata struct { Size int64 `json:",omitempty"` OS *ftypes.OS `json:",omitempty"` // Container image ImageID string `json:",omitempty"` DiffIDs []string `json:",omitempty"` RepoTags []string `json:",omitempty"` RepoDigests []string `json:",omitempty"` ImageConfig v1.ConfigFile `json:",omitempty"` }
Metadata represents a metadata of artifact
type MisconfSummary ¶ added in v0.19.0
func (MisconfSummary) Empty ¶ added in v0.19.0
func (s MisconfSummary) Empty() bool
type Report ¶ added in v0.19.0
type Report struct { SchemaVersion int `json:",omitempty"` ArtifactName string `json:",omitempty"` ArtifactType ftypes.ArtifactType `json:",omitempty"` Metadata Metadata `json:",omitempty"` Results Results `json:",omitempty"` }
Report represents a scan result
type Result ¶
type Result struct { Target string `json:"Target"` Class ResultClass `json:"Class,omitempty"` Type string `json:"Type,omitempty"` Packages []ftypes.Package `json:"Packages,omitempty"` Vulnerabilities []types.DetectedVulnerability `json:"Vulnerabilities,omitempty"` MisconfSummary *MisconfSummary `json:"MisconfSummary,omitempty"` Misconfigurations []types.DetectedMisconfiguration `json:"Misconfigurations,omitempty"` }
Result holds a target and detected vulnerabilities
type ResultClass ¶ added in v0.19.0
type ResultClass string
type TableWriter ¶
type TableWriter struct { Severities []dbTypes.Severity Output io.Writer // For vulnerabilities Light bool // For misconfigurations IncludeNonFailures bool Trace bool }
TableWriter implements Writer and output in tabular form
func (TableWriter) Println ¶ added in v0.19.0
func (tw TableWriter) Println(a ...interface{})
func (TableWriter) Write ¶
func (tw TableWriter) Write(report Report) error
Write writes the result on standard output
type TemplateWriter ¶ added in v0.2.0
TemplateWriter write result in custom format defined by user's template
func NewTemplateWriter ¶ added in v0.11.0
func NewTemplateWriter(output io.Writer, outputTemplate string) (*TemplateWriter, error)
NewTemplateWriter is the factory method to return TemplateWriter object
func (TemplateWriter) Write ¶ added in v0.2.0
func (tw TemplateWriter) Write(report Report) error
Write writes result
Click to show internal directories.
Click to hide internal directories.