Skip to content

Commit

Permalink
Merge pull request #575 from ninoseki/update-emailrep
Browse files Browse the repository at this point in the history
Update EmailRep analyzer
  • Loading branch information
3c7 committed Dec 19, 2019
2 parents 7693831 + d1d9df2 commit 63a1b86
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
22 changes: 11 additions & 11 deletions analyzers/EmailRep/emailrep_analyzer.py
Expand Up @@ -14,17 +14,17 @@ def summary(self, raw):
level = "info"
namespace = "EmailRep"

score = raw.get("score")
if score is not None:
score = int(score)
if score < 50:
level = "suspicious"
else:
level = "safe"

taxonomies.append(
self.build_taxonomy(level, namespace, "Reputation", score)
)
suspicious = raw.get("suspicious", False)
if suspicious:
level = "suspicious"
else:
level = "safe"

references = raw.get("references", 0)

taxonomies.append(
self.build_taxonomy(level, namespace, "References", references)
)

return {"taxonomies": taxonomies}

Expand Down
14 changes: 9 additions & 5 deletions thehive-templates/EmailRep_1_0/long.html
@@ -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 || "-" }})
Expand All @@ -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>
Expand Down

0 comments on commit 63a1b86

Please sign in to comment.