StamusNetworks / scirius

Scirius is a web application for Suricata ruleset management and threat hunting.
GNU General Public License v3.0
614 stars 150 forks source link

Unbale to run manage.py script #231

Open ngms17 opened 3 years ago

ngms17 commented 3 years ago

Hello,

Getting this error while running the script.

image

Dont know how to fix this. I need some help

pevma commented 3 years ago

Which Scirius version do you use and what is the command you are trying to execute?

ngms17 commented 3 years ago

Now i am trying to execute "python3 manage.py migrate"

Its giving me this error. root@suricata:~/scirius# python3 manage.py migrate Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "/usr/local/lib/python3.6/dist-packages/django/core/management/init.py", line 419, in execute_from_command_line utility.execute() File "/usr/local/lib/python3.6/dist-packages/django/core/management/init.py", line 395, in execute django.setup() File "/usr/local/lib/python3.6/dist-packages/django/init.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python3.6/dist-packages/django/apps/registry.py", line 91, in populate app_config = AppConfig.create(entry) File "/usr/local/lib/python3.6/dist-packages/django/apps/config.py", line 224, in create import_module(entry) File "/usr/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 953, in _find_and_load_unlocked ModuleNotFoundError: No module named 'bootstrap3'

ngms17 commented 3 years ago

Following all the commands from the documentation gives me the first error that i have shown

pevma commented 3 years ago

It seems some dependencies are missing. @yodapotatofly can you lend a hand ?

yodapotatofly commented 3 years ago

The missing dependencies usually occurs because scirius is using a python virtual environment. Therefore, python packages (dependencies) are only available from inside the virtual env. The virtual env needs to be activated before running those commands.

I will be able to complete this answer with exact commands tomorrow

yodapotatofly commented 3 years ago

Usually, the path to scirius installation is /usr/share/python/scirius

Following commands should resolve your issue :

cd /usr/share/python/scirius/
. bin/activate
python3 bin/manage.py migrate
deactivate
cd ~
ngms17 commented 3 years ago

Usually, the path to scirius installation is /usr/share/python/scirius

Following commands should resolve your issue :

cd /usr/share/python/scirius/
. bin/activate
python3 bin/manage.py migrate
deactivate
cd ~

But i dont have the following path "cd /usr/share/python/scirius".

Scirius folder is not there

ngms17 commented 3 years ago

Is there any way to remove scirius and remove and the dependencies attached to it?

In order to follow all the commands all over again?

yodapotatofly commented 3 years ago

Is there any way to remove scirius and remove and the dependencies attached to it?

apt purge scirius
apt autoremove
ngms17 commented 3 years ago

Getting this error when executing "npm install -g npm@latest webpack@3.11"

Screenshot 2021-05-12 at 22 45 19
yodapotatofly commented 3 years ago

You could just use the apt package instead of building everything by hand: sudo apt install scirius

However, if you want to build it yourself, please follow those commands for the nodejs part

sudo apt-get install npm
npm install
npm install -g webpack@3.11
webpack
cd hunt
npm install
npm run build
cd ..
ngms17 commented 3 years ago

Using the apt package gives the error "unable to locate the package".

What is the repository?

yodapotatofly commented 3 years ago

What OS are you running ?

ngms17 commented 3 years ago

Ubuntu 18.04

yodapotatofly commented 3 years ago

OK so indeed the debian package would not be the way to go.

First make sure you have the python dependencies :

python -m pip install --upgrade pip wheel setuptools
python -m pip install --upgrade six python-daemon suricatactl
python -m pip install django-bootstrap3==11.1.0 elasticsearch-curator==5.6 django-webpack-loader==0.7 pyinotify
python -m pip install -r requirements.txt  

then execute the commands for the nodejs part :

sudo apt-get install npm

npm install
npm install -g webpack@3.11
webpack
cd hunt
npm install
npm run build
cd ..

You should then be able to go on from there https://scirius.readthedocs.io/en/latest/installation-ce.html#running-scirius-ce