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

feat: filter file capture by ELF type #3361

Merged

Conversation

AlonZivony
Copy link
Collaborator

1. Explain what the PR does

Add a filter for file IO capture filtering ELF files. ELF files are the most important files to capture in security research, so filtering according to ELF files is very effective to reduce noise.

fix #3359

pkg/ebpf/c/capture_filtering.h Outdated Show resolved Hide resolved
pkg/ebpf/c/capture_filtering.h Show resolved Hide resolved
file_id.ctime = 0;
if (start_pos == 0) {
// Check if header is matching ELF header
u8 header[FILE_MAGIC_HDR_SIZE] = {};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this array be initialized to 0?
This can be important if header size is less than FILE_MAGIC_HDR_SIZE

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So using the syntax of x = {} should initialized the value to zero as far as I know.
I have checked it once with @roikol and it worked.

pkg/ebpf/c/maps.h Outdated Show resolved Hide resolved
Add a filter for file IO capture filtering ELF files.
ELF files are the most important files to capture in security research,
so filtering according to ELF files is very effective to reduce noise.
Copy link
Collaborator

@yanivagman yanivagman left a comment

Choose a reason for hiding this comment

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

LGTM

@yanivagman yanivagman merged commit fd47dfb into aquasecurity:main Sep 3, 2023
26 checks passed
AlonZivony added a commit to AlonZivony/tracee that referenced this pull request Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Capture files ELF filter
2 participants