Skip to content

Commit

Permalink
Merge pull request #359 from mindedsecurity:extractor_kernel_module
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 715349859
  • Loading branch information
copybara-github committed Jan 14, 2025
2 parents 8e85eeb + 54882ab commit 9491c94
Show file tree
Hide file tree
Showing 13 changed files with 1,503 additions and 539 deletions.
14 changes: 14 additions & 0 deletions binary/proto/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
"github.com/google/osv-scalibr/extractor/filesystem/os/cos"
"github.com/google/osv-scalibr/extractor/filesystem/os/dpkg"
"github.com/google/osv-scalibr/extractor/filesystem/os/flatpak"
"github.com/google/osv-scalibr/extractor/filesystem/os/kernel/module"
"github.com/google/osv-scalibr/extractor/filesystem/os/macapps"
"github.com/google/osv-scalibr/extractor/filesystem/os/pacman"
"github.com/google/osv-scalibr/extractor/filesystem/os/portage"
Expand Down Expand Up @@ -369,6 +370,19 @@ func setProtoMetadata(meta any, i *spb.Inventory) {
UpdateUrl: m.KSUpdateURL,
},
}
case *module.Metadata:
i.Metadata = &spb.Inventory_ModuleMetadata{
ModuleMetadata: &spb.ModuleMetadata{
PackageName: m.PackageName,
PackageVersion: m.PackageVersion,
PackageVermagic: m.PackageVermagic,
PackageSourceVersionIdentifier: m.PackageSourceVersionIdentifier,
OsId: m.OSID,
OsVersionCodename: m.OSVersionCodename,
OsVersionId: m.OSVersionID,
PackageAuthor: m.PackageAuthor,
},
}
case *ctrdfs.Metadata:
i.Metadata = &spb.Inventory_ContainerdContainerMetadata{
ContainerdContainerMetadata: &spb.ContainerdContainerMetadata{
Expand Down
13 changes: 13 additions & 0 deletions binary/proto/scan_result.proto
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ message Inventory {
JavaArchiveMetadata java_archive_metadata = 15;
JavaLockfileMetadata java_lockfile_metadata = 31;
PACMANPackageMetadata pacman_metadata = 36;
ModuleMetadata module_metadata = 38;
PortagePackageMetadata portage_metadata = 41;
OSVPackageMetadata osv_metadata = 16;
PythonRequirementsMetadata python_requirements_metadata = 21;
Expand Down Expand Up @@ -332,6 +333,18 @@ message FlatpakPackageMetadata {
string developer = 9;
}

// The additional data found in MODULE packages.
message ModuleMetadata {
string package_name = 1;
string package_version = 2;
string package_vermagic = 3;
string package_source_version_identifier = 4;
string os_id = 5;
string os_version_codename = 6;
string os_version_id = 7;
string package_author = 8;
}

// The additional data found in Mac Applications.
message MacAppsMetadata {
string bundle_display_name = 1;
Expand Down
Loading

0 comments on commit 9491c94

Please sign in to comment.