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 LocationToProto(l *location.Location) *spb.Location
- func LocationToStruct(l *spb.Location) *location.Location
- 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 PackageVulnToProto(v *inventory.PackageVuln, pkgToID map[*extractor.Package]string) (*spb.PackageVuln, error)
- func PackageVulnToStruct(v *spb.PackageVuln, idToPkg map[string]*extractor.Package) (*inventory.PackageVuln, error)
- func PluginStatusToProto(s *plugin.Status) *spb.PluginStatus
- func PluginStatusToStruct(s *spb.PluginStatus) *plugin.Status
- func ScanResultFromProto(r *spb.ScanResult) (*result.ScanResult, error)
- 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 SensitiveInformationToProto(sd *inventory.SensitiveInformation) (*spb.SensitiveInformation, error)
- func SensitiveInformationToStruct(sd *spb.SensitiveInformation) (*inventory.SensitiveInformation, 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 LocationToProto ¶ added in v0.5.2
LocationToProto converts a Location struct to a Location proto.
func LocationToStruct ¶ added in v0.5.2
LocationToStruct converts a Location proto to a Location 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 PackageVulnToProto ¶ added in v0.4.1
func PackageVulnToProto(v *inventory.PackageVuln, pkgToID map[*extractor.Package]string) (*spb.PackageVuln, error)
PackageVulnToProto converts a PackageVuln struct to proto.
func PackageVulnToStruct ¶ added in v0.4.1
func PackageVulnToStruct(v *spb.PackageVuln, idToPkg map[string]*extractor.Package) (*inventory.PackageVuln, error)
PackageVulnToStruct converts a PackageVuln proto into the equivalent go struct.
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 ScanResultFromProto ¶ added in v0.4.1
func ScanResultFromProto(r *spb.ScanResult) (*result.ScanResult, error)
ScanResultFromProto converts a ScanResult 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 SensitiveInformationToProto ¶ added in v0.5.2
func SensitiveInformationToProto(sd *inventory.SensitiveInformation) (*spb.SensitiveInformation, error)
SensitiveInformationToProto converts an inventory.SensitiveInformation to its proto representation.
func SensitiveInformationToStruct ¶ added in v0.5.2
func SensitiveInformationToStruct(sd *spb.SensitiveInformation) (*inventory.SensitiveInformation, error)
SensitiveInformationToStruct converts a spb.SensitiveInformation 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.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package metadata converts anypb.Any proto to a Protoable struct and vice versa.
|
Package metadata converts anypb.Any proto to a Protoable struct and vice versa. |