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

handle unable to get redis server pid #418

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
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
12 changes: 10 additions & 2 deletions managers/redis_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,16 @@ def get_open_redis_servers(self) -> Dict[int,int]:
continue

line = line.split(',')
pid, port = int(line[3]), int(line[2])
self.open_servers_pids[pid] = port

try:
pid, port = int(line[3]), int(line[2])
self.open_servers_pids[pid] = port
except ValueError:
# sometimes slips can't get the server pid and logs "False"
# in the lofile instead of the PID
# there's nothing we can do about it
pass


return self.open_servers_pids

Expand Down
8 changes: 3 additions & 5 deletions modules/threat_intelligence/threat_intelligence.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,9 +650,7 @@ def is_ignored_domain(self, domain):



def set_evidence_malicious_hash(self,
file_info: dict
):
def set_evidence_malicious_hash(self,file_info: dict):
"""
:param file_info: dict with flow, profileid, twid, and confidence of file
"""
Expand Down Expand Up @@ -868,7 +866,7 @@ def is_malicious_ip(self, ip, uid, daddr, timestamp, profileid, twid, ip_state)
)
return True

def is_malicious_hash(self, flow_info):
def is_malicious_hash(self, flow_info: dict):
"""
:param flow_info: dict with uid, twid, ts, md5 etc.
"""
Expand Down Expand Up @@ -1030,6 +1028,6 @@ def main(self):
)

if msg:= self.get_msg('new_downloaded_file'):
file_info = json.loads(msg['data'])
file_info: dict = json.loads(msg['data'])
if file_info['type'] == 'zeek':
self.is_malicious_hash(file_info)
5 changes: 4 additions & 1 deletion slips_files/core/helpers/flow_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,10 @@ def handle_dhcp(self):


def handle_files(self):
""" Send files.log data to new_downloaded_file channel in vt module to see if it's malicious"""
"""
Send files.log data to new_downloaded_file channel in the TI module to see if it's malicious
"""

# files slips sees can be of 2 types: suricata or zeek
to_send = {
'flow': asdict(self.flow),
Expand Down
Loading