types

package
v1.8.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ConfigVersion string = "1.0"

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 {
	Method   string  `json:"method,omitempty"`
	Severity string  `json:"severity,omitempty"`
	Score    float64 `json:"score,omitempty"`
	Vector   string  `json:"vector,omitempty"`
}

type Configuration

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

type Criteria

type Criteria struct {
	CPES          []string `json:"cpes,omitempty"`
	Constraint    string   `json:"constraint,omitempty"`
	Source        string   `json:"source,omitempty"`
	VersionFormat string   `json:"version_format,omitempty"`
	Scope         string   `json:"scope,omitempty"`
}

type Description

type Description struct {
	Source  string `json:"source,omitempty"`
	URL     string `json:"url,omitempty"`
	Content string `json:"content,omitempty"`
}

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 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 Reference

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

type Registry

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

type Remediation

type Remediation struct {
	Source string `json:"source,omitempty"`
	State  string `json:"state,omitempty"`
	Fix    string `json:"fix,omitempty"`
	Scope  string `json:"scope,omitempty"`
}

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"`
	CVE           string       `json:"cve,omitempty"`
	Package       string       `json:"package,omitempty"`
	Criteria      Criteria     `json:"criteria,omitempty"`
	CVSS          CVSS         `json:"cvss,omitempty"`
	Remediation   *Remediation `json:"remediation,omitempty"`
	Reference     Reference    `json:"references,omitempty"`
	Description   Description  `json:"descriptions,omitempty"`
}

Jump to

Keyboard shortcuts

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