File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
thehive-cortex/app/connectors/cortex/services Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import connectors.cortex.models._
13
13
import models .Artifact
14
14
import org .elastic4play .controllers .Fields
15
15
import org .elastic4play .services ._
16
+ import org .elastic4play .services .JsonFormat .attachmentFormat
16
17
import org .elastic4play .{ InternalError , NotFoundError }
17
18
import play .api .libs .json .{ JsObject , Json }
18
19
import play .api .libs .ws .WSClient
@@ -257,7 +258,7 @@ class CortexSrv @Inject() (
257
258
" dataType" → artifact.dataType())
258
259
cortexArtifact = (artifact.data(), artifact.attachment()) match {
259
260
case (Some (data), None ) ⇒ DataArtifact (data, artifactAttributes)
260
- case (None , Some (attachment)) ⇒ FileArtifact (attachmentSrv.source(attachment.id), artifactAttributes)
261
+ case (None , Some (attachment)) ⇒ FileArtifact (attachmentSrv.source(attachment.id), artifactAttributes + ( " attachment " → Json .toJson(attachment)) )
261
262
case _ ⇒ throw InternalError (s " Artifact has invalid data : ${artifact.attributes}" )
262
263
}
263
264
cortexJobJson ← cortex.analyze(analyzerId, cortexArtifact)
You can’t perform that action at this time.
0 commit comments