core

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToolVendor = "khulnasoft-labs"
	ToolName   = "vul"
	Namespace  = ToolVendor + ":" + ToolName + ":"
)

Variables

This section is empty.

Functions

func IsVulSBOM

func IsVulSBOM(c *cdx.BOM) bool

func LookupProperty

func LookupProperty(properties *[]cdx.Property, key string) string

func UnmarshalProperties

func UnmarshalProperties(properties *[]cdx.Property) map[string]string

Types

type Component

type Component struct {
	Type       cdx.ComponentType
	Name       string
	Group      string
	Version    string
	PackageURL *purl.PackageURL
	Licenses   []string
	Hashes     []digest.Digest
	Supplier   string
	Properties []Property

	Components      []*Component
	Vulnerabilities []types.DetectedVulnerability
}

type CycloneDX

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

func NewCycloneDX

func NewCycloneDX(version string, opts ...Option) *CycloneDX

func (*CycloneDX) BOMRef

func (c *CycloneDX) BOMRef(component *Component) string

func (*CycloneDX) Components

func (c *CycloneDX) Components(uniq map[string]*cdx.Component) *[]cdx.Component

func (*CycloneDX) Dependencies

func (c *CycloneDX) Dependencies(uniq map[string]*[]string) *[]cdx.Dependency

func (*CycloneDX) Hashes

func (c *CycloneDX) Hashes(hashes []digest.Digest) *[]cdx.Hash

func (*CycloneDX) Licenses

func (c *CycloneDX) Licenses(licenses []string) *cdx.Licenses

func (*CycloneDX) Marshal

func (c *CycloneDX) Marshal(root *Component) *cdx.BOM

func (*CycloneDX) MarshalComponent

func (c *CycloneDX) MarshalComponent(component *Component, components map[string]*cdx.Component,
	deps map[string]*[]string, vulns map[string]*cdx.Vulnerability) *cdx.Component

func (*CycloneDX) Metadata

func (c *CycloneDX) Metadata() *cdx.Metadata

func (*CycloneDX) PackageURL

func (c *CycloneDX) PackageURL(purl *purl.PackageURL) string

func (*CycloneDX) Properties

func (c *CycloneDX) Properties(properties []Property) []cdx.Property

func (*CycloneDX) Supplier

func (c *CycloneDX) Supplier(supplier string) *cdx.OrganizationalEntity

func (*CycloneDX) Vulnerabilities

func (c *CycloneDX) Vulnerabilities(uniq map[string]*cdx.Vulnerability) *[]cdx.Vulnerability

type NewUUID

type NewUUID func() uuid.UUID

type Option

type Option func(dx *CycloneDX)

func WithClock

func WithClock(clock clock.Clock) Option

func WithNewUUID

func WithNewUUID(newUUID NewUUID) Option

type Property

type Property struct {
	Name      string
	Value     string
	Namespace string
}

Jump to

Keyboard shortcuts

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