From 8bf9dd732a02e8199892f4501f89834ef68d6040 Mon Sep 17 00:00:00 2001 From: Vincent Debergue Date: Thu, 10 Jun 2021 11:32:34 +0200 Subject: [PATCH] #2058 Fix missing tag when importing alerts from misp --- .../org/thp/thehive/connector/misp/services/MispImportSrv.scala | 2 +- .../thp/thehive/connector/misp/services/MispImportSrvTest.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/misp/connector/src/main/scala/org/thp/thehive/connector/misp/services/MispImportSrv.scala b/misp/connector/src/main/scala/org/thp/thehive/connector/misp/services/MispImportSrv.scala index 32246c5e54..2411bb7b91 100644 --- a/misp/connector/src/main/scala/org/thp/thehive/connector/misp/services/MispImportSrv.scala +++ b/misp/connector/src/main/scala/org/thp/thehive/connector/misp/services/MispImportSrv.scala @@ -72,7 +72,7 @@ class MispImportSrv @Inject() ( read = false, follow = true, organisationId = organisationId, - tags = event.tags.map(_.name), + tags = s"src:${event.orgc}" +: event.tags.map(_.name), caseId = EntityId.empty ) } diff --git a/misp/connector/src/test/scala/org/thp/thehive/connector/misp/services/MispImportSrvTest.scala b/misp/connector/src/test/scala/org/thp/thehive/connector/misp/services/MispImportSrvTest.scala index b610f6c63e..8321f93d88 100644 --- a/misp/connector/src/test/scala/org/thp/thehive/connector/misp/services/MispImportSrvTest.scala +++ b/misp/connector/src/test/scala/org/thp/thehive/connector/misp/services/MispImportSrvTest.scala @@ -92,7 +92,7 @@ class MispImportSrvTest(implicit ec: ExecutionContext) extends PlaySpecification pap = 2, read = false, follow = true, - tags = Seq("TH-test", "TH-test-2"), + tags = Seq("src:ORGNAME", "TH-test", "TH-test-2"), organisationId = alert.organisationId, caseId = EntityId.empty )