Skip to content

Commit

Permalink
#56 update Farsight DNSDB summary() and short reports
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeleonard committed Jun 15, 2017
1 parent ebb9877 commit b247b4f
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
14 changes: 11 additions & 3 deletions analyzers/DNSDB/dnsdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,17 @@ def update_date(self, field, row):
return row

def summary(self, raw):
return {
"records": len(raw["records"])
}
result = {"level": "info", "taxonomy": {"namespace": "Farsight", "predicate": "DNSDB", "value": 0}}

if ("records" in raw):
r = len(raw["records"])

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

return result

def run(self):
try:
Expand Down
4 changes: 3 additions & 1 deletion thehive-templates/DNSDB_DomainName_1_1/short.html
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<span ng-if="content.records" class="label label-info">DNSDB:Domain Name= {{content.records}} records</span>
<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;
4 changes: 3 additions & 1 deletion thehive-templates/DNSDB_IPHistory_1_0/short.html
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<span ng-if="content.records" class="label label-info">DNSDB:IP History= {{content.records}} records</span>
<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;
4 changes: 3 additions & 1 deletion thehive-templates/DNSDB_NameHistory_1_0/short.html
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<span ng-if="content.records" class="label label-info">DNSDB:Name History= {{content.records}} records</span>
<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 b247b4f

Please sign in to comment.