Documentation
¶
Index ¶
- Variables
- func DecodeJSON[T any](r io.Reader) T
- func DecodeYAML[T any](r io.Reader) T
- func ValidateCyclonedx(config CyclonedxConfig, scanReport CyclonedxSbomReport) error
- func ValidateGitleaks(config GitleaksConfig, scanReport GitleaksScanReport) error
- func ValidateGrype(config GrypeConfig, scanReport GrypeScanReport) error
- func ValidateSemgrep(config SemgrepConfig, scanReport SemgrepScanReport) error
- type Artifact
- type Bundle
- func (b *Bundle) Add(artifacts ...Artifact) error
- func (b *Bundle) String() string
- func (b *Bundle) ValidateCyclonedx(config *CyclonedxConfig) error
- func (b *Bundle) ValidateGitleaks(config *GitleaksConfig) error
- func (b *Bundle) ValidateGrype(config *GrypeConfig) error
- func (b *Bundle) ValidateSemgrep(config *SemgrepConfig) error
- func (b *Bundle) Write(w io.Writer, key string) (written int64, err error)
- type BundleDecoder
- type Config
- type CyclonedxConfig
- type CyclonedxListItem
- type CyclonedxSbomReport
- type Encoder
- type GitleaksConfig
- type GitleaksFinding
- type GitleaksScanReport
- type GrypeConfig
- type GrypeListItem
- type GrypeScanReport
- type KEVCatalog
- type KEVCatalogVulnerability
- type SemgrepConfig
- type SemgrepScanReport
- type Type
Constants ¶
This section is empty.
Variables ¶
var ErrCyclonedxValidationFailed = errors.New("cyclonedx validation failed")
var ErrNotExist = errors.New("Artifact does not exist")
var GitleaksValidationFailed = errors.New("gitleaks validation failed")
var GrypeValidationFailed = errors.New("grype validation failed")
var SemgrepFailedValidation = errors.New("semgrep failed validation")
Functions ¶
func DecodeJSON ¶ added in v0.0.8
DecodeJSON if the type is known and decode error is unexpected. Intended to be paired with Inspect
func DecodeYAML ¶ added in v0.0.8
DecodeYAML if the type is known and decode error is unexpected. Intended to be paired with Inspect
func ValidateCyclonedx ¶ added in v0.0.10
func ValidateCyclonedx(config CyclonedxConfig, scanReport CyclonedxSbomReport) error
func ValidateGitleaks ¶ added in v0.0.8
func ValidateGitleaks(config GitleaksConfig, scanReport GitleaksScanReport) error
func ValidateGrype ¶ added in v0.0.8
func ValidateGrype(config GrypeConfig, scanReport GrypeScanReport) error
func ValidateSemgrep ¶ added in v0.0.8
func ValidateSemgrep(config SemgrepConfig, scanReport SemgrepScanReport) error
Types ¶
type Artifact ¶ added in v0.0.8
func (Artifact) ContentBytes ¶ added in v0.0.8
func (Artifact) DigestString ¶ added in v0.0.8
type Bundle ¶ added in v0.0.8
type Bundle struct {
CyclonedxSbom Artifact
GrypeScan Artifact
SemgrepScan Artifact
GitleaksScan Artifact
Generic map[string]Artifact
PipelineID string
PipelineURL string
ProjectName string
}
func DecodeBundle ¶ added in v0.0.8
DecodeBundle without checking for a decode error. Intended to be paired with Inspect
func (*Bundle) ValidateCyclonedx ¶ added in v0.0.10
func (b *Bundle) ValidateCyclonedx(config *CyclonedxConfig) error
func (*Bundle) ValidateGitleaks ¶ added in v0.0.8
func (b *Bundle) ValidateGitleaks(config *GitleaksConfig) error
func (*Bundle) ValidateGrype ¶ added in v0.0.8
func (b *Bundle) ValidateGrype(config *GrypeConfig) error
func (*Bundle) ValidateSemgrep ¶ added in v0.0.8
func (b *Bundle) ValidateSemgrep(config *SemgrepConfig) error
type BundleDecoder ¶ added in v0.0.8
type BundleDecoder struct {
// contains filtered or unexported fields
}
func NewBundleDecoder ¶ added in v0.0.8
func NewBundleDecoder(r io.Reader) *BundleDecoder
func (BundleDecoder) Decode ¶ added in v0.0.8
func (d BundleDecoder) Decode(bundle *Bundle) error
type Config ¶ added in v0.0.8
type Config struct {
Cyclonedx *CyclonedxConfig `yaml:"cyclonedx,omitempty" json:"cyclonedx,omitempty"`
Grype *GrypeConfig `yaml:"grype,omitempty" json:"grype,omitempty"`
Semgrep *SemgrepConfig `yaml:"semgrep,omitempty" json:"semgrep,omitempty"`
Gitleaks *GitleaksConfig `yaml:"gitleaks,omitempty" json:"gitleaks,omitempty"`
}
type CyclonedxConfig ¶ added in v0.0.10
type CyclonedxConfig struct {
AllowList []CyclonedxListItem `yaml:"allowList,omitempty" json:"allowList,omitempty"`
DenyList []CyclonedxListItem `yaml:"denyList,omitempty" json:"denyList,omitempty"`
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"`
}
type CyclonedxListItem ¶ added in v0.0.10
type CyclonedxSbomReport ¶ added in v0.0.10
func (*CyclonedxSbomReport) ShimComponentsAsVulnerabilities ¶ added in v0.0.10
func (r *CyclonedxSbomReport) ShimComponentsAsVulnerabilities() *CyclonedxSbomReport
Adds the components that are not vulnerabilities as one with severity as none
func (CyclonedxSbomReport) String ¶ added in v0.0.10
func (r CyclonedxSbomReport) String() string
type Encoder ¶ added in v0.0.8
type Encoder struct {
// contains filtered or unexported fields
}
func NewBundleEncoder ¶ added in v0.0.8
type GitleaksConfig ¶ added in v0.0.8
type GitleaksConfig struct {
SecretsAllowed bool `yaml:"SecretsAllowed" json:"secretsAllowed"`
}
type GitleaksFinding ¶ added in v0.0.8
type GitleaksScanReport ¶ added in v0.0.8
type GitleaksScanReport []GitleaksFinding
func (GitleaksScanReport) String ¶ added in v0.0.8
func (r GitleaksScanReport) String() string
type GrypeConfig ¶ added in v0.0.8
type GrypeConfig struct {
AllowList []GrypeListItem `yaml:"allowList,omitempty" json:"allowList,omitempty"`
DenyList []GrypeListItem `yaml:"denyList,omitempty" json:"denyList,omitempty"`
Critical int `yaml:"critical" json:"critical"`
High int `yaml:"high" json:"high"`
Medium int `yaml:"medium" json:"medium"`
Low int `yaml:"low" json:"low"`
Negligible int `yaml:"negligible" json:"negligible"`
Unknown int `yaml:"unknown" json:"unknown"`
}
type GrypeListItem ¶ added in v0.0.10
type GrypeScanReport ¶ added in v0.0.8
func (GrypeScanReport) String ¶ added in v0.0.8
func (r GrypeScanReport) String() string
type KEVCatalog ¶ added in v0.0.8
type KEVCatalogVulnerability ¶ added in v0.0.8
type KEVCatalogVulnerability struct {
CveID string `json:"cveID"`
VendorProject string `json:"vendorProject"`
Product string `json:"product"`
VulnerabilityName string `json:"vulnerabilityName"`
DateAdded string `json:"dateAdded"`
ShortDescription string `json:"shortDescription"`
RequiredAction string `json:"requiredAction"`
DueDate string `json:"dueDate"`
Notes string `json:"notes"`
}
type SemgrepConfig ¶ added in v0.0.8
type SemgrepScanReport ¶ added in v0.0.8
type SemgrepScanReport semgrep.SemgrepOutputV1Jsonschema
SemgrepScanReport is a data model for a Semgrep Output scan produced by `semgrep scan --json`
func (SemgrepScanReport) String ¶ added in v0.0.8
func (r SemgrepScanReport) String() string
type Type ¶ added in v0.0.8
type Type string
func Inspect ¶ added in v0.0.8
Inspect will attempt to decode into all report types and return the one that worked. Warning: this function is prone to hanging if a bad reader is supplied, use InspectWithContext unless reader can be guaranteed not to hang. Very small performance bump over InspectWithContext
func InspectWithContext ¶ added in v0.0.8
InspectWithContext calls Inspect with the ability to cancel which prevents hanging when running go routines