Skip to content

Commit

Permalink
#56 update Fortiguard URLCategory 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 a05169e commit 60b64e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 10 additions & 1 deletion analyzers/Fortiguard/urlcategory.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@
class URLCategoryAnalyzer(Analyzer):

def summary(self, raw):
return {'category': raw['category']}
taxonomy = {"level": "info", "namespace": "Fortiguard", "predicate": "URLCat", "value": 0}
taxonomies = []

if 'category' in raw:
r = raw.get('category')
taxonomy["value"] = r
taxonomies.append(taxonomy)

result = {"taxonomies": taxonomies}
return result

def run(self):
Analyzer.run(self)
Expand Down
7 changes: 3 additions & 4 deletions thehive-templates/Fortiguard_URLCategory_1_1/short.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<span class="label label-info">
Fortiguard:URLCat=
<span ng-if="content.category">{{content.category}}&nbsp;</span>
</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 60b64e1

Please sign in to comment.