types

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigVersion string = "1.0"
View Source
const Version int = 3

Variables

View Source
var Severities = []string{
	"unknown",
	"negligible",
	"low",
	"medium",
	"high",
	"critical",
}

Functions

func GetAllOutputFormat

func GetAllOutputFormat() string

func GetJoinedSeverities

func GetJoinedSeverities() string

func IsValidSeverity

func IsValidSeverity(severity string) bool

Types

type CIConfiguration

type CIConfiguration struct {
	FailCriteria FailCriteria `yaml:"failCriteria"`
}

type CVSS

type CVSS struct {
	Source              string  `json:"source"`
	Method              string  `json:"method"`
	Severity            string  `json:"severity"`
	Score               float64 `json:"score"`
	Vector              string  `json:"vector"`
	ExploitabilityScore float64 `json:"exploitability_score"`
}

CVSS : Common Vulnerability Scoring System

type Catalog added in v1.9.0

type Catalog struct {
	bun.BaseModel   `bun:"table:catalog,alias:c"`
	ID              int64  `json:"id" bun:"id,pk,autoincrement"`
	Source          string `json:"source,omitempty"`
	SchemaVersion   int    `json:"schema,omitempty"`
	Vulnerabilities int    `json:"vulnerabilities,omitempty"`
	UniqueCVECount  int    `json:"unique_cve_count,omitempty"`
	GeneratedAt     string `json:"generated_at,omitempty"`
}

Catalog : Metadata for the vulnerability database

type Configuration

type Configuration struct {
	Version     string          `yaml:"version"`
	MaxFileSize int64           `yaml:"maxFileSize"`
	Registry    Registry        `yaml:"registry"`
	CI          CIConfiguration `yaml:"ci"`
}

type EPSS added in v1.9.0

type EPSS struct {
	URL        string `json:"url,omitempty"`
	Score      string `json:"score,omitempty"`
	Percentile string `json:"percentile,omitempty"`
	Date       string `json:"date,omitempty"`
}

EPSS : Exploitability Prediction Scoring System

type Exploit added in v1.9.0

type Exploit struct {
	Source      string `json:"source"`
	URL         string `json:"url"`
	Description string `json:"description"`
}

Exploit : Proof of Concept (PoC) data or Exploit data

type FailCriteria

type FailCriteria struct {
	// TODO: Add logic to handle multiple vulnerability id as fail criteria
	Vulnerabilities []string `yaml:"vulnerability"`

	Severity string `yaml:"severity"`
}

TODO: Add more logic to handle multiple fail criteria

type Fix added in v1.9.0

type Fix struct {
	Source string `json:"source"`
	Value  string `json:"value"`
}

Fix : Available Remediation Data

type Format

type Format string
const (
	JSON         Format = "json"
	Table        Format = "table"
	SPDXJSON     Format = "spdx-json"
	SPDXXML      Format = "spdx-xml"
	SPDXTag      Format = "spdx-tag"
	SnapshotJSON Format = "snapshot-json"
)

func (Format) String

func (o Format) String() string

type Parameters

type Parameters struct {
	Quiet         bool
	Format        Format
	File          string
	CI            bool
	SkipDBUpdate  bool
	ForceDBUpdate bool

	// Diggity tool parameters to be passed to the scan engine
	Diggity diggity.Parameters
}

type Property added in v1.9.0

type Property struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Property : Additional metadata

type Reference

type Reference struct {
	Source string `json:"source"`
	URL    string `json:"url"`
}

type Registry

type Registry struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type ScanType

type ScanType int

type Vulnerability

type Vulnerability struct {
	bun.BaseModel `bun:"table:vulnerability,alias:v"`
	ID            int64       `json:"id" bun:"id,pk,autoincrement"`
	Package       string      `json:"package,omitempty"`
	CVE           string      `json:"cve,omitempty"`
	Source        string      `json:"source,omitempty"`
	Constraints   string      `json:"constraints,omitempty"`
	CPE           []string    `json:"cpes,omitempty"` // Common Platform Enumeration
	Distro        string      `json:"distro,omitempty"`
	Ecosystem     string      `json:"ecosystem,omitempty"` // Ecosystem is the package manager or the source of the package
	DistroVersion string      `json:"distro_version,omitempty"`
	Vendor        string      `json:"vendor,omitempty"`
	Qualifiers    string      `json:"qualifiers,omitempty"` // Purl Qualifiers determines the package is qualified for the match analysis based on the source
	Severity      string      `json:"severity,omitempty"`
	CVSS          []CVSS      `json:"cvss,omitempty"`
	EPSS          EPSS        `json:"epss,omitempty"`
	Description   string      `json:"description,omitempty"`
	References    []Reference `json:"references,omitempty"`
	Fixes         []string    `json:"fix,omitempty"` // Fix is the version that the package should be updated to
	Advisories    []string    `json:"advisories,omitempty"`
	Properties    []Property  `json:"properties,omitempty"`
}

Jump to

Keyboard shortcuts

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