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

Include more flexible PythonEngine configuration variables #42

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions eql/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ def __init__(self, config=None):
self.host_key = self.get_config('host_key', 'hostname')
self.pid_key = self.get_config('pid_key', 'pid')
self.ppid_key = self.get_config('ppid_key', 'ppid')
self.process_type = self.get_config('process_type', 'process')
self.process_subtype = self.get_config('process_subtype', 'subtype')
self.create_values = self.get_config('create_values', ["create", "fork"])
self.terminate_values = self.get_config('terminate_values', ["terminate"])

if self.get_config('data_source') == 'endgame':
self.process_subtype = "opcode"
self.create_values = (1, 3, 9)
self.terminate_values = (2, 4)
else:
self.process_subtype = "subtype"
self.create_values = ["create", "fork"]
self.terminate_values = ["terminate"]

self._scoped = []

Expand Down Expand Up @@ -766,7 +766,7 @@ def _get_descendant_of(self, node): # type: (EventQuery) -> callable
creates = self.create_values
terminates = self.terminate_values

@self.event_callback("process")
@self.event_callback(self.process_type)
def update_descendants(event): # type: (Event) -> None
ppid = event.data.get(self.ppid_key)
pid = event.data.get(self.pid_key)
Expand Down Expand Up @@ -813,7 +813,7 @@ def _get_child_of(self, node): # type: (EventQuery) -> callable
creates = self.create_values
terminates = self.terminate_values

@self.event_callback("process")
@self.event_callback(self.process_type)
def update_children(event): # type: (Event) -> None
ppid = event.data.get(self.ppid_key)
pid = event.data.get(self.pid_key)
Expand Down Expand Up @@ -859,7 +859,7 @@ def _get_event_of(self, node): # type: (EventQuery) -> callable
creates = self.create_values
terminates = self.terminate_values

@self.event_callback("process")
@self.event_callback(self.process_type)
def purge_on_terminate(event): # type: (Event) -> None
pid = event.data.get(self.pid_key)
subtype = event.data.get(process_subtype)
Expand Down