github.com/anchore/syft@v1.38.2/syft/pkg/binary.go (about) 1 package pkg 2 3 import "github.com/anchore/syft/syft/file" 4 5 // BinarySignature represents a set of matched values within a binary file. 6 type BinarySignature struct { 7 Matches []ClassifierMatch `mapstructure:"Matches" json:"matches"` 8 } 9 10 // ClassifierMatch represents a single matched value within a binary file and the "class" name the search pattern represents. 11 type ClassifierMatch struct { 12 Classifier string `mapstructure:"Classifier" json:"classifier"` 13 Location file.Location `mapstructure:"Location" json:"location"` 14 } 15 16 // ELFBinaryPackageNoteJSONPayload Represents metadata captured from the .note.package section of an ELF-formatted binary 17 type ELFBinaryPackageNoteJSONPayload struct { 18 // (these are well-known fields as defined by systemd ELF package metadata "spec" https://systemd.io/ELF_PACKAGE_METADATA/) 19 20 // Type is the type of the package (e.g. "rpm", "deb", "apk", etc.) 21 Type string `json:"type,omitempty"` 22 23 // Architecture of the binary package (e.g. "amd64", "arm", etc.) 24 Architecture string `json:"architecture,omitempty"` 25 26 // OSCPE is a CPE name for the OS, typically corresponding to CPE_NAME in os-release (e.g. cpe:/o:fedoraproject:fedora:33) 27 OSCPE string `json:"osCPE,omitempty"` 28 29 // OS is the OS name, typically corresponding to ID in os-release (e.g. "fedora") 30 OS string `json:"os,omitempty"` 31 32 // osVersion is the version of the OS, typically corresponding to VERSION_ID in os-release (e.g. "33") 33 OSVersion string `json:"osVersion,omitempty"` 34 35 ///////////////////////////////////////////////////////////////////////////////// 36 // (these are additional fields that are not part of the systemd spec) 37 38 // System is a context-specific name for the system that the binary package is intended to run on or a part of 39 System string `json:"system,omitempty"` 40 41 // Vendor is the individual or organization that produced the source code for the binary 42 Vendor string `json:"vendor,omitempty"` 43 44 // SourceRepo is the URL to the source repository for which the binary was built from 45 SourceRepo string `json:"sourceRepo,omitempty"` 46 47 // Commit is the commit hash of the source repository for which the binary was built from 48 Commit string `json:"commit,omitempty"` 49 } 50 51 // PEBinary represents metadata captured from a Portable Executable formatted binary (dll, exe, etc.) 52 type PEBinary struct { 53 // VersionResources contains key-value pairs extracted from the PE file's version resource section (e.g., FileVersion, ProductName, CompanyName). 54 VersionResources KeyValues 55 }