sbomtest

package
v0.0.0-...-a2830fa Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 17 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"`
}

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