misp icon indicating copy to clipboard operation
misp copied to clipboard

Ensure all required Python packages are installed for TAXII push

Open sei-jphoskinson opened this issue 1 year ago • 0 comments

When trying to do a "push to TAXII server" from the "Linked TAXII Servers" page, I would always see the following error in the exec-errors.log:

[2023-07-19 21:02:20 417] Running command python3 /var/www/MISP/app/files/scripts/taxii/taxii_push.py --dir /tmp/Taxii/31WFfqecOd3h --baseurl http://medallion:5000/ --api_root trustgroup1 --key [REDACTED] --collection 365fed99-08fa-fdcd-a1b3-fb247eb41d01
Traceback (most recent call last):
  File "/var/www/MISP/app/files/scripts/taxii/taxii_push.py", line 9, in <module>
    import taxii2client
ModuleNotFoundError: No module named 'taxii2client'
[2023-07-19 21:02:20 417] Process finished with return code 1

Adding that package to the container's requirements.txt resulted in additional libraries it couldn't find, including several that are submoduled in the MISP codebase, but don't seem to actually be getting installed into the Python search path.

This is a PR to ensure that all libraries needed for the TAXII push functionality are installed into the container's Python environment, using the versions included in the MISP codebase, if possible. I had to move the package installation to after the git checkout for this to work.

With this change (and a version bump to MISP v2.4.173 to pick up this fix), I was able to successfully push events from a MISP server to a TAXII server.

sei-jphoskinson avatar Jul 20 '23 13:07 sei-jphoskinson