diff --git a/app/org/thp/cortex/models/Artifact.scala b/app/org/thp/cortex/models/Artifact.scala index f199ddabf..b8a7b108d 100644 --- a/app/org/thp/cortex/models/Artifact.scala +++ b/app/org/thp/cortex/models/Artifact.scala @@ -8,7 +8,7 @@ import org.elastic4play.models.{ AttributeDef, EntityDef, AttributeFormat ⇒ F, trait ArtifactAttributes { _: AttributeDef ⇒ val dataType = attribute("dataType", F.stringFmt, "Type of the artifact", O.readonly) - val data = optionalAttribute("data", F.stringFmt, "Content of the artifact", O.readonly) + val data = optionalAttribute("data", F.rawFmt, "Content of the artifact", O.readonly) val attachment = optionalAttribute("attachment", F.attachmentFmt, "Artifact file content", O.readonly) val tlp = attribute("tlp", TlpAttributeFormat, "TLP level", 2L) val tags = multiAttribute("tags", F.stringFmt, "Artifact tags") diff --git a/app/org/thp/cortex/models/Job.scala b/app/org/thp/cortex/models/Job.scala index 9462202bd..183949676 100644 --- a/app/org/thp/cortex/models/Job.scala +++ b/app/org/thp/cortex/models/Job.scala @@ -25,14 +25,14 @@ trait JobAttributes { val startDate = optionalAttribute("startDate", F.dateFmt, "Analysis start date") val endDate = optionalAttribute("endDate", F.dateFmt, "Analysis end date") val dataType = attribute("dataType", F.stringFmt, "Type of the artifact", O.readonly) - val data = optionalAttribute("data", F.stringFmt, "Content of the artifact", O.readonly) + val data = optionalAttribute("data", F.rawFmt, "Content of the artifact", O.readonly) val attachment = optionalAttribute("attachment", F.attachmentFmt, "Artifact file content", O.readonly) val tlp = attribute("tlp", TlpAttributeFormat, "TLP level", 2L) val pap = attribute("pap", TlpAttributeFormat, "PAP level", 2L) val message = optionalAttribute("message", F.textFmt, "Message associated to the analysis") val errorMessage = optionalAttribute("message", F.textFmt, "Message returned by the worker when it fails") - val parameters = attribute("parameters", F.stringFmt, "Parameters for this job", "{}") - val input = optionalAttribute("input", F.textFmt, "Data sent to worker") + val parameters = attribute("parameters", F.rawFmt, "Parameters for this job", "{}") + val input = optionalAttribute("input", F.rawFmt, "Data sent to worker") val fromCache = optionalAttribute("fromCache", F.booleanFmt, "Indicates if cache is used", O.form) val tpe = attribute("type", F.enumFmt(WorkerType), "", O.readonly) val lbel = optionalAttribute("label", F.stringFmt, "Label of the job") diff --git a/app/org/thp/cortex/models/Report.scala b/app/org/thp/cortex/models/Report.scala index 15e03c0a3..eff2f1f26 100644 --- a/app/org/thp/cortex/models/Report.scala +++ b/app/org/thp/cortex/models/Report.scala @@ -7,9 +7,9 @@ import play.api.libs.json.JsObject import org.elastic4play.models.{ AttributeDef, EntityDef, AttributeFormat ⇒ F, AttributeOption ⇒ O, ChildModelDef } trait ReportAttributes { _: AttributeDef ⇒ - val full = attribute("full", F.textFmt, "Full content of the report", O.readonly) - val summary = attribute("summary", F.textFmt, "Summary of the report", O.readonly) - val operations = attribute("operations", F.textFmt, "Update operations applied at the end of the job", "[]", O.unaudited) + val full = attribute("full", F.rawFmt, "Full content of the report", O.readonly) + val summary = attribute("summary", F.rawFmt, "Summary of the report", O.readonly) + val operations = attribute("operations", F.rawFmt, "Update operations applied at the end of the job", "[]", O.unaudited) } @Singleton diff --git a/app/org/thp/cortex/models/User.scala b/app/org/thp/cortex/models/User.scala index 81710057d..6a374c968 100644 --- a/app/org/thp/cortex/models/User.scala +++ b/app/org/thp/cortex/models/User.scala @@ -21,8 +21,8 @@ trait UserAttributes { _: AttributeDef ⇒ val roles = multiAttribute("roles", RoleAttributeFormat, "Comma separated role list (READ, WRITE and ADMIN)") val status = attribute("status", F.enumFmt(UserStatus), "Status of the user", UserStatus.Ok) val password = optionalAttribute("password", F.stringFmt, "Password", O.sensitive, O.unaudited) - val avatar = optionalAttribute("avatar", F.stringFmt, "Base64 representation of user avatar image", O.unaudited) - val preferences = attribute("preferences", F.stringFmt, "User preferences", "{}", O.sensitive, O.unaudited) + val avatar = optionalAttribute("avatar", F.rawFmt, "Base64 representation of user avatar image", O.unaudited) + val preferences = attribute("preferences", F.rawFmt, "User preferences", "{}", O.sensitive, O.unaudited) val organization = attribute("organization", F.stringFmt, "User organization") } diff --git a/app/org/thp/cortex/models/Worker.scala b/app/org/thp/cortex/models/Worker.scala index 9ebc32393..8b9a7660b 100644 --- a/app/org/thp/cortex/models/Worker.scala +++ b/app/org/thp/cortex/models/Worker.scala @@ -37,7 +37,7 @@ trait WorkerAttributes { _: AttributeDef ⇒ val command = optionalAttribute("command", F.textFmt, "Worker command") val dockerImage = optionalAttribute("dockerImage", F.textFmt, "Worker docker image") val dataTypeList = multiAttribute("dataTypeList", F.stringFmt, "List of data type this worker can manage") - val configuration = attribute("configuration", F.textFmt, "Configuration of the worker", O.sensitive) + val configuration = attribute("configuration", F.rawFmt, "Configuration of the worker", O.sensitive) val baseConfig = attribute("baseConfig", F.stringFmt, "Base configuration key") val rate = optionalAttribute("rate", F.numberFmt, "Number ") val rateUnit = optionalAttribute("rateUnit", F.enumFmt(RateUnit), "") diff --git a/app/org/thp/cortex/models/WorkerConfig.scala b/app/org/thp/cortex/models/WorkerConfig.scala index 75dd67336..84d5a26f4 100644 --- a/app/org/thp/cortex/models/WorkerConfig.scala +++ b/app/org/thp/cortex/models/WorkerConfig.scala @@ -10,7 +10,7 @@ import org.thp.cortex.models.JsonFormat.workerTypeFormat trait WorkerConfigAttributes { _: AttributeDef ⇒ val name = attribute("name", F.stringFmt, "Worker name") - val config = attribute("config", F.textFmt, "Configuration of worker", O.sensitive) + val config = attribute("config", F.rawFmt, "Configuration of worker", O.sensitive) val tpe = attribute("type", F.enumFmt(WorkerType), "", O.readonly) } diff --git a/app/org/thp/cortex/models/package.scala b/app/org/thp/cortex/models/package.scala index 4ee41c710..bafbee1ba 100644 --- a/app/org/thp/cortex/models/package.scala +++ b/app/org/thp/cortex/models/package.scala @@ -1,5 +1,5 @@ package org.thp.cortex package object models { - val modelVersion = 2 + val modelVersion = 3 }