diff --git a/ScalliGraph b/ScalliGraph index c1a5fb613b..3891a432b6 160000 --- a/ScalliGraph +++ b/ScalliGraph @@ -1 +1 @@ -Subproject commit c1a5fb613ba4152455de77fa594e6e604aa0546b +Subproject commit 3891a432b6508da46a2db6d4595c6ed992c4f5da diff --git a/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala index 8853f0c9cc..4ca40c5ddd 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/ObservableCtrl.scala @@ -420,7 +420,6 @@ class PublicObservable @Inject() ( Query[Traversal.V[Observable], Traversal.V[Case]]("case", (observableSteps, _) => observableSteps.`case`), Query[Traversal.V[Observable], Traversal.V[Alert]]("alert", (observableSteps, _) => observableSteps.alert) ) - lazy val hasher: Hasher = Hasher("SHA-256") override val publicProperties: PublicProperties = PublicPropertyListBuilder[Observable] .property("status", UMapping.string)(_.select(_.constant("Ok")).readonly) .property("startDate", UMapping.date)(_.select(_._createdAt).readonly) diff --git a/thehive/app/org/thp/thehive/models/Observable.scala b/thehive/app/org/thp/thehive/models/Observable.scala index 63d6b21c1c..62902a69f0 100644 --- a/thehive/app/org/thp/thehive/models/Observable.scala +++ b/thehive/app/org/thp/thehive/models/Observable.scala @@ -7,7 +7,6 @@ import org.thp.scalligraph.utils.Hasher import org.thp.scalligraph.{BuildEdgeEntity, BuildVertexEntity, EntityId} import java.util.Date -import scala.util.Try @BuildEdgeEntity[Observable, KeyValue] case class ObservableKeyValue() @@ -80,7 +79,7 @@ object UseHashToIndex extends ImmenseTermProcessor with ImmenseStringTermFilter private val hasher: Hasher = Hasher("SHA-256") def hashToIndex(value: String): Option[String] = - if (value.length > termSizeLimit) Some(hasher.fromString(value).head.toString) + if (value.length > termSizeLimit) Some("sha256/" + hasher.fromString(value).head.toString) else None override def apply[V](vertex: Vertex, property: VertexProperty[V]): Boolean = { @@ -95,7 +94,7 @@ object UseHashToIndex extends ImmenseTermProcessor with ImmenseStringTermFilter | message=${UMapping.string.optional.getProperty(vertex, "message").getOrElse("")} | tags=${UMapping.string.sequence.getProperty(vertex, "message").mkString(", ")}""".stripMargin) strProp.remove() - vertex.property(strProp.key(), hasher.fromString(currentValue).head.toString) + vertex.property(strProp.key(), "sha256/" + hasher.fromString(currentValue).head.toString) } case "Data" =>