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

added key to emailrep #751

Merged
merged 1 commit into from
Apr 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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