sbomtest

package
v0.0.0-...-dfd0c74 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MIMETypeJSON = "application/json"
	MIMETypeText = "text/plain"
)

Variables

View Source
var WorkflowID = workflow.NewWorkflowIdentifier("sbom.test")

Functions

func BuildTestSummary

func BuildTestSummary(resultsSummary *snykclient.SBOMTestSummary) (data []byte, contentType string, err error)

func IsSBOMJSON

func IsSBOMJSON(b []byte) bool

func ReadSBOMFile

func ReadSBOMFile(filename string, errFactory *errors.ErrorFactory) ([]byte, error)

func RegisterWorkflows

func RegisterWorkflows(e workflow.Engine) error

func RenderJSONResult

func RenderJSONResult(w io.Writer, res *snykclient.SBOMTestResult) error

func RenderPrettyResult

func RenderPrettyResult(w io.Writer, orgID, filepath string, res *snykclient.SBOMTestResult) error

func TestWorkflow

func TestWorkflow(
	ictx workflow.InvocationContext,
	_ []workflow.Data,
) ([]workflow.Data, error)

Types

type Identifier

type Identifier struct {
	CVE []string `json:"CVE,omitempty"`
	CWE []string `json:"CWE,omitempty"`
}

type JSONOutput

type JSONOutput struct {
	OK              bool            `json:"ok"`
	DependencyCount int             `json:"dependencyCount"`
	Summary         string          `json:"summary"`
	Remediation     interface{}     `json:"remediation,omitempty"`
	Filtered        interface{}     `json:"filtered,omitempty"`
	Vulnerabilities []Vulnerability `json:"vulnerabilities"`
	LicenseIssues   []LicenseIssue  `json:"license_issues"`
}

type LicenseIssue

type LicenseIssue struct {
	ID          string           `json:"id,omitempty"`
	Name        string           `json:"name,omitempty"`
	PackageName string           `json:"packageName,omitempty"`
	Version     string           `json:"version,omitempty"`
	Title       string           `json:"title,omitempty"`
	Severity    severities.Level `json:"severity,omitempty"`
}

type SemVer

type SemVer struct {
	Vulnerable []string `json:"vulnerable,omitempty"`
}

type Vulnerability

type Vulnerability struct {
	CreationTime         time.Time        `json:"creationTime,omitempty"`
	DisclosureTime       time.Time        `json:"disclosureTime,omitempty"`
	Exploit              string           `json:"exploit,omitempty"`
	ID                   string           `json:"id,omitempty"`
	Identifiers          Identifier       `json:"identifiers,omitempty"`
	ModificationTime     time.Time        `json:"modificationTime,omitempty"`
	PackageName          string           `json:"packageName,omitempty"`
	PublicationTime      time.Time        `json:"publicationTime,omitempty"`
	SemVer               SemVer           `json:"semver,omitempty"`
	Severity             severities.Level `json:"severity,omitempty"`
	SeverityWithCritical severities.Level `json:"severityWithCritical,omitempty"`
	Title                string           `json:"title,omitempty"`
	Version              string           `json:"version,omitempty"`
	Name                 string           `json:"name,omitempty"`
	CVSSv3               string           `json:"CVSSv3,omitempty"`
	CVSSScore            float64          `json:"cvssScore,omitempty"`
}

Jump to

Keyboard shortcuts

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