cdxutils

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: Apache-2.0 Imports: 12 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddServiceToBomIfNotExists

func AddServiceToBomIfNotExists(bom *cyclonedx.BOM, service cyclonedx.Service)

func AppendProperties

func AppendProperties(properties *[]cyclonedx.Property, newProperties ...cyclonedx.Property) *[]cyclonedx.Property

AppendProperties appends new properties to the existing properties list and returns the updated list.

func AttachComponentAffects

func AttachComponentAffects(issue *cyclonedx.Vulnerability, affectedComponent cyclonedx.Component, affectsGenerator func(affectedComponent cyclonedx.Component) cyclonedx.Affects, relatedProperties ...cyclonedx.Property)

func AttachEvidenceOccurrenceToComponent

func AttachEvidenceOccurrenceToComponent(component *cyclonedx.Component, evidenceOccurrence cyclonedx.EvidenceOccurrence)

func AttachLicenseToComponent

func AttachLicenseToComponent(component *cyclonedx.Component, license cyclonedx.LicenseChoice)

func CreateBaseVulnerability

func CreateBaseVulnerability(params CdxVulnerabilityParams, properties ...cyclonedx.Property) cyclonedx.Vulnerability

func CreateFileOrDirComponent

func CreateFileOrDirComponent(filePathOrUri string) (component cyclonedx.Component)

func CreateScaImpactedAffects

func CreateScaImpactedAffects(impactedPackageComponent cyclonedx.Component, fixedVersions []string) (affect cyclonedx.Affects)

func Exclude

func Exclude(bom cyclonedx.BOM, componentsToExclude ...cyclonedx.Component) (filteredSbom *cyclonedx.BOM)

func GetDirectDependencies

func GetDirectDependencies(dependencies *[]cyclonedx.Dependency, ref string) []string

func GetFileRef

func GetFileRef(filePathOrUri string) string

func GetOrCreateScaIssue

func GetOrCreateScaIssue(destination *cyclonedx.BOM, params CdxVulnerabilityParams, properties ...cyclonedx.Property) (scaVulnerability *cyclonedx.Vulnerability)

Returns the index of the vulnerability in the BOM

func GetProperty

func GetProperty(properties *[]cyclonedx.Property, name string) *cyclonedx.Property

func GetRootDependenciesEntries

func GetRootDependenciesEntries(bom *cyclonedx.BOM, skipDefaultRoot bool) (roots []cyclonedx.Dependency)

func GetSerialNumber

func GetSerialNumber(id string) string

func HasImpactedAffects

func HasImpactedAffects(vulnerability cyclonedx.Vulnerability, affectedComponent cyclonedx.Component) bool

func SearchComponentByRef

func SearchComponentByRef(components *[]cyclonedx.Component, ref string) (component *cyclonedx.Component)

func SearchDependencyEntry

func SearchDependencyEntry(dependencies *[]cyclonedx.Dependency, ref string) *cyclonedx.Dependency

SearchDependencyEntry searches for a dependency entry by reference in the provided dependencies list.

func SearchForServiceByName

func SearchForServiceByName(bom *cyclonedx.BOM, serviceName string) *cyclonedx.Service

func SearchParents

func SearchParents(componentRef string, components []cyclonedx.Component, dependencies ...cyclonedx.Dependency) []cyclonedx.Component

func SearchVulnerabilityByRef

func SearchVulnerabilityByRef(destination *cyclonedx.BOM, ref string) *cyclonedx.Vulnerability

Types

type CdxVulnerabilityParams

type CdxVulnerabilityParams struct {
	Ref         string
	ID          string
	Details     string
	Description string
	Service     *cyclonedx.Service
	CWE         []string
	References  []string
	Ratings     []cyclonedx.VulnerabilityRating
}

type ComponentRelation

type ComponentRelation string
const (
	// Indicates that the component is a root component in the BOM
	RootRelation ComponentRelation = "root"
	// Indicates that the component is a direct dependency of another component
	DirectRelation ComponentRelation = "direct_dependency"
	// Indicates that the component is a transitive dependency of another component
	TransitiveRelation ComponentRelation = "transitive_dependency"
	// Undefined relation
	UnknownRelation ComponentRelation = ""
)

func GetComponentRelation

func GetComponentRelation(bom *cyclonedx.BOM, componentRef string, skipDefaultRoot bool) ComponentRelation

Jump to

Keyboard shortcuts

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