models

package
v0.0.0-...-6addaf6 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IMPACT_2_IMPACT_STRING = map[string]string{

	"VULN_RISK_UNKNOWN":  "UNKNOWN",
	"VULN_RISK_LOW":      "LOW",
	"VULN_RISK_MEDIUM":   "MEDIUM",
	"VULN_RISK_HIGH":     "HIGH",
	"VULN_RISK_CRITICAL": "CRITICAL",
}

Functions

This section is empty.

Types

type DepPackages

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

func (*DepPackages) AddPackage

func (p *DepPackages) AddPackage(pkg *Package)

func (*DepPackages) GetPackages

func (p *DepPackages) GetPackages() []*Package

type Manifest

type Manifest struct {
	// Filesystem path of this manifest
	Path string `json:"path"`

	// When we scan non-path entities like Github org / repo
	// then only path doesn't make sense, which is more local
	// temporary file path
	DisplayPath string `json:"display_path"`

	// Ecosystem to interpret this manifest
	Ecosystem string `json:"ecosystem"`
}

type Package

type Package struct {
	PackageDetails PackageDetails
	Manifest       *Manifest // Link to Manifest
	// contains filtered or unexported fields
}

Represents a package manifest that contains a list of packages. Example: pom.xml, requirements.txt

func NewPackage

func NewPackage(pd *PackageDetails, m *Manifest) *Package

func (*Package) AddExportedModules

func (p *Package) AddExportedModules(modules []string)

func (*Package) AddImportedModules

func (p *Package) AddImportedModules(modules []string)

func (*Package) AddScorecard

func (p *Package) AddScorecard(scorecard *insightapi.Scorecard)

func (*Package) AddVulnerabilities

func (p *Package) AddVulnerabilities(vulns *[]insightapi.PackageVulnerability)

func (*Package) GetExportedModules

func (p *Package) GetExportedModules() []string

func (*Package) GetImportedModules

func (p *Package) GetImportedModules() []string

func (*Package) GetMaxVulnScore

func (p *Package) GetMaxVulnScore() int

func (*Package) GetReverseScorecardScore

func (p *Package) GetReverseScorecardScore() float32

return 10-scorecard score

func (*Package) GetScorecardChecks

func (p *Package) GetScorecardChecks() []PkgScorecardCheck

func (*Package) GetScorecardScore

func (p *Package) GetScorecardScore() float32

func (*Package) GetVulns

func (p *Package) GetVulns() []PkgVuln

func (*Package) GetVulnsCount

func (p *Package) GetVulnsCount() int

type PackageDetails

type PackageDetails lockfile.PackageDetails

type PkgScorecardCheck

type PkgScorecardCheck struct {
	Name   string  `json:"name"`
	Score  float64 `json:"score"`
	Reason string  `json:"reason"`
}

type PkgVuln

type PkgVuln struct {
	Id              string                     `json:"id"`
	Cve             string                     `json:"cve"`
	Aliases         []string                   `json:"aliases"`
	Title           string                     `json:"title"`
	BaseSeverity    PkgVulnSeverity            `json:"severity"`
	OtherSeverities map[string]PkgVulnSeverity `json:"severities"`
}

type PkgVulnSeverity

type PkgVulnSeverity struct {
	Score  int    `json:"score"`
	Impact string `json:"impact"`
	Type   string `json:"type"`
	Vector string `json:"vector"`
}

Jump to

Keyboard shortcuts

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