Skip to content

Commit

Permalink
#133 use Cortex config file
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeleonard committed Feb 26, 2018
1 parent 2e8a443 commit 055d663
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions analyzers/Cymon/cymon_analyzer.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ def domain_blacklist(self, tag, days=1, limit=15, offset=10):
return r.json()


class CymonEngine():
class CymonEngine(object):

def __init__(self):

default_file = 'config.json'
def __init__(self, key):

self.cymon_cat = ['malware',
'botnet',
Expand All @@ -87,11 +85,8 @@ def __init__(self):
'blacklist',
'dnsbl']

if os.path.isfile(default_file):
conf = self.loadSetting(default_file)
c_token = conf['1']['cymon']['token']

self.api = CymonApi(c_token)
self.api = CymonApi(key)

def loadSetting(self, filepath):

Expand Down Expand Up @@ -155,7 +150,9 @@ def __init__(self):

self.service = self.getParam('config.service', None,
'Cymon service is missing')
self.con = CymonEngine()
self.key = self.getParam('config.key', None,
'Cymon API key is missing')
self.con = CymonEngine(self.key)

def summary(self, raw_report):

Expand Down Expand Up @@ -205,7 +202,7 @@ def run(self):

Analyzer.run(self)

data = self.getData()
data = self.get_data()

try:
if self.service == 'Check_IP':
Expand Down

0 comments on commit 055d663

Please sign in to comment.