8000 Add event filter by lizrice · Pull Request #8 · aquasecurity/tracee · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add event filter #8

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

Merged
merged 3 commits into from
Nov 13, 2019
Merged

Add event filter #8

merged 3 commits into from
Nov 13, 2019

Conversation

lizrice
Copy link
Contributor
@lizrice lizrice commented Nov 13, 2019

Add -e/--events-to-trace option allowing user to specify the syscalls and events to be shown in the trace.

For example: tracee -e cap_capable,execve shows only cap_capable and execve events in the output

Default is to include all events (can also be explicitly specified with -e all)

@lizrice lizrice requested a review from yanivagman November 13, 2019 11:51
@@ -679,6 +683,25 @@ def open_flags_to_str(flags):

return f_str

# Given the list of event names the user wants to trace, get_kprobes() returns the
# - syscalls we want kprobes for (including the essential ones needed for racee to work)
Copy link
Collaborator

Choose a reason for hiding this comment

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

racee -> tracee


log.info(json.dumps(data))
self.events.append(data)
if eventname in self.events_to_trace:
8000 Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this is needed. If no kprobe attached for an event, we will never receive that event from the kernel

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is to avoid tracing out the “essential_syscalls” (execve/execveat) if they aren’t selected

@lizrice lizrice merged commit 69f490d into master Nov 13, 2019
@lizrice lizrice deleted the event-filter branch November 13, 2019 16:08
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
0