Skip to content

Commit

Permalink
#170 Add tags MISP:type and MISP:category on observable from MISP
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed May 9, 2017
1 parent 12e2550 commit d791bd5
Show file tree
Hide file tree
Showing 4 changed files with 176 additions and 168 deletions.
14 changes: 13 additions & 1 deletion thehive-backend/app/models/Migration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Migration(
c + ("owner" owner)
},

removeEntity("analyzer")(_ false), // analyzer is now stored in cortex
removeEntity("analyzer")(_ true), // analyzer is now stored in cortex

addAttribute("case_artifact", "reports" JsString("{}")), // add short reports in artifact

Expand Down Expand Up @@ -124,6 +124,18 @@ class Migration(
"caseTemplate" mispCaseTemplate,
"status" (misp \ "eventStatus").as[JsString],
"follow" (misp \ "follow").as[JsBoolean])
},
removeEntity("audit") { o
val objectType = (o \ "objectType").asOpt[String]

val r = objectType.contains("alert")
if (r) {
println(s"remove entity $o")
}
else {
println(s"don't remove entity (objectType=$objectType)")
}
r
})
}

Expand Down
1 change: 1 addition & 0 deletions thehive-misp/app/connectors/misp/JsonFormat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ object JsonFormat {
tags JsArray(json \ "EventTag" \\ "name").validate[Seq[String]]
} yield MispAttribute(
id,
category,
tpe,
date,
comment,
Expand Down
1 change: 1 addition & 0 deletions thehive-misp/app/connectors/misp/MispModel.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ case class MispAlert(

case class MispAttribute(
id: String,
category: String,
tpe: String,
date: Date,
comment: String,
Expand Down
Loading

0 comments on commit d791bd5

Please sign in to comment.