Skip to content
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

MISPWarninglists analyzer doesn't work [Bug] #827

Closed
NailBash opened this issue Jul 29, 2020 · 11 comments
Closed

MISPWarninglists analyzer doesn't work [Bug] #827

NailBash opened this issue Jul 29, 2020 · 11 comments
Assignees
Labels
category:bug Issue is related to a bug
Milestone

Comments

@NailBash
Copy link

Describe the bug
MISPWarninglists analyzer doesn't work

To Reproduce
Steps to reproduce the behavior:

  1. Download MISP warninglists
  2. Configure analyzer
  3. See error message "Traceback (most recent call last): File "/opt/Cortex-Analyzers/analyzers/MISPWarningLists/mispwarninglists.py", line 202, in MISPWarninglistsAnalyzer().run() File "/opt/Cortex-Analyzers/analyzers/MISPWarningLists/mispwarninglists.py", line 91, in run for list in self.warninglists:TypeError: 'NoneType' object is not iterable"

изображение

Expected behavior
Normal work of analyzer

Work environment
Cortex runs on Centos 7.

@NailBash NailBash added the category:bug Issue is related to a bug label Jul 29, 2020
@dadokkio
Copy link
Contributor

Hello, from the error I can suppose that you are not using a db but local files. It's that correct?
Using locals file the analyzer require that you have cloned locally the misp-warninglist repo in the path specified in the settings.
If you have done this step double check if the path has been set properly.

@NailBash
Copy link
Author

Hello, from the error I can suppose that you are not using a db but local files. It's that correct?
Using locals file the analyzer require that you have cloned locally the misp-warninglist repo in the path specified in the settings.
If you have done this step double check if the path has been set properly.

Hello, yes I'm using local files, I'm cloned files into my local filesystem
This is my folder with warninglists
изображение
This is configuration in cortex
изображение
I think, that path is correct, I checked it (Copied code which reads the warninglists and launched it by python3. It worked well and readed files)

@NailBash NailBash reopened this Jul 29, 2020
@dadokkio
Copy link
Contributor

The path seems to be correct, so we can start to check why the loop don't add anything to warninglists.
If you run this simple code on the machine:

from glob import glob
import io

files = glob("{}/lists/*/*.json".format("/home/cortex/MISP_warninglists/misp-warninglists"))
for file in files:
	with io.open(file, "r") as fh:
		print(file)

Does it print something?

@NailBash
Copy link
Author

NailBash commented Jul 29, 2020

The path seems to be correct, so we can start to check why the loop don't add anything to warninglists.
If you run this simple code on the machine:

from glob import glob
import io

files = glob("{}/lists/*/*.json".format("/home/cortex/MISP_warninglists/misp-warninglists"))
for file in files:
	with io.open(file, "r") as fh:
		print(file)

Does it print something?

изображение

изображение

I think that this function doesn't return that it should for some reason
изображение

@dadokkio
Copy link
Contributor

Ok, then probably is my code wrongly assuming you wants to use db.
Can you check if using this code everything works?

self.warninglists = self.readwarninglists() if not conn or not USE_DB else None

@NailBash
Copy link
Author

Ok, then probably is my code wrongly assuming you wants to use db.
Can you check if using this code everything works?

self.warninglists = self.readwarninglists() if not conn or not USE_DB else None

изображение

изображение

изображение

@dadokkio
Copy link
Contributor

Ok, can now test the change I proposed?

@NailBash
Copy link
Author

NailBash commented Jul 29, 2020

Ok, can now test the change I proposed?

This is fine I think, if indicator doesn't matches in warninglists?
image

@NailBash
Copy link
Author

image

It's ok for local filesystem?

@dadokkio
Copy link
Contributor

Yes, this is the reason why we decide to add postgres as backend.
The first import in the db takes some times but then it returns answer in millisec.

We used to run the analyzer with hundreds of observables and it ran for a lot of hours.

@jeromeleonard jeromeleonard added this to the 2.9.0 milestone Aug 4, 2020
@garanews
Copy link
Contributor

fixed in 2.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bug Issue is related to a bug
Projects
None yet
Development

No branches or pull requests

4 participants