mirror of https://github.com/MISP/PyMISP
fix: Update dependencies for VT generator.
parent
0be549a843
commit
78eb6e3080
|
@ -20,7 +20,7 @@ install:
|
|||
- pip install -U nose pip setuptools
|
||||
- pip install coveralls codecov requests-mock
|
||||
- pip install git+https://github.com/kbandla/pydeep.git
|
||||
- pip install .[fileobjects,neo,openioc]
|
||||
- pip install .[fileobjects,neo,openioc,virustotal]
|
||||
- pushd tests
|
||||
- git clone https://github.com/viper-framework/viper-test-files.git
|
||||
- popd
|
||||
|
|
|
@ -4,7 +4,12 @@
|
|||
import re
|
||||
|
||||
import requests
|
||||
import validators
|
||||
try:
|
||||
import validators
|
||||
has_validators = True
|
||||
except ImportError:
|
||||
has_validators = False
|
||||
|
||||
|
||||
from .abstractgenerator import AbstractMISPObjectGenerator
|
||||
from .. import InvalidMISPObject
|
||||
|
@ -48,6 +53,8 @@ class VTReportObject(AbstractMISPObjectGenerator):
|
|||
|
||||
:ioc: Indicator to search VirusTotal for
|
||||
'''
|
||||
if not has_validators:
|
||||
raise Exception('You need to install validators: pip install validators')
|
||||
if validators.url(ioc):
|
||||
return "url"
|
||||
elif re.match(r"\b([a-fA-F0-9]{32}|[a-fA-F0-9]{40}|[a-fA-F0-9]{64})\b", ioc):
|
||||
|
|
3
setup.py
3
setup.py
|
@ -30,7 +30,8 @@ setup(
|
|||
install_requires=['six', 'requests', 'python-dateutil', 'jsonschema', 'setuptools>=36.4'],
|
||||
extras_require={'fileobjects': ['lief>=0.8', 'python-magic'],
|
||||
'neo': ['py2neo'],
|
||||
'openioc': ['beautifulsoup4']},
|
||||
'openioc': ['beautifulsoup4'],
|
||||
'virustotal': ['validators']},
|
||||
tests_require=[
|
||||
'jsonschema',
|
||||
'python-dateutil',
|
||||
|
|
Loading…
Reference in New Issue