Skip to content

Commit

Permalink
#56 update Nessus 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 f462086 commit 0445c08
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
26 changes: 25 additions & 1 deletion analyzers/Nessus/nessus.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,31 @@ def summary(self, raw):
summary["medium"] = count[2]
summary["high"] = count[3]
summary["critical"] = count[4]
return summary

taxonomy = {"level": "info", "namespace": "Nessus", "predicate": "Info", "value": 0}
taxonomies = []

if summary["info"] > 0:
taxonomy["value"] = summary["info"]
taxonomies.append(taxonomy)
if summary["low"] >0:
taxonomy["value"] = summary["low"]
taxonomies.append(taxonomy)
if summary["medium"] >0:
taxonomy["value"] = summary["medium"]
taxonomy["level"] = "suspicious"
taxonomies.append(taxonomy)
if summary["high] >0:
taxonomy["value"] = summary["hugh"]
taxonomy["level"] = "suspicious"
taxonomies.append(taxonomy)
if summary["critical"] >0:
taxonomy["value"] = summary["critical"]
taxonomy["level"] = "malicious"
taxonomies.append(taxonomy)

result = {"taxonomies": taxonomies}
return result

def run(self):
Analyzer.run(self)
Expand Down
8 changes: 3 additions & 5 deletions thehive-templates/Nessus_1_0/short.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<span ng-if="content.info > 0" class="label label-info">Nessus:Info={{content.info}}</span>
<span ng-if="content.low > 0" class="label label-info">Nessus:Low={{content.low}}</span>
<span ng-if="content.medium > 0" class="label label-warning">Nessus:Medium={{content.medium}}</span>
<span ng-if="content.high > 0" class="label label-danger">Nessus:High={{content.high}}</span>
<span ng-if="content.critical > 0" class="label label-danger">Nessus:Critical={{content.critical}}</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 0445c08

Please sign in to comment.