Documentation
¶
Index ¶
- Variables
- func DecodeJSON[T any](r io.Reader) T
- func DecodeYAML[T any](r io.Reader) T
- 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
- type BundleDecoder
- type Config
- type Encoder
- type GitleaksConfig
- type GitleaksFinding
- type GitleaksScanReport
- type GrypeConfig
- type GrypeScanReport
- type KEVCatalog
- type KEVCatalogVulnerability
- type SemgrepConfig
- type SemgrepScanReport
- type Type
Constants ¶
This section is empty.
Variables ¶
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 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 {
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) 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 {
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 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 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