Skip to content

Commit

Permalink
#56 update Google Safebrowsing summar() and short reports
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeleonard committed Jun 13, 2017
1 parent 6827f09 commit 6f0ebbe
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions analyzers/GoogleSafebrowsing/safebrowsing_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,21 @@ def __init__(self):
)

def summary(self, raw):
result = {"matches":0}

result = {"level":"info", "taxonomy":{"namespace": "Google", "predicate": "Safebrowsing", "value":0}}

if ("results" in raw):
result["matches"] = len(raw['results'])
r = len(raw['results'])

if r == 0 or r == 1:
result["taxonomy"]["value"] = "\"{} match\"".format(r)
else:
result["taxonomy"]["value"] = "\"{} matches\"".format(r)

if r > 0:
result["level"] = "malicious"
# level : info, safe, suspicious, malicious

return result

def run(self):
Expand Down

0 comments on commit 6f0ebbe

Please sign in to comment.