Documentation
¶
Overview ¶
Package proto provides protobuf related utilities for the SCALIBR binary.
Index ¶
- Variables
- func FindingVEXToProto(v *vex.FindingExploitabilitySignal) *spb.FindingExploitabilitySignal
- func FindingVEXToStruct(p *spb.FindingExploitabilitySignal) *vex.FindingExploitabilitySignal
- func GenericFindingToProto(f *inventory.GenericFinding) (*spb.GenericFinding, error)
- func GenericFindingToStruct(f *spb.GenericFinding) (*inventory.GenericFinding, error)
- func InventoryToProto(inv *inventory.Inventory) (*spb.Inventory, error)
- func InventoryToStruct(invProto *spb.Inventory) *inventory.Inventory
- func PackageToProto(pkg *extractor.Package) (*spb.Package, error)
- func PackageToStruct(pkgProto *spb.Package) (*extractor.Package, error)
- func PackageVEXToProto(v *vex.PackageExploitabilitySignal) (*spb.PackageExploitabilitySignal, error)
- func PackageVEXToStruct(p *spb.PackageExploitabilitySignal) (*vex.PackageExploitabilitySignal, error)
- func PluginStatusToProto(s *plugin.Status) *spb.PluginStatus
- func PluginStatusToStruct(s *spb.PluginStatus) *plugin.Status
- func ScanResultToProto(r *result.ScanResult) (*spb.ScanResult, error)
- func SecretToProto(s *inventory.Secret) (*spb.Secret, error)
- func SecretToStruct(s *spb.Secret) (*inventory.Secret, error)
- func ValidExtension(path string) error
- func Write(filePath string, outputProto proto.Message) error
- func WriteWithFormat(filePath string, outputProto proto.Message, format string) error
- type MetadataProtoSetter
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAdvisoryMissing will be returned if the Advisory is not set on a finding. ErrAdvisoryMissing = errors.New("advisory missing in finding") // ErrAdvisoryIDMissing will be returned if the Advisory ID is not set on a finding. ErrAdvisoryIDMissing = errors.New("advisory ID missing in finding") )
var ( // ErrMultipleSecretLocations will be returned if multiple secret locations are set. ErrMultipleSecretLocations = errors.New("multiple secret locations are not supported") // ErrUnsupportedValidationType will be returned if the validation type is not supported. ErrUnsupportedValidationType = errors.New("validation type is not supported") // ErrUnsupportedSecretType will be returned if the secret type is not supported. ErrUnsupportedSecretType = errors.New("unsupported secret type") )
var ( // ErrVulnIdentifiersAndMatchsAllSet will be returned if both VulnIdentifiers and MatchesAllVulns are set. ErrVulnIdentifiersAndMatchsAllSet = errors.New("cannot set both VulnIdentifiers and MatchesAllVulns") )
Functions ¶
func FindingVEXToProto ¶ added in v0.3.2
func FindingVEXToProto(v *vex.FindingExploitabilitySignal) *spb.FindingExploitabilitySignal
FindingVEXToProto converts a struct FindingExploitabilitySignal to its proto representation.
func FindingVEXToStruct ¶ added in v0.3.2
func FindingVEXToStruct(p *spb.FindingExploitabilitySignal) *vex.FindingExploitabilitySignal
FindingVEXToStruct converts a proto FindingExploitabilitySignal to its struct representation.
func GenericFindingToProto ¶ added in v0.3.2
func GenericFindingToProto(f *inventory.GenericFinding) (*spb.GenericFinding, error)
GenericFindingToProto converts a GenericFinding go struct into the equivalent proto.
func GenericFindingToStruct ¶ added in v0.3.2
func GenericFindingToStruct(f *spb.GenericFinding) (*inventory.GenericFinding, error)
GenericFindingToStruct converts a GenericFinding proto into the equivalent go struct.
func InventoryToProto ¶ added in v0.3.0
InventoryToProto converts a Inventory go struct into the equivalent proto.
func InventoryToStruct ¶ added in v0.3.0
InventoryToStruct converts a ScanResult proto into the equivalent go struct.
func PackageToProto ¶ added in v0.3.2
PackageToProto converts a Package struct to a Package proto.
func PackageToStruct ¶ added in v0.3.2
PackageToStruct converts a Package proto to a Package struct.
func PackageVEXToProto ¶ added in v0.3.2
func PackageVEXToProto(v *vex.PackageExploitabilitySignal) (*spb.PackageExploitabilitySignal, error)
PackageVEXToProto converts a struct PackageExploitabilitySignal to its proto representation.
func PackageVEXToStruct ¶ added in v0.3.2
func PackageVEXToStruct(p *spb.PackageExploitabilitySignal) (*vex.PackageExploitabilitySignal, error)
PackageVEXToStruct converts a proto PackageExploitabilitySignal to its struct representation.
func PluginStatusToProto ¶ added in v0.3.0
func PluginStatusToProto(s *plugin.Status) *spb.PluginStatus
PluginStatusToProto converts a plugin.Status go struct into the equivalent proto.
func PluginStatusToStruct ¶ added in v0.3.2
func PluginStatusToStruct(s *spb.PluginStatus) *plugin.Status
PluginStatusToStruct converts a plugin.Status proto into the equivalent go struct.
func ScanResultToProto ¶
func ScanResultToProto(r *result.ScanResult) (*spb.ScanResult, error)
ScanResultToProto converts a ScanResult go struct into the equivalent proto.
func SecretToProto ¶ added in v0.3.2
SecretToProto converts a struct Secret to its proto representation.
func SecretToStruct ¶ added in v0.3.2
SecretToStruct converts a proto Secret to its struct representation.
func ValidExtension ¶
ValidExtension returns an error if the file extension is not a proto file.
Types ¶
type MetadataProtoSetter ¶ added in v0.3.2
MetadataProtoSetter is an interface for metadata structs that can set themselves on a Package proto.