Skip to content

Commit

Permalink
#300 Set severity to medium if threat level is out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Sep 5, 2017
1 parent a5d9fed commit bf1c866
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions thehive-misp/app/connectors/misp/JsonFormat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ object JsonFormat {
date = new Date(timestamp.toLong * 1000)
publishTimestamp (json \ "publish_timestamp").validate[String]
publishDate = new Date(publishTimestamp.toLong * 1000)
threatLevel (json \ "threat_level_id").validate[String]
threatLevelString (json \ "threat_level_id").validate[String]
threatLevel = threatLevelString.toLong
isPublished (json \ "published").validate[Boolean]
} yield MispAlert(
org,
Expand All @@ -41,7 +42,7 @@ object JsonFormat {
isPublished,
s"#$eventId ${info.trim}",
s"Imported from MISP Event #$eventId, created at $date",
4 - threatLevel.toLong,
if (0 < threatLevel && threatLevel < 4) 4 - threatLevel else 2,
alertTags,
tlp,
"")
Expand Down

0 comments on commit bf1c866

Please sign in to comment.