Documentation
¶
Overview ¶
Package sbom provides core SBOM (Software Bill of Materials) parsing, processing, and manipulation functionality for handling SPDX and CycloneDX format documents.
Index ¶
- Variables
- func CleanKey(key string) string
- func SupportedPrimaryPurpose(f string) []string
- func SupportedSBOMFileFormats(f string) []string
- func SupportedSBOMSpecVersions(f string) []string
- func SupportedSBOMSpecs() []string
- type Author
- type CdxDoc
- func (c CdxDoc) Authors() []GetAuthor
- func (c CdxDoc) Components() []GetComponent
- func (c CdxDoc) Composition() []GetComposition
- func (c CdxDoc) Files() []GetComponent
- func (c CdxDoc) GetDirectDependencies(compID string, relTypes ...string) []GetComponent
- func (c CdxDoc) GetOutgoingRelations(compID string) []GetRelationship
- func (c CdxDoc) GetRelationships() []GetRelationship
- func (c CdxDoc) Lifecycles() []string
- func (c CdxDoc) Logs() []string
- func (c CdxDoc) Manufacturer() GetManufacturer
- func (c CdxDoc) PrimaryComp() GetPrimaryComponentInfo
- func (c CdxDoc) SchemaValidation() bool
- func (c CdxDoc) Signature() GetSignature
- func (c CdxDoc) Spec() Spec
- func (c CdxDoc) Supplier() GetSupplier
- func (c CdxDoc) Tools() []GetTool
- func (c CdxDoc) Vulnerabilities() []GetVulnerabilities
- type Checksum
- type Component
- func (c Component) Authors() []GetAuthor
- func (c Component) ConcludedLicenses() []licenses.License
- func (c Component) CountOfDependencies() int
- func (c Component) DeclaredLicenses() []licenses.License
- func (c Component) Deps() []string
- func (c Component) ExternalReferences() []GetExternalReference
- func (c Component) GetChecksums() []GetChecksum
- func (c Component) GetCopyRight() string
- func (c Component) GetCpes() []cpe.CPE
- func (c Component) GetDownloadLocationURL() string
- func (c Component) GetFileAnalyzed() bool
- func (c Component) GetFilename() string
- func (c Component) GetID() string
- func (c Component) GetLicenses() []licenses.License
- func (c Component) GetName() string
- func (c Component) GetPackageLicenseConcluded() string
- func (c Component) GetPackageLicenseDeclared() string
- func (c Component) GetProperties() []ComponentProperty
- func (c Component) GetPropertyValue(name string) string
- func (c Component) GetPurls() []purl.PURL
- func (c Component) GetSourceCodeURL() string
- func (c Component) GetSpdxID() string
- func (c Component) GetVersion() string
- func (c Component) HasRelationShips() bool
- func (c Component) IsPrimaryComponent() bool
- func (c Component) Manufacturer() GetManufacturer
- func (c Component) OmniborIDs() []omniborid.OMNIBORID
- func (c Component) PrimaryPurpose() string
- func (c Component) RelationShipState() string
- func (c Component) RequiredFields() bool
- func (c Component) SourceCodeHash() string
- func (c Component) Suppliers() GetSupplier
- func (c Component) Swhids() []swhid.SWHID
- func (c Component) Swids() []swid.SWID
- type ComponentProperty
- type Composition
- func (c Composition) Aggregate() CompositionAggregate
- func (c Composition) Assemblies() []string
- func (c Composition) Dependencies() []string
- func (c Composition) ID() string
- func (c Composition) IsSBOMComplete() bool
- func (c Composition) Scope() CompositionScope
- func (c Composition) Vulnerabilities() []string
- type CompositionAggregate
- type CompositionScope
- type Contact
- type Document
- type ExternalReference
- type FileFormat
- type FormatVersion
- type GetAuthor
- type GetChecksum
- type GetComponent
- type GetComposition
- type GetContact
- type GetExternalReference
- type GetManufacturer
- type GetPrimaryComponentInfo
- type GetRelationship
- type GetSignature
- type GetSupplier
- type GetTool
- type GetVulnerabilities
- type Manufacturer
- type PrimaryComponentInfo
- type Relationship
- type Signature
- type SpdxDoc
- func (s SpdxDoc) Authors() []GetAuthor
- func (s SpdxDoc) Components() []GetComponent
- func (s SpdxDoc) Composition() []GetComposition
- func (s SpdxDoc) Files() []GetComponent
- func (s SpdxDoc) GetDirectDependencies(compID string, relTypes ...string) []GetComponent
- func (s SpdxDoc) GetOutgoingRelations(compID string) []GetRelationship
- func (s SpdxDoc) GetRelationships() []GetRelationship
- func (s SpdxDoc) Lifecycles() []string
- func (s SpdxDoc) Logs() []string
- func (s SpdxDoc) Manufacturer() GetManufacturer
- func (s SpdxDoc) PrimaryComp() GetPrimaryComponentInfo
- func (s SpdxDoc) SchemaValidation() bool
- func (s SpdxDoc) Signature() GetSignature
- func (s SpdxDoc) Spec() Spec
- func (s SpdxDoc) Supplier() GetSupplier
- func (s SpdxDoc) Tools() []GetTool
- func (s SpdxDoc) Vulnerabilities() []GetVulnerabilities
- type Spec
- type SpecFormat
- type Specs
- func (s Specs) FileFormat() string
- func (s Specs) GetComment() string
- func (s Specs) GetCreationTimestamp() string
- func (s Specs) GetExtDocRef() []string
- func (s Specs) GetLicenses() []licenses.License
- func (s Specs) GetName() string
- func (s Specs) GetNamespace() string
- func (s Specs) GetOrganization() string
- func (s Specs) GetSpdxID() string
- func (s Specs) GetSpecType() string
- func (s Specs) GetURI() string
- func (s Specs) GetVersion() string
- func (s Specs) Parsable() bool
- func (s Specs) RequiredFields() bool
- type Supplier
- type Tool
- type Vulnerability
Constants ¶
This section is empty.
Variables ¶
var (
CdxSupportedLifecycle = []string{"design", "pre-build", "build", "post-build", "operations", "discovery", "decommission"}
)
Functions ¶
func SupportedPrimaryPurpose ¶
SupportedPrimaryPurpose returns a list of supported primary purpose values for the given SBOM specification
func SupportedSBOMFileFormats ¶
SupportedSBOMFileFormats returns a list of supported file formats for the given SBOM specification
func SupportedSBOMSpecVersions ¶
SupportedSBOMSpecVersions returns a list of supported versions for the given SBOM specification format
func SupportedSBOMSpecs ¶
func SupportedSBOMSpecs() []string
SupportedSBOMSpecs returns a list of all supported SBOM specification formats
Types ¶
type Author ¶
Author represents a concrete implementation of author information
type CdxDoc ¶
type CdxDoc struct {
CdxSpec *Specs
Comps []GetComponent
CdxAuthors []GetAuthor
CdxTools []GetTool
Relationships []GetRelationship
Lifecycle []string
CdxSupplier GetSupplier
CdxManufacturer GetManufacturer
Compositions []GetComposition
PrimaryComponent PrimaryComponentInfo
Vuln []GetVulnerabilities
SignatureDetail GetSignature
// contains filtered or unexported fields
}
func (CdxDoc) Components ¶
func (c CdxDoc) Components() []GetComponent
func (CdxDoc) Composition ¶ added in v2.0.3
func (c CdxDoc) Composition() []GetComposition
func (CdxDoc) Files ¶ added in v2.0.7
func (c CdxDoc) Files() []GetComponent
Files returns all files defined in the SBOM (SPDX-specific, empty for CycloneDX)
func (CdxDoc) GetDirectDependencies ¶ added in v2.0.4
func (c CdxDoc) GetDirectDependencies(compID string, relTypes ...string) []GetComponent
func (CdxDoc) GetOutgoingRelations ¶ added in v2.0.4
func (c CdxDoc) GetOutgoingRelations(compID string) []GetRelationship
func (CdxDoc) GetRelationships ¶
func (c CdxDoc) GetRelationships() []GetRelationship
func (CdxDoc) Lifecycles ¶
func (CdxDoc) Manufacturer ¶
func (c CdxDoc) Manufacturer() GetManufacturer
func (CdxDoc) PrimaryComp ¶
func (c CdxDoc) PrimaryComp() GetPrimaryComponentInfo
func (CdxDoc) SchemaValidation ¶
func (CdxDoc) Signature ¶
func (c CdxDoc) Signature() GetSignature
func (CdxDoc) Supplier ¶
func (c CdxDoc) Supplier() GetSupplier
func (CdxDoc) Vulnerabilities ¶
func (c CdxDoc) Vulnerabilities() []GetVulnerabilities
type Checksum ¶
Checksum represents a concrete implementation of cryptographic checksum information
func (Checksum) GetContent ¶
GetContent returns the hexadecimal checksum value
type Component ¶
type Component struct {
Name string
Version string
Cpes []cpe.CPE
Purls []purl.PURL
Swhid []swhid.SWHID
OmniID []omniborid.OMNIBORID
Swid []swid.SWID
Licenses []licenses.License
DeclaredLicense []licenses.License
ConcludedLicense []licenses.License
Checksums []GetChecksum
Purpose string
ID string
Athrs []GetAuthor
Supplier Supplier
Manufacture Manufacturer
Count int
Dep []string
SourceCodeURL string
DownloadLocation string
HasRelationships bool
RelationshipState string
Spdxid string
FileAnalyzed bool
CopyRight string
PackageLicenseConcluded string
PackageLicenseDeclared string
ExternalRefs []GetExternalReference
Props []ComponentProperty
PackageFilename string
// contains filtered or unexported fields
}
Component represents a concrete implementation of SBOM component information and metadata
func NewComponent ¶
func NewComponent() *Component
NewComponent creates a new instance of Component with default values
func (Component) ConcludedLicenses ¶
ConcludedLicenses returns the concluded licenses for the component
func (Component) CountOfDependencies ¶
CountOfDependencies returns the number of dependencies for the component
func (Component) DeclaredLicenses ¶
DeclaredLicenses returns the explicitly declared licenses for the component
func (Component) Deps ¶ added in v2.0.2
Deps returns the list of dependency identifiers for the component
func (Component) ExternalReferences ¶
func (c Component) ExternalReferences() []GetExternalReference
ExternalReferences returns external references associated with the component
func (Component) GetChecksums ¶
func (c Component) GetChecksums() []GetChecksum
GetChecksums returns the cryptographic checksums for the component
func (Component) GetCopyRight ¶
GetCopyRight returns the copyright information for the component
func (Component) GetCpes ¶
GetCpes returns the Common Platform Enumeration identifiers for the component
func (Component) GetDownloadLocationURL ¶
GetDownloadLocationURL returns the download location URL for the component
func (Component) GetFileAnalyzed ¶
GetFileAnalyzed returns whether files in the component have been analyzed
func (Component) GetFilename ¶ added in v2.0.5
GetFilename returns the filename of the component. For SPDX this is PackageFileName (section 7.13); for CDX it is the bsi:component:filename property.
func (Component) GetLicenses ¶
GetLicenses returns all licenses associated with the component
func (Component) GetPackageLicenseConcluded ¶
GetPackageLicenseConcluded returns the concluded license string for the package
func (Component) GetPackageLicenseDeclared ¶
GetPackageLicenseDeclared returns the declared license string for the package
func (Component) GetProperties ¶ added in v2.0.5
func (c Component) GetProperties() []ComponentProperty
GetProperties returns all component properties as key-value pairs
func (Component) GetPropertyValue ¶ added in v2.0.5
GetPropertyValue returns the value of a component property by name, or empty string if not found
func (Component) GetSourceCodeURL ¶
GetSourceCodeURL returns the source code repository URL for the component
func (Component) GetVersion ¶
GetVersion returns the version of the component
func (Component) HasRelationShips ¶
HasRelationShips returns whether the component has defined relationships
func (Component) IsPrimaryComponent ¶
IsPrimaryComponent returns whether this component is the primary component in the SBOM
func (Component) Manufacturer ¶
func (c Component) Manufacturer() GetManufacturer
Manufacturer returns the manufacturer information for the component
func (Component) OmniborIDs ¶
OmniborIDs returns the OmniBOR identifiers for the component
func (Component) PrimaryPurpose ¶
PrimaryPurpose returns the primary purpose classification of the component
func (Component) RelationShipState ¶
RelationShipState returns the state of relationships for the component
func (Component) RequiredFields ¶
RequiredFields returns whether all required fields are present for the component
func (Component) SourceCodeHash ¶
SourceCodeHash returns the hash of the source code for the component
func (Component) Suppliers ¶
func (c Component) Suppliers() GetSupplier
Suppliers returns the supplier information for the component
type ComponentProperty ¶ added in v2.0.5
ComponentProperty represents a key-value property on a component
type Composition ¶ added in v2.0.3
type Composition struct {
// contains filtered or unexported fields
}
func NewComposition ¶ added in v2.0.3
func NewComposition(id string, scope CompositionScope, aggregate CompositionAggregate, deps []string, assemblies []string, vulns []string, ) Composition
NewComposition constructs a Composition instance.
func (Composition) Aggregate ¶ added in v2.0.3
func (c Composition) Aggregate() CompositionAggregate
Aggregate returns the declared level of completeness.
func (Composition) Assemblies ¶ added in v2.0.3
func (c Composition) Assemblies() []string
Assemblies returns the component IDs whose internal assemblies (bundled or shaded components) are covered by this composition.
func (Composition) Dependencies ¶ added in v2.0.3
func (c Composition) Dependencies() []string
Dependencies returns the component IDs whose dependency graphs are covered by this composition.
func (Composition) ID ¶ added in v2.0.3
func (c Composition) ID() string
ID returns the unique identifier of the composition itself. Ex. bom-ref
func (Composition) IsSBOMComplete ¶ added in v2.0.3
func (c Composition) IsSBOMComplete() bool
IsSBOMComplete returns true if this composition explicitly declares the entire SBOM as complete.
func (Composition) Scope ¶ added in v2.0.3
func (c Composition) Scope() CompositionScope
Scope returns the dimension this composition applies to (e.g. dependencies, assemblies, vulnerabilities, or global).
func (Composition) Vulnerabilities ¶ added in v2.0.3
func (c Composition) Vulnerabilities() []string
Vulnerabilities returns the vulnerability IDs covered by this composition.
type CompositionAggregate ¶ added in v2.0.3
type CompositionAggregate string
CompositionAggregate defines the *declared level of completeness* for a given composition scope.
const ( // AggregateComplete indicates the producer asserts that // nothing relevant is missing for the given scope. AggregateComplete CompositionAggregate = "complete" // AggregateIncomplete indicates the producer knows that // some information is missing for the given scope. AggregateIncomplete CompositionAggregate = "incomplete" // AggregateUnknown indicates the producer cannot assert // whether the information is complete or not. AggregateUnknown CompositionAggregate = "unknown" // AggregateMissing indicates no completeness assertion // is provided for the given scope. AggregateMissing CompositionAggregate = "missing" // AggregateIncompleteFirstPartyOnly indicates completeness // is asserted only for first-party components, not third-party AggregateIncompleteFirstPartyOnly CompositionAggregate = "incomplete_first_party_only" )
type CompositionScope ¶ added in v2.0.3
type CompositionScope string
CompositionScope defines *what aspect* of completeness is being declared. It indicates which dimension of the SBOM the composition applies to.
const ( // ScopeAssemblies applies to bundled / shaded components inside another component. ScopeAssemblies CompositionScope = "assemblies" // ScopeDependencies applies to the dependency graph of a component. ScopeDependencies CompositionScope = "dependencies" // ScopeVulnerabilities applies to vulnerability coverage completeness. ScopeVulnerabilities CompositionScope = "vulnerabilities" // ScopeGlobal applies to the entire SBOM. // This is a derived scope when no specific dimension is declared. ScopeGlobal CompositionScope = "global" )
type Contact ¶
Contact represents a concrete implementation of contact information
type Document ¶
type Document interface {
// Spec returns the SBOM specification information
Spec() Spec
// SchemaValidation returns whether the SBOM passes schema validation
SchemaValidation() bool
// Components returns all components defined in the SBOM
Components() []GetComponent
// Files returns all files defined in the SBOM (SPDX-specific)
Files() []GetComponent
// Authors returns the authors of the SBOM
Authors() []GetAuthor
// Tools returns the tools used to create the SBOM
Tools() []GetTool
// Logs returns any log messages associated with the SBOM processing
Logs() []string
// Lifecycles returns the lifecycle phases represented in the SBOM
Lifecycles() []string
// Manufacturer returns the manufacturer information for the SBOM
Manufacturer() GetManufacturer
// Supplier returns the supplier information for the SBOM
Supplier() GetSupplier
// PrimaryComp returns information about the primary component in the SBOM
PrimaryComp() GetPrimaryComponentInfo
// Raw relationship graph
GetRelationships() []GetRelationship
// Represents all outgoing relationships for a given component
GetOutgoingRelations(compID string) []GetRelationship
// Dependency helpers (semantic, but generic)
GetDirectDependencies(compID string, relTypes ...string) []GetComponent
// Vulnerabilities returns all vulnerabilities defined in the SBOM
Vulnerabilities() []GetVulnerabilities
// Signature returns the cryptographic signature information for the SBOM
Signature() GetSignature
Composition() []GetComposition
}
Document defines the interface for accessing SBOM document information, components, and metadata
func NewSBOMDocument ¶
NewSBOMDocument creates a new SBOM document from the provided reader, automatically detecting the format and specification
type ExternalReference ¶
type ExternalReference struct {
RefType string
RefLocator string
RefHashes []GetChecksum
}
ExternalReference represents a concrete implementation of external reference information
func (ExternalReference) GetRefHashes ¶ added in v2.0.5
func (e ExternalReference) GetRefHashes() []GetChecksum
GetRefHashes returns the cryptographic hashes associated with the external reference
func (ExternalReference) GetRefLocator ¶
func (e ExternalReference) GetRefLocator() string
GetRefLocator returns the locator/URL of the external reference
func (ExternalReference) GetRefType ¶
func (e ExternalReference) GetRefType() string
GetRefType returns the type of the external reference (e.g., website, vcs, etc.)
type FileFormat ¶
type FileFormat string
FileFormat represents the file encoding format of an SBOM (JSON, XML, YAML, etc.)
const ( // FileFormatJSON represents JSON file format FileFormatJSON FileFormat = "json" // FileFormatRDF represents RDF file format FileFormatRDF FileFormat = "rdf" // FileFormatYAML represents YAML file format FileFormatYAML FileFormat = "yaml" // FileFormatTagValue represents SPDX tag-value file format FileFormatTagValue FileFormat = "tag-value" // FileFormatXML represents XML file format FileFormatXML FileFormat = "xml" // FileFormatUnknown represents an unknown or unsupported file format FileFormatUnknown FileFormat = "unknown" )
type FormatVersion ¶
type FormatVersion string
FormatVersion represents the version string of an SBOM specification
type GetAuthor ¶
type GetAuthor interface {
// GetName returns the name of the author
GetName() string
// GetType returns the type of author (person or organization)
GetType() string
// GetEmail returns the email address of the author
GetEmail() string
// GetPhone returns the phone number of the author
GetPhone() string
}
GetAuthor defines the interface for accessing author information in SBOMs
type GetChecksum ¶
type GetChecksum interface {
// GetAlgo returns the cryptographic algorithm used for the checksum
GetAlgo() string
// GetContent returns the hexadecimal checksum value
GetContent() string
}
GetChecksum defines the interface for accessing cryptographic checksum information
type GetComponent ¶
type GetComponent interface {
// GetID returns the unique identifier of the component
GetID() string
// GetName returns the name of the component
GetName() string
// GetVersion returns the version of the component
GetVersion() string
// GetCpes returns the Common Platform Enumeration identifiers for the component
GetCpes() []cpe.CPE
// GetPurls returns the Package URL identifiers for the component
GetPurls() []purl.PURL
// Swhids returns the Software Heritage identifiers for the component
Swhids() []swhid.SWHID
// OmniborIDs returns the OmniBOR identifiers for the component
OmniborIDs() []omniborid.OMNIBORID
// Swids returns the Software Identification tags for the component
Swids() []swid.SWID
// GetLicenses returns all licenses associated with the component
GetLicenses() []licenses.License
// DeclaredLicenses returns the explicitly declared licenses for the component
DeclaredLicenses() []licenses.License
// ConcludedLicenses returns the concluded licenses for the component
ConcludedLicenses() []licenses.License
// GetChecksums returns the cryptographic checksums for the component
GetChecksums() []GetChecksum
// PrimaryPurpose returns the primary purpose classification of the component
PrimaryPurpose() string
// RequiredFields returns whether all required fields are present for the component
RequiredFields() bool
// Suppliers returns the supplier information for the component
Suppliers() GetSupplier
// Authors returns the author information for the component
Authors() []GetAuthor
// Manufacturer returns the manufacturer information for the component
Manufacturer() GetManufacturer
// CountOfDependencies returns the number of dependencies for the component
CountOfDependencies() int
// Deps returns the list of dependency identifiers for the component
Deps() []string
// GetSourceCodeURL returns the source code repository URL for the component
GetSourceCodeURL() string
// GetDownloadLocationURL returns the download location URL for the component
GetDownloadLocationURL() string
// SourceCodeHash returns the hash of the source code for the component
SourceCodeHash() string
// IsPrimaryComponent returns whether this component is the primary component in the SBOM
IsPrimaryComponent() bool
// HasRelationShips returns whether the component has defined relationships
HasRelationShips() bool
// RelationShipState returns the state of relationships for the component
RelationShipState() string
// GetSpdxID returns the SPDX identifier for the component
GetSpdxID() string
// GetFileAnalyzed returns whether files in the component have been analyzed
GetFileAnalyzed() bool
// GetCopyRight returns the copyright information for the component
GetCopyRight() string
// GetPackageLicenseDeclared returns the declared license string for the package
GetPackageLicenseDeclared() string
// GetPackageLicenseConcluded returns the concluded license string for the package
GetPackageLicenseConcluded() string
// ExternalReferences returns external references associated with the component
ExternalReferences() []GetExternalReference
// GetPropertyValue returns the value of a component property by name, or empty string if not found
GetPropertyValue(name string) string
// GetProperties returns all component properties as key-value pairs
GetProperties() []ComponentProperty
// GetFilename returns the filename of the component (PackageFileName in SPDX, bsi:component:filename in CDX)
GetFilename() string
}
GetComponent defines the interface for accessing SBOM component information and metadata
type GetComposition ¶ added in v2.0.3
type GetComposition interface {
ID() string
Aggregate() CompositionAggregate
Scope() CompositionScope
IsSBOMComplete() bool
Dependencies() []string
Assemblies() []string
Vulnerabilities() []string
}
GetComposition represents a producer-declared completeness assertion for a specific dimension of an SBOM.
type GetContact ¶
type GetContact interface {
// GetName returns the name of the contact
GetName() string
// GetEmail returns the email address of the contact
GetEmail() string
// GetPhone returns the phone number of the contact
GetPhone() string
}
GetContact defines the interface for accessing contact information in SBOMs
type GetExternalReference ¶
type GetExternalReference interface {
// GetRefType returns the type of the external reference (e.g., website, vcs, etc.)
GetRefType() string
// GetRefLocator returns the locator/URL of the external reference
GetRefLocator() string
// GetRefHashes returns the cryptographic hashes associated with the external reference
GetRefHashes() []GetChecksum
}
GetExternalReference defines the interface for accessing external reference information in SBOMs
type GetManufacturer ¶
type GetManufacturer interface {
// GetName returns the name of the manufacturer
GetName() string
// GetURL returns the website URL of the manufacturer
GetURL() string
// GetEmail returns the email address of the manufacturer
GetEmail() string
// GetContacts returns the contact information for the manufacturer
GetContacts() []Contact
// IsAbsent returns whether manufacturer information is available
IsAbsent() bool
}
GetManufacturer defines the interface for accessing manufacturer information in SBOMs
type GetPrimaryComponentInfo ¶ added in v2.0.4
type GetPrimaryComponentInfo interface {
// GetID returns the unique identifier of the primary component
GetID() string
// GetName returns the name of the primary component
GetName() string
// GetVersion returns the version of the primary component
GetVersion() string
// GetType returns the type of the primary component
GetType() string
// IsPresent returns whether primary component information is available
IsPresent() bool
Component() GetComponent
}
type GetRelationship ¶ added in v2.0.4
type GetSignature ¶
type GetSignature interface {
// GetAlgorithm returns the signature algorithm (e.g., RS256, ES256)
GetAlgorithm() string
// GetKeyID returns the key identifier
GetKeyID() string
// GetSigValue returns the cryptographic signature value
GetSigValue() string
// GetPublicKey returns the public key used for signature verification
GetPublicKey() string
// GetCertificatePath returns the certificate chain path
GetCertificatePath() []string
// GetExcludes returns the list of properties excluded from signing
GetExcludes() []string
}
GetSignature defines the interface for accessing cryptographic signature information in SBOMs
type GetSupplier ¶
type GetSupplier interface {
// GetName returns the name of the supplier
GetName() string
// GetEmail returns the email address of the supplier
GetEmail() string
// GetURL returns the website URL of the supplier
GetURL() string
// GetContacts returns the contact information for the supplier
GetContacts() []Contact
// IsAbsent returns whether supplier information is available
IsAbsent() bool
}
GetSupplier defines the interface for accessing supplier information in SBOMs
type GetTool ¶
type GetTool interface {
// GetName returns the name of the tool
GetName() string
// GetVersion returns the version of the tool
GetVersion() string
}
GetTool defines the interface for accessing tool information used in SBOM creation
type GetVulnerabilities ¶
type GetVulnerabilities interface {
// GetID returns the unique identifier of the vulnerability (e.g., CVE ID)
GetID() string
}
GetVulnerabilities defines the interface for accessing vulnerability information in SBOMs
type Manufacturer ¶
Manufacturer represents a concrete implementation of manufacturer information
func (Manufacturer) GetContacts ¶
func (m Manufacturer) GetContacts() []Contact
GetContacts returns the contact information for the manufacturer
func (Manufacturer) GetEmail ¶
func (m Manufacturer) GetEmail() string
GetEmail returns the email address of the manufacturer
func (Manufacturer) GetName ¶
func (m Manufacturer) GetName() string
GetName returns the name of the manufacturer
func (Manufacturer) GetURL ¶
func (m Manufacturer) GetURL() string
GetURL returns the website URL of the manufacturer
func (Manufacturer) IsAbsent ¶ added in v2.0.5
func (m Manufacturer) IsAbsent() bool
IsAbsent returns whether manufacturer information is available
type PrimaryComponentInfo ¶ added in v2.0.4
PrimaryComp represents a concrete implementation of primary component information
func (PrimaryComponentInfo) Component ¶ added in v2.0.4
func (pc PrimaryComponentInfo) Component() GetComponent
Component return the primary component as a Component type
func (PrimaryComponentInfo) GetID ¶ added in v2.0.4
func (pc PrimaryComponentInfo) GetID() string
GetID returns the unique identifier of the primary component
func (PrimaryComponentInfo) GetName ¶ added in v2.0.4
func (pc PrimaryComponentInfo) GetName() string
GetName returns the name of the primary component
func (PrimaryComponentInfo) GetType ¶ added in v2.0.4
func (pc PrimaryComponentInfo) GetType() string
GetType returns the name of the primary component
func (PrimaryComponentInfo) GetVersion ¶ added in v2.0.4
func (pc PrimaryComponentInfo) GetVersion() string
GetVersion returns the version of the primary component
func (PrimaryComponentInfo) IsPresent ¶ added in v2.0.4
func (pc PrimaryComponentInfo) IsPresent() bool
IsPresent returns whether primary component information is available
type Relationship ¶ added in v2.0.4
type Relationship struct {
From string // component ID
To string // component ID
Type string // relationship type
}
func (Relationship) GetFrom ¶ added in v2.0.4
func (r Relationship) GetFrom() string
func (Relationship) GetTo ¶ added in v2.0.4
func (r Relationship) GetTo() string
func (Relationship) GetType ¶ added in v2.0.4
func (r Relationship) GetType() string
type Signature ¶
type Signature struct {
Algorithm string
KeyID string
SigValue string
PublicKey string
CertificatePath []string
Excludes []string
}
Signature represents a concrete implementation of cryptographic signature information
func (*Signature) GetAlgorithm ¶ added in v2.0.2
GetAlgorithm returns the signature algorithm
func (*Signature) GetCertificatePath ¶ added in v2.0.2
GetCertificatePath returns the certificate chain path
func (*Signature) GetExcludes ¶ added in v2.0.2
GetExcludes returns the list of properties excluded from signing
func (*Signature) GetPublicKey ¶
GetPublicKey returns the public key used for signature verification
func (*Signature) GetSigValue ¶
GetSigValue returns the cryptographic signature value
type SpdxDoc ¶
type SpdxDoc struct {
SpdxSpec *Specs
Comps []GetComponent
Auths []GetAuthor
SpdxTools []GetTool
Relationships []GetRelationship
PrimaryComponent PrimaryComponentInfo
Lifecycle string
Vuln []GetVulnerabilities
File []GetComponent
// contains filtered or unexported fields
}
func (SpdxDoc) Components ¶
func (s SpdxDoc) Components() []GetComponent
func (SpdxDoc) Composition ¶ added in v2.0.3
func (s SpdxDoc) Composition() []GetComposition
func (SpdxDoc) Files ¶ added in v2.0.7
func (s SpdxDoc) Files() []GetComponent
func (SpdxDoc) GetDirectDependencies ¶ added in v2.0.4
func (s SpdxDoc) GetDirectDependencies(compID string, relTypes ...string) []GetComponent
func (SpdxDoc) GetOutgoingRelations ¶ added in v2.0.4
func (s SpdxDoc) GetOutgoingRelations(compID string) []GetRelationship
func (SpdxDoc) GetRelationships ¶
func (s SpdxDoc) GetRelationships() []GetRelationship
func (SpdxDoc) Lifecycles ¶
func (SpdxDoc) Manufacturer ¶
func (s SpdxDoc) Manufacturer() GetManufacturer
func (SpdxDoc) PrimaryComp ¶
func (s SpdxDoc) PrimaryComp() GetPrimaryComponentInfo
func (SpdxDoc) SchemaValidation ¶
func (SpdxDoc) Signature ¶
func (s SpdxDoc) Signature() GetSignature
func (SpdxDoc) Supplier ¶
func (s SpdxDoc) Supplier() GetSupplier
func (SpdxDoc) Vulnerabilities ¶
func (s SpdxDoc) Vulnerabilities() []GetVulnerabilities
type Spec ¶
type Spec interface {
// GetVersion returns the specification version
GetVersion() string
// FileFormat returns the file format of the SBOM
FileFormat() string
// Parsable returns whether the SBOM can be successfully parsed
Parsable() bool
// GetName returns the name of the SBOM specification
GetName() string
// GetSpecType returns the type of the SBOM specification (SPDX, CycloneDX, etc.)
GetSpecType() string
// RequiredFields returns whether all required fields are present in the specification
RequiredFields() bool
// GetCreationTimestamp returns the creation timestamp of the SBOM
GetCreationTimestamp() string
// GetLicenses returns the licenses associated with the SBOM
GetLicenses() []licenses.License
// GetNamespace returns the namespace of the SBOM
GetNamespace() string
// GetURI returns the URI of the SBOM
GetURI() string
// GetOrganization returns the organization that created the SBOM
GetOrganization() string
// GetComment returns any comments associated with the SBOM
GetComment() string
// GetSpdxID returns the SPDX identifier for the SBOM
GetSpdxID() string
// GetExtDocRef returns external document references
GetExtDocRef() []string
}
Spec defines the interface for accessing SBOM specification metadata and properties
type SpecFormat ¶
type SpecFormat string
SpecFormat represents the SBOM specification format type (SPDX, CycloneDX, etc.)
const ( // SBOMSpecSPDX represents the SPDX SBOM specification format SBOMSpecSPDX SpecFormat = "spdx" // SBOMSpecCDX represents the CycloneDX SBOM specification format SBOMSpecCDX SpecFormat = "cyclonedx" // SBOMSpecUnknown represents an unknown or unsupported SBOM specification format SBOMSpecUnknown SpecFormat = "unknown" )
type Specs ¶
type Specs struct {
Version string
Format string
SpecType string
Name string
Licenses []licenses.License
CreationTimestamp string
Namespace string
URI string
Organization string
Comment string
Spdxid string
ExternalDocReference []string
// contains filtered or unexported fields
}
Specs represents the concrete implementation of SBOM specification metadata
func (Specs) FileFormat ¶
FileFormat returns the file format of the SBOM
func (Specs) GetComment ¶
GetComment returns any comments associated with the SBOM
func (Specs) GetCreationTimestamp ¶
GetCreationTimestamp returns the creation timestamp of the SBOM
func (Specs) GetExtDocRef ¶
GetExtDocRef returns external document references
func (Specs) GetLicenses ¶
GetLicenses returns the licenses associated with the SBOM
func (Specs) GetNamespace ¶
GetNamespace returns the namespace of the SBOM
func (Specs) GetOrganization ¶
GetOrganization returns the organization that created the SBOM
func (Specs) GetSpecType ¶
GetSpecType returns the type of the SBOM specification (SPDX, CycloneDX, etc.)
func (Specs) GetVersion ¶
GetVersion returns the specification version
func (Specs) RequiredFields ¶
RequiredFields returns whether all required fields are present in the specification
type Supplier ¶
Supplier represents a concrete implementation of supplier information
func (Supplier) GetContacts ¶
GetContacts returns the contact information for the supplier
type Tool ¶
Tool represents a concrete implementation of tool information used in SBOM creation
func (Tool) GetVersion ¶
GetVersion returns the version of the tool
type Vulnerability ¶
type Vulnerability struct {
ID string
}
Vulnerability represents a concrete implementation of vulnerability information
func (Vulnerability) GetID ¶
func (v Vulnerability) GetID() string
GetID returns the unique identifier of the vulnerability (e.g., CVE ID)