Add ELF binary package cataloger (#2396)

* feat Adds Elf package catalogger

Signed-off-by: Brian Ebarb <ebarb.brian@gmail.com>

* Add test fixtures for elf package

Signed-off-by: Colleen Divers <colleen.divers@gmail.com>

* bump JSON schema to v16.0.6 + expand test fixtures

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* less verbose logging

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* remove dead test code

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* remove unreleated swift change

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: Brian Ebarb <ebarb.brian@gmail.com>
Signed-off-by: Colleen Divers <colleen.divers@gmail.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Co-authored-by: Colleen Divers <colleen.divers@gmail.com>
Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
brian-ebarb
2024-03-14 11:16:03 -04:00
committed by GitHub
co-authored by Colleen Divers Alex Goodman
parent 7ab6fc3fe4
commit 6a2517b5d2
32 changed files with 2980 additions and 6 deletions
+23
View File
@@ -0,0 +1,23 @@
package pkg
import "github.com/anchore/syft/syft/file"
// BinarySignature represents a set of matched values within a binary file.
type BinarySignature struct {
Matches []ClassifierMatch `mapstructure:"Matches" json:"matches"`
}
// ClassifierMatch represents a single matched value within a binary file and the "class" name the search pattern represents.
type ClassifierMatch struct {
Classifier string `mapstructure:"Classifier" json:"classifier"`
Location file.Location `mapstructure:"Location" json:"location"`
}
// ELFBinaryPackageNoteJSONPayload Represents metadata captured from the .note.package section of the binary
type ELFBinaryPackageNoteJSONPayload struct {
Type string `json:"type,omitempty"`
Vendor string `json:"vendor,omitempty"`
System string `json:"system,omitempty"`
SourceRepo string `json:"sourceRepo,omitempty"`
Commit string `json:"commit,omitempty"`
}