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
Error: STIX or CyBox or mixbox library not installed correctly New Ubuntu 16 Install #2349
Comments
Using that exact cybox version I cannot replicate the behaviour. Can you try this? $ python2 from cybox.core import Object does that go through without errors? (I'm assuming MISP uses py2, as that version of cybox doesn't install under py3 ;)) |
python2.7 No errors on the import. What does that mean, and how do I fix it permanently? |
Current running version of python is |
Is there a different version we should run. Is there a different log? |
It means you have an issue with STIX libs and should probably cry a bit You clearly have cybox installed, but MISP can't access it or something? That.... shouldn't happen. I can't replicate it, so that's VERY weird. |
Looks like another issue, I having is the workers stop working randomly. |
@krypto29s Are you sure stix and friends were installed system wide ? |
kallix, it seems that is the actual issue. As the www-data user, we cant run the above that you posted, but we can as any other user. This also seems to affect our misp modules in the same way, as the www-data user is not able to import any python module. Below is the permissions for the following:
|
♫Then you didn't follow the install instructions ♫ Go install them as root. |
When I attempt to import cybox.core as www-data it loos as below. All other users function correctly
|
|
or rather python2 I think |
These are what the instructions say
We followed those. After install the owner and group of everything inside of /scripts was root/root. That was obviously never going to work, so I changed the perms to www-data:www-data. I am open to doing what makes it work as it should. |
@FloatingGhost in the Ubuntu install instructions it says that they need to be owned by www-data
this is on our test server that is working |
The instructions do not say anything about running as root, or www-data as for the install. You have to sudo to run the python setup. Should i sudo -u www-data python setup.py install? |
Two different things :
|
@kallix should we do it as python3, or python 2. default is 2. |
python2 (and i believe it must be the default python) |
@kallix At this point should we delete the contents of scripts and start over, or just install over top of? |
Wait until you can actually import cybox from a python interpreter under the www-data user before tackling the next (potential) problem. |
@kallix I think that is the point we are stuck at. Trying to determine why cybox is not importable as www-data. |
Precisely. |
@kallix I have executed the task as you suggested. |
Now, my hope is that if you run the python interpreter as www-data, the |
It doesn't work. Same symptom. |
/usr/local/lib/python2.7/dist-packages/ |
from a python interpreter running as www-data, what is the output of import sys
sys.path (you may have confidential info there, be cautious) |
Thanks, I purged the above post. thank you for looking out.
|
Hmm...what if you do |
|
Arf.. can you try This file definitely has to be readable. That's how python knows what was installed by easy_install (easy_install is the backend program called when doing python setup.py install) And also check that cybox is present in this file. |
This is about as far as i have been able to take it
|
ls -al /usr/local/lib/python2.7/dist-packages/ |
Wait a gosh darn diddly minute right there
What version of ubuntu are you running? That... shouldn't be a group on newer versions, I haven't seen that on ubuntu in... ever |
This was definately a permissions issue. I had to reset the perms for everyone on the dist-packages directory, and cybox/stix/mixbox all show they are running. |
@FloatingGhost This is on Ubuntu 16.0.4.4 |
krypto29s , can you be more specific regarding the permission you used. I have almost the same problem. The files are looking like in your description, except that I'm in python2.7. from cybox.core import Object ---No error in importing cybox module |
you will notice the dist-packages folder does not have permissions to other. You need read an execute recursive starting on that directory for other. |
Unfortunately didn't solve my problem. Any new ideas? |
This was a bit of a chase of permissions. |
Also backup one folder and do a ls -al on /usr/local/lib/python2.7 I am looking for what are the perms on dist-packages itself. |
SOLVED: In Debian 9 PHP 7 is configred for security to disable functions: escapesshellarg, proc_open, proc_close, proc_get_status, shell_exec. Therefor I deleted from disable_functions modules presented. |
Interesting, didn't know about the default disabled functions on debian. Nice find! |
I close the issue as you have resolved it. Feel free to tell me if I should reopen it for any reason. |
This template is meant for bug reports, if you have a feature request, please be as descriptive as possible and delete the template
If you would like to report a bug, please fill the template bellow
Work environment
Expected behavior
Stix, Cybox, Mixbox report ok in sever diagnostics
Actual behavior
Mitre's STIX and Cybox python libraries have to be installed in order for MISP's STIX export to work. Make sure that you install them (as described in the MISP installation instructions) if you receive an error below.
If you run into any issues here, make sure that both STIX and CyBox are installed as described in the INSTALL.txt file. The required versions are:
STIX: 1.1.1.4
CyBox: 2.1.0.12
mixbox: 1.0.2
Other versions might work but are not tested / recommended.
STIX and Cybox libraries....STIX or CyBox or mixbox library not installed correctly
Steps to reproduce the behavior
I have logged into the web portal, and click Administration, Server Settings Diagnostics
Logs, screenshots, configuration dump, ...
/var/www/MISP/app/tmp/logs# more exec-errors.log
Traceback (most recent call last):
File "/var/www/MISP/app/files/scripts/misp2stix_framing.py", line 2, in
from misp2cybox import *
File "/var/www/MISP/app/files/scripts/misp2cybox.py", line 1, in
from cybox.core import Object, Observable, ObservableComposition
ImportError: No module named cybox.core
The text was updated successfully, but these errors were encountered: