TheHive-Project / TheHive-Project/Cortex-Analyzers

Cortex Analysers fails : No module named 'requests'

Open
#957 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
490
Forks
405
Avg merge
2d 43m
Merged PRs (30d)
8

Description

Request Type

Bug

Work Environment

(replace with N/A if not applicable)

Question Answer
TheHive version 4
OS version (server) RedHat
OS version (client) Seven
Cortex Analyzer Name OTXQuery, Pulsedive, VirusTotal etc
Cortex Version 3.1.0-1
ElasticSearch client 7.9.1
Description

Most of the Analysers are failed to run with the following error messages.
Traceback (most recent call last): File "/xxx/Cortex-Analyzers/analyzers/OTXQuery/otxquery.py", line 4, in import requestsModuleNotFoundError: No module named 'requests'

Traceback (most recent call last): File "/opt/Cortex-Analyzers/analyzers/Abuse_Finder/abusefinder.py", line 9, in from abuse_finder import domain_abuse, ip_abuse, \ModuleNotFoundError: No module named 'abuse_finder'

Installed both Python2.7 and Python 3.6. When I tried to install dependencies manually, it shows that requirements are already satisfied.

When we upgrade the pip version python 27 breaks.

Sample error log
ImportError: /opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/_io.so: undefined symbol: _PyErr_ReplaceException
Traceback (most recent call last):
File "/opt/rh/python27/root/usr/bin/pip", line 5, in
from pkg_resources import load_entry_point
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/pkg_resources.py", line 16, in
import sys, os, time, re, imp, types, zipfile, zipimport
File "/opt/rh/python27/root/usr/lib64/python2.7/zipfile.py", line 6, in
import io
File "/opt/rh/python27/root/usr/lib64/python2.7/io.py", line 51, in
import _io

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with analyzers/OTXQuery/otxquery.py and analyzers/Abuse_Finder/abusefinder.py, then reproduce the missing-module errors in the reported Cortex 3.1.0-1 and RedHat/Python environment. Check how analyzer dependencies are installed and verify that the affected analyzers import successfully without breaking the supported Python runtime.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.