Skip to content

Commit

Permalink
#56 update CERT.at 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 99e137e commit 421199e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 15 additions & 0 deletions analyzers/CERTatPassiveDNS/certat_passivedns.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,20 @@ def summary(self, raw):
results = raw.get('results')
return {'hits': len(results)}

def summary(self, raw):

result = {"level":"info", "taxonomy":{"namespace": "CERT.at", "predicate": "PassiveDNS", "value":0}}

results = raw.get('results')
r = len(results)

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

return result


if __name__ == '__main__':
CERTatPassiveDNSAnalyzer().run()
4 changes: 3 additions & 1 deletion thehive-templates/CERTatPassiveDNS_0_1/short.html
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<span class="label label-info">CERT.at:PDNS="{{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>

0 comments on commit 421199e

Please sign in to comment.