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

fix multuple yeti issues #740

Merged
merged 1 commit into from
Apr 24, 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
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