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 in case GSB value is missing #365

Merged
merged 1 commit into from
Nov 9, 2018

Conversation

garanews
Copy link
Contributor

I noticed that GSB value is not retrieved in json causing "index out of range" error.
This fix checks if fields is available, otherwise go ahead.
If this field is not available anymore we can skip it and remove also from template long. I don't find documentation about this.
Online:
online

The Hive:
cortex

Before the fix:
{ "errorMessage": "Invalid output\nTraceback (most recent call last):\n File \"URLhaus/URLhaus_analyzer.py\", line 50, in <module>\n URLhausAnalyzer().run()\n File \"URLhaus/URLhaus_analyzer.py\", line 23, in run\n 'results': self.search(self.get_data())\n File \"URLhaus/URLhaus_analyzer.py\", line 17, in search\n return URLhaus(indicator).search()\n File \"/opt/Cortex-Analyzers/analyzers/URLhaus/URLhaus.py\", line 42, in search\n return self.parse(res)\n File \"/opt/Cortex-Analyzers/analyzers/URLhaus/URLhaus.py\", line 62, in parse\n \"reporter\": cols[5].text\nIndexError: list index out of range\n", "input": null, "success": false, "artifacts": [] }

I noticed that GSB value is not retrieved in json causing "index out of range" error.
This fix checks if fields is available, otherwise go ahead.
If this field is not available anymore we can skip it and remove also from template long. I don't find documentation about this.
@3c7 3c7 added this to the 1.14.1 milestone Oct 27, 2018
@3c7 3c7 added category:bug Issue is related to a bug scope:analyzer Issue is analyzer related status:pr-submitted labels Oct 27, 2018
@3c7 3c7 changed the base branch from master to hotfix/1.14.1 November 9, 2018 10:06
@3c7 3c7 merged commit b0041a6 into TheHive-Project:hotfix/1.14.1 Nov 9, 2018
@3c7
Copy link
Contributor

3c7 commented Nov 9, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bug Issue is related to a bug scope:analyzer Issue is analyzer related status:pr-submitted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants