Update EmailRep analyzer

Catch up the latest API response schema
This commit is contained in:
Manabu Niseki 2019-12-19 23:52:08 +09:00
parent 7693831902
commit d1d9df2832
2 changed files with 19 additions and 15 deletions

View File

@ -14,17 +14,17 @@ class EmailRepAnalyzer(Analyzer):
level = "info"
namespace = "EmailRep"
score = raw.get("score")
if score is not None:
score = int(score)
if score < 50:
level = "suspicious"
else:
level = "safe"
suspicious = raw.get("suspicious", False)
if suspicious:
level = "suspicious"
else:
level = "safe"
taxonomies.append(
self.build_taxonomy(level, namespace, "Reputation", score)
)
references = raw.get("references", 0)
taxonomies.append(
self.build_taxonomy(level, namespace, "References", references)
)
return {"taxonomies": taxonomies}

View File

@ -1,4 +1,4 @@
<div class="report" ng-if="success">
<div class="report-SecurityTrails" ng-if="success">
<div class="panel panel-info">
<div class="panel-heading">
emailrep.io lookup ({{ content.mail || "-" }})
@ -9,17 +9,21 @@
</div>
<div ng-if="(content | json) !== '{}'">
<dl class=" dl-horizontal">
<dt>Score:</dt>
<dd class="wrap">{{ content.score || "-" }}</dd>
<dt>Reputation:</dt>
<dd class="wrap">{{ content.reputation || "-" }}</dd>
</dl>
<dl class=" dl-horizontal">
<dt>Suspicious:</dt>
<dd class="wrap">{{ content.suspicious || "-" }}</dd>
</dl>
<dl class="dl-horizontal">
<dt>References:</dt>
<dd class="wrap">{{ content.references || "-" }}</dd>
</dl>
<dl class="dl-horizontal" ng-if="content.profiles.length !== 0">
<dl class="dl-horizontal" ng-if="content.details.profiles.length !== 0">
<dt>Profiles:</dt>
<dd class="wrap">
<ul ng-repeat="profile in content.profiles">
<ul ng-repeat="profile in content.details.profiles">
<li>{{ profile }}</li>
</ul>
</dd>