Documentation
¶
Overview ¶
Package cyclonedx provides data model, decoder, and validator for cyclonedx reports
Index ¶
- Constants
- func AllowListRule(vul cdx.Vulnerability, config Config) bool
- func DenyListRule(vuls []cdx.Vulnerability, config Config) error
- func NewValidator() gcv.Validator[cdx.Vulnerability, Config]
- func ThresholdRule(vuls []cdx.Vulnerability, config Config) error
- type Config
- type ListItem
- type ReportDecoder
- type ScanReport
Constants ¶
View Source
const ConfigFieldName = "cyclonedx"
ConfigFieldName the field name in the config map
View Source
const ReportType = "CycloneDX Report"
ReportType in plain text
Variables ¶
This section is empty.
Functions ¶
func AllowListRule ¶
func AllowListRule(vul cdx.Vulnerability, config Config) bool
AllowListRule for custom list
func DenyListRule ¶
func DenyListRule(vuls []cdx.Vulnerability, config Config) error
DenyListRule for custom list
func NewValidator ¶
func NewValidator() gcv.Validator[cdx.Vulnerability, Config]
NewValidator implementation of the generic validator
func ThresholdRule ¶
func ThresholdRule(vuls []cdx.Vulnerability, config Config) error
ThresholdRule deny if X > vulnerabilities of Y Severity
Types ¶
type Config ¶
type Config struct {
AllowList []ListItem `yaml:"allowList,omitempty" json:"allowList,omitempty"`
DenyList []ListItem `yaml:"denyList,omitempty" json:"denyList,omitempty"`
Required bool `yaml:"required" json:"required"`
Critical int `yaml:"critical" json:"critical"`
High int `yaml:"high" json:"high"`
Medium int `yaml:"medium" json:"medium"`
Low int `yaml:"low" json:"low"`
Info int `yaml:"info" json:"info"`
None int `yaml:"none" json:"none"`
Unknown int `yaml:"unknown" json:"unknown"`
}
Config data model
type ListItem ¶
type ListItem struct {
ID string `yaml:"id" json:"id"`
Reason string `yaml:"reason" json:"reason"`
}
ListItem for a specific allow/deny list record
type ReportDecoder ¶
ReportDecoder Custom decoder to handle multiple report types
func (*ReportDecoder) Decode ¶
func (d *ReportDecoder) Decode() (any, error)
Decode and check BOMFormat
func (*ReportDecoder) DecodeFrom ¶
func (d *ReportDecoder) DecodeFrom(r io.Reader) (any, error)
DecodeFrom ...
type ScanReport ¶
ScanReport data model
func (*ScanReport) ShimComponentsAsVulnerabilities ¶
func (r *ScanReport) ShimComponentsAsVulnerabilities() *ScanReport
ShimComponentsAsVulnerabilities modify the report to add compontents as vulnerabilities with no score
Click to show internal directories.
Click to hide internal directories.