Skip to content

Commit

Permalink
#50 #23 review CSB PR. Update summary() to generate taxonomies
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeleonard committed Jul 10, 2017
1 parent 0efec83 commit 2728fd5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
19 changes: 18 additions & 1 deletion analyzers/CuckooSandbox/cuckoosandbox_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,30 @@ def __init__(self):
#self.networktimeout = self.getParam('config.networktimeout', 30, None)

def summary(self, raw):
taxonomies = []
level = "safe"
namespace = "CSB"
predicate = "Malscore"
value = "\"0\""

result = {
'service': self.service,
'dataType': self.data_type
}
result["malscore"] = raw.get("malscore", None)
result["malfamily"] = raw.get("malfamily", None)
return result

if result["malscore"] > 6.5:
level = "malicious"
elif result["malscore"] > 2:
level = "suspicious"
elif result["malscore"] > 0:
level = "safe"

taxonomies.append(self.build_taxonomy(level, namespace, predicate, result["malscore"]))
taxonomies.append(self.build_taxonomy(level, namespace, "Malfamily", result["malfamily"]))

return taxonomies

def run(self):
Analyzer.run(self)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<span class="label" ng-class="{'label-info': content.malscore<=2, 'label-warning': content.malscore>2 && content.malscore<=6.5, 'label-danger': content.malscore >6.5}">
Cuckoo Sandbox=
<span ng-if="content.malscore">CSB:Malscore={{content.malscore}}</span>
<span ng-if="content.malfamily">CSB:Malfamily=[{{ content.malfamily}}]</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 2728fd5

Please sign in to comment.