Skip to content

Commit

Permalink
#56 update MaxMind summary() and short reports
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeleonard committed Jun 16, 2017
1 parent 9776282 commit 7c3262e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions analyzers/MaxMind/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@ def dumpTraits(self, traits):
}

def summary(self, raw):
result = {}
taxonomy = {"level": "info", "namespace": "MaxMind", "predicate": "Location", "value": 0}
taxonomies = []

if("continent" in raw):
result["country"] = raw["country"]["name"]
result["continent"] = raw["continent"]["name"]
taxonomy["value"] = "\"{}/{}\"".format(raw["country"]["name"], raw["continent"]["name"])
taxonomies.append(taxonomy)

result = {"taxonomies":taxonomies}
return result

def run(self):
Expand Down
4 changes: 3 additions & 1 deletion thehive-templates/MaxMind_GeoIP_2_0/short.html
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<span class="label label-info">MaxMind:IP location= {{content.country}} / {{content.continent}}</span>
<span class="label" ng-repeat="t in content.taxonomies" ng-class="{'info': 'label-info', 'safe': 'label-success', 'suspicious': 'label-warning', 'malicious':'label-danger'}[t.level]">
{{t.namespace}}:{{t.predicate}}={{t.value}}
</span>&nbsp;

0 comments on commit 7c3262e

Please sign in to comment.