#74 fix short report for scan service

This commit is contained in:
Jerome Leonard 2017-07-13 09:01:52 +02:00
parent 0ced7bec60
commit 90364c961c

View File

@ -117,7 +117,16 @@ class VirusTotalAnalyzer(Analyzer):
result["detected_downloaded_samples"] = len(
raw["detected_downloaded_samples"])
if self.service == "scan":
if("scans" in raw):
result["scans"] = len(raw["scans"])
value = "\"{}/{}\"".format(result["positives"], result["total"])
if result["positives"] == 0:
level = "safe"
elif result["positives"] < 5:
level = "suspicious"
else:
level = "malicious"
taxonomies.append(self.build_taxonomy(level, namespace, predicate, value))
return {"taxonomies": taxonomies}