Skip to content

Commit

Permalink
Merge pull request #751 from TheHive-Project/feature/emailrep_v2
Browse files Browse the repository at this point in the history
added key to emailrep
  • Loading branch information
garanews authored Apr 27, 2020
2 parents 6263ff1 + 50628b0 commit 48fb4d2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 38 deletions.
11 changes: 10 additions & 1 deletion analyzers/EmailRep/EmailRep.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,14 @@
"description": "emailrep.io lookup.",
"dataTypeList": ["mail"],
"command": "EmailRep/emailrep_analyzer.py",
"baseConfig": "EmailRep"
"baseConfig": "EmailRep",
"configurationItems": [
{
"name": "key",
"description": "Define the API Key",
"type": "string",
"multi": false,
"required": false
}
]
}
33 changes: 0 additions & 33 deletions analyzers/EmailRep/emailrep.py

This file was deleted.

10 changes: 6 additions & 4 deletions analyzers/EmailRep/emailrep_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
# encoding: utf-8

from cortexutils.analyzer import Analyzer
from emailrep import EmailRepException, EmailRep
from emailrep import EmailRep


class EmailRepAnalyzer(Analyzer):
def __init__(self):
Analyzer.__init__(self)
self.key = self.get_param('config.key', None)


def summary(self, raw):
taxonomies = []
Expand All @@ -32,10 +34,10 @@ def run(self):
data = self.get_data()

try:
emailRep = EmailRep()
result = emailRep.get(data)
emailRep = EmailRep(self.key)
result = emailRep.query(data)
self.report(result)
except EmailRepException as e:
except Exception as e:
self.error(str(e))


Expand Down
1 change: 1 addition & 0 deletions analyzers/EmailRep/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cortexutils
requests
emailrep

0 comments on commit 48fb4d2

Please sign in to comment.