Skip to content

Commit

Permalink
#172 Add config "cert_check" to MISP analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Mar 2, 2018
1 parent fffe93f commit fa365dc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
12 changes: 10 additions & 2 deletions analyzers/MISP/MISP.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,17 @@
"required": true
},
{
"name": "cert_path",
"description": "Verify server certificate or path to the CA on the system",
"name": "cert_check",
"description": "Verify server certificate",
"type": "boolean",
"multi": false,
"required": true,
"defaultValue": true
},
{
"name": "cert_path",
"description": "Path to the CA on the system used to check server certificate",
"type": "string",
"multi": true,
"required": false
}
Expand Down
11 changes: 6 additions & 5 deletions analyzers/MISP/misp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ def __init__(self):
Analyzer.__init__(self)

# Fixes #94. Instead of None, the string Unnamed should be passed to MISPClient constructor
name = self.getParam('config.name', None)
if not name:
name = 'Unnamed'
name = self.getParam('config.name', 'Unnamed')
if self.getParam('config.cert_check', True):
ssl = self.getParam('config.cert_path', True)
else:
ssl = False
try:
self.misp = MISPClient(url=self.getParam('config.url', None, 'No MISP url given.'),
key=self.getParam('config.key', None, 'No MISP api key given.'),
ssl=self.getParam('config.certpath', True),
ssl=ssl,
name=name)
except MISPClientError as e:
self.error(str(e))
Expand All @@ -28,7 +30,6 @@ def summary(self, raw):
level = "info"
namespace = "MISP"
predicate = "Search"
value = "\"0\""

data = []
for r in raw['results']:
Expand Down

0 comments on commit fa365dc

Please sign in to comment.