StamusNetworks / scirius

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

hunt not working. #164

Closed south-devel closed 5 years ago

south-devel commented 5 years ago

When I try to start hunt. It cause IOError.

Internal Server Error: /rules/hunt Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py", line 41, in inner response = get_response(request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 187, in _get_response response = self.process_exception_by_middleware(e, request) File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 185, in _get_response response = wrapped_callback(request, *callback_args, *callback_kwargs) File "/root/scirius-scirius-3.0.1/rules/views.py", line 1990, in hunt return scirius_render(request, 'rules/hunt.html', context) File "/root/scirius-scirius-3.0.1/scirius/utils.py", line 146, in scirius_render return render(request, template, context) File "/usr/local/lib/python2.7/dist-packages/django/shortcuts.py", line 30, in render content = loader.render_to_string(template_name, context, request, using=using) File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 68, in render_to_string return template.render(context, request) File "/usr/local/lib/python2.7/dist-packages/django/template/backends/django.py", line 66, in render return self.template.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 207, in render return self._render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 199, in _render return self.nodelist.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 990, in render bit = node.render_annotated(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 957, in render_annotated return self.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/library.py", line 203, in render output = self.func(resolved_args, **resolved_kwargs) File "/usr/local/lib/python2.7/dist-packages/webpack_loader/templatetags/webpack_loader.py", line 12, in render_bundle tags = utils.get_as_tags(bundle_name, extension=extension, config=config, attrs=attrs) File "/usr/local/lib/python2.7/dist-packages/webpack_loader/utils.py", line 45, in get_as_tags bundle = _get_bundle(bundle_name, extension, config) File "/usr/local/lib/python2.7/dist-packages/webpack_loader/utils.py", line 23, in _get_bundle bundle = get_loader(config).get_bundle(bundle_name) File "/usr/local/lib/python2.7/dist-packages/webpack_loader/loader.py", line 60, in get_bundle assets = self.get_assets() File "/usr/local/lib/python2.7/dist-packages/webpack_loader/loader.py", line 39, in get_assets return self._load_assets() File "/usr/local/lib/python2.7/dist-packages/webpack_loader/loader.py", line 32, in _load_assets self.config['STATS_FILE'])) IOError: Error reading /root/scirius-scirius-3.0.1/rules/static/webpack-stats.prod.json. Are you sure webpack has generated the file and the path is correct? [07/Dec/2018 16:19:30] "GET /rules/hunt HTTP/1.1" 500 145041

And /rules/static/ dose not contain webpack-stats.prod.json file.

root@SELKS:~/scirius-scirius-3.0.1/rules/static# ls -al total 24 drwxrwxr-x 6 root root 4096 Dec 7 16:09 . drwxrwxr-x 7 root root 4096 Dec 7 16:08 .. drwxr-xr-x 2 root root 4096 Dec 7 16:09 dist drwxrwxr-x 2 root root 4096 Nov 29 22:41 fonts drwxrwxr-x 2 root root 4096 Nov 29 22:41 js drwxrwxr-x 2 root root 4096 Nov 29 22:41 rules

Any other function work fine.

How can I fix it?

pevma commented 5 years ago

Ho do you start Scirius ? Is it a stand alone installation or as part of SELKS ? Do you get that error only when going to the Hunt page?

regit commented 5 years ago

You need to run npm to build the JS code:

    - cd hunt
    - npm install
    - npm run build

I'm gonna update the doc to reflect that

south-devel commented 5 years ago

@regit It works. Thanks!

pevma commented 5 years ago

Thanks for the confirmation!