Skip to content

Commit

Permalink
Merge pull request #740 from TheHive-Project/feature/fix_yeti
Browse files Browse the repository at this point in the history
fix multuple yeti issues
  • Loading branch information
garanews authored Apr 24, 2020
2 parents 70325e2 + 9153de4 commit c7bc691
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 8 additions & 0 deletions analyzers/Yeti/Yeti.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
"type": "string",
"multi": false,
"required": false
},
{
"name": "verify_ssl",
"description": "Verify SSL certificate",
"type": "boolean",
"multi": false,
"required": true,
"defaultValue": true
}
]
}
2 changes: 1 addition & 1 deletion analyzers/Yeti/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cortexutils
git+https://github.com/yeti-platform/pyeti ; python_version<='2.7'
git+https://github.com/yeti-platform/pyeti
6 changes: 2 additions & 4 deletions analyzers/Yeti/yeti.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def __init__(self):
Analyzer.__init__(self)
self.url = self.get_param('config.url', None, 'Missing URL for Yeti API')
self.api_key = self.get_param('config.api_key')
self.verify_ssl = self.get_param("config.verify_ssl", True, None)

def summary(self, raw):
count = len(raw.get('findings', []))
Expand All @@ -26,15 +27,12 @@ def summary(self, raw):
return result

def run(self):
api = pyeti.YetiApi("{}/api/".format(self.url), api_key=self.api_key)
api = pyeti.YetiApi("{}/api/".format(self.url), api_key=self.api_key, verify_ssl=self.verify_ssl)
data = self.get_data()

try:
result = api.observable_search(value=data)

if not result:
self.error('Service unavailable, please check if Yeti server is running')

self.report({
'findings': result
})
Expand Down

0 comments on commit c7bc691

Please sign in to comment.