Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of kernel module extractor. #359

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

brnpl
Copy link
Contributor

@brnpl brnpl commented Dec 23, 2024

Pull request for the kernel module extractor.

Implemented:

  • Extractor implementation;
  • Unit test implementation;
  • Integrated extractor in the main tool;

binary/proto/proto.go Outdated Show resolved Hide resolved
extractor/filesystem/os/kernel/module/metadata.go Outdated Show resolved Hide resolved
extractor/filesystem/os/kernel/module/testdata/valid Outdated Show resolved Hide resolved
extractor/filesystem/os/kernel/module/module.go Outdated Show resolved Hide resolved
extractor/filesystem/os/kernel/module/module.go Outdated Show resolved Hide resolved
extractor/filesystem/os/kernel/module/module.go Outdated Show resolved Hide resolved
extractor/filesystem/os/kernel/module/module.go Outdated Show resolved Hide resolved
extractor/filesystem/os/kernel/module/module_test.go Outdated Show resolved Hide resolved
@erikvarga
Copy link
Collaborator

Looks like some files changed upstream since this PR got created to you'll have to resolve some merge conflicts

@brnpl brnpl requested a review from erikvarga January 10, 2025 15:01

// Sections are delimited by null bytes (\x00)
for _, line := range bytes.Split(sectionData, []byte{'\x00'}) {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix linter error: module.go:186:65: unnecessary leading newline (whitespace)

@@ -54,6 +54,14 @@ type Config struct {
MaxFileSizeBytes int64
}

type ModuleMetadata struct {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not reuse the Metadata struct from metadata.go? And then you can just pass the metadata struct to the inventory initialization directly

extractor/filesystem/os/kernel/module/module.go Outdated Show resolved Hide resolved
@brnpl brnpl requested a review from erikvarga January 10, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants