From ae32a19986dd0370eaa04ca8c9ad7ee20995cc24 Mon Sep 17 00:00:00 2001 From: To-om Date: Fri, 17 Jul 2020 13:56:42 +0200 Subject: [PATCH] #1410 Add objectId and objectType to action audits --- .../thehive/connector/cortex/services/ActionSrv.scala | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/services/ActionSrv.scala b/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/services/ActionSrv.scala index fec8bf96c7..62b06c595f 100644 --- a/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/services/ActionSrv.scala +++ b/cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/services/ActionSrv.scala @@ -156,7 +156,15 @@ class ActionSrv @Inject() ( } yield { relatedCase(updated._id) .orElse(get(updated._id).context.headOption()) // FIXME an action context is it an audit context ? - .foreach(relatedEntity => auditSrv.action.update(updated, relatedEntity, Json.obj("status" -> updated.status.toString))) + .foreach(relatedEntity => + auditSrv + .action + .update( + updated, + relatedEntity, + Json.obj("status" -> updated.status.toString, "objectId" -> relatedEntity._id, "objectType" -> relatedEntity._model.label) + ) + ) updated }