Skip to content

Commit

Permalink
#56 update CIRCL PassiveDNS summary() and short reports
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeleonard committed Jun 13, 2017
1 parent f42f98c commit 605bd1f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
17 changes: 16 additions & 1 deletion analyzers/CIRCLPassiveDNS/circl_passivedns.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,22 @@ def query(self, domain):
return clean_result

def summary(self, raw):
return {'hits': len(raw.get('results'))}

result = {"level": "info", "taxonomy": {"namespace": "CIRCL", "predicate": "PassiveDNS", "value": 0}}

if ("results" in raw):
r = len(raw.get('results'))

if r == 0 or r == 1:
result["taxonomy"]["value"] = "\"{} hit\"".format(r)
else:
result["taxonomy"]["value"] = "\"{} hits\"".format(r)


return result




def run(self):
query = ''
Expand Down
4 changes: 3 additions & 1 deletion thehive-templates/CIRCLPassiveDNS_1_0/short.html
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<span ng-if="content" class="label label-info">CIRCL:PassiveDNS= {{content.hits}} hits</span>&nbsp;
<span class="label" ng-init="t = content.taxonomy" ng-class="{'info': 'label-info', 'safe': 'label-success', 'suspicious': 'label-warning', 'malicious':'label-danger'}[content.level]">
{{t.namespace}}:{{t.predicate}}={{t.value}}
</span>&nbsp;

0 comments on commit 605bd1f

Please sign in to comment.