Skip to content

Commit

Permalink
#68 Initial commit of the Yeti analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Jun 30, 2017
1 parent 35f72bb commit e496197
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
15 changes: 15 additions & 0 deletions analyzers/Yeti/Yeti.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "Yeti",
"author": "CERT-BDF",
"license": "AGPL-V3",
"url": "https://github.com/CERT/cortex-analyzers",
"version": "1.0",
"baseConfig": "Yeti",
"config": {
"check_tlp": false,
"max_tlp": 3
},
"description": "Fetch observable details from a Yeti",
"dataTypeList": ["domain", "fqdn", "ip", "url", "hash"],
"command": "Yeti/yeti.py"
}
2 changes: 2 additions & 0 deletions analyzers/Yeti/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cortexutils
git+https://github.com/yeti-platform/pyeti
41 changes: 41 additions & 0 deletions analyzers/Yeti/yeti.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import pyeti
from cortexutils.analyzer import Analyzer


class YetiAnalyzer(Analyzer):

def __init__(self):
Analyzer.__init__(self)
self.url = self.getParam('config.url', None, 'Missing URL for Yeti API')

def summary(self, raw):
count = len(raw.get('findings', []))
value = "\"{}\" item(s)".format(count)

result = {
"taxonomies": [{
"level": "info",
"namespace": "YETI",
"predicate": "Search",
"value": value
}]
}
return result

def run(self):
api = pyeti.YetiApi("{}/api/".format(self.url))
data = self.getData()

try:
result = api.observable_search(value=data)
self.report({
'findings': result
})
except:
self.error('An issue occurred while calling Yeyi API')

if __name__ == '__main__':
YetiAnalyzer().run()

0 comments on commit e496197

Please sign in to comment.