You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From what I understand reading other issues, TheHive4's v0 API is supposed to be backwards compatible with TheHive3's API (Albeit slower).
To check this, I attempted to copy a request made by TheHive3's frontend, and send it to TheHive4, it turns out that sort criterias on fields that were renamed don't seem to work properly.
2020-09-17 12:43:51,842 [INFO] from org.thp.scalligraph.AccessLogFilter in application-akka.actor.default-dispatcher-38 [00000006|] 172.20.144.1 POST /api/case/_search?range=0-15&sort=-flag,-startDate&nstats=true took 3ms and returned 401 65 bytes
2020-09-17 12:44:01,705 [DEBUG] from org.thp.thehive.services.TOTPAuthSrv in application-akka.actor.default-dispatcher-31 [|] session AuthenticationError Operation not supported
2020-09-17 12:44:01,705 [DEBUG] from org.thp.thehive.services.TOTPAuthSrv in application-akka.actor.default-dispatcher-31 [|] basic AuthenticationError Operation not supported
2020-09-17 12:44:01,705 [DEBUG] from org.thp.thehive.services.TOTPAuthSrv in application-akka.actor.default-dispatcher-31 [|] local AuthenticationError Operation not supported
2020-09-17 12:44:01,706 [DEBUG] from org.thp.scalligraph.models.Database in application-akka.actor.default-dispatcher-31 [|3fb9f069] Begin of readonly transaction
2020-09-17 12:44:01,706 [DEBUG] from org.thp.scalligraph.traversal.TraversalOps in application-akka.actor.default-dispatcher-31 [|3fb9f069] Execution of [GraphStep(vertex,[]), HasStep([_label.eq(User), ~label.eq(User), apikey.eq(LBrzDepm8PxAdu3GtUNE6G1HL1Z9Yf2U)])] (headOption)
2020-09-17 12:44:01,723 [DEBUG] from org.thp.scalligraph.models.Database in application-akka.actor.default-dispatcher-31 [|0f2ca978] Begin of readonly transaction
2020-09-17 12:44:01,724 [DEBUG] from org.thp.scalligraph.traversal.TraversalOps in application-akka.actor.default-dispatcher-31 [|0f2ca978] Execution of [GraphStep(vertex,[]), HasStep([_label.eq(User), ~label.eq(User), login.eq(user@local)])] (exists)
2020-09-17 12:44:01,727 [DEBUG] from org.thp.scalligraph.traversal.TraversalOps in application-akka.actor.default-dispatcher-31 [|0f2ca978] Execution of [GraphStep(vertex,[]), HasStep([_label.eq(User), ~label.eq(User), login.eq(user@local)]), VertexStep(OUT,[UserRole],vertex), OrderGlobalStep([[value(_createdAt), asc]]), VertexStep(OUT,[RoleOrganisation],vertex), PropertiesStep([name],value)] (headOption)
2020-09-17 12:44:01,739 [DEBUG] from org.thp.scalligraph.traversal.TraversalOps in application-akka.actor.default-dispatcher-31 [|0f2ca978] Execution of [GraphStep(vertex,[]), HasStep([_label.eq(User), ~label.eq(User), login.eq(user@local)]), TraversalFilterStep([VertexStep(OUT,[UserRole],vertex), VertexStep(OUT,[RoleOrganisation],vertex), HasStep([name.eq(user)])]), HasStep([locked.eq(false)]), ProjectStep([a04011f3-67f6-4cab-9048-21cbddd8198a, 9260a6f4-912a-4554-b4a3-0e4fbbfdf488, a4666900-8344-48a9-a64a-a2ad3d55b9fd],[value(login), value(name), [VertexStep(OUT,[UserRole],vertex), TraversalFilterStep([VertexStep(OUT,[RoleOrganisation],vertex), HasStep([name.eq(user)])]), VertexStep(OUT,[RoleProfile],vertex)]])] (headOption)
2020-09-17 12:44:01,753 [DEBUG] from org.thp.scalligraph.models.Database in application-akka.actor.default-dispatcher-31 [|0f2ca978] End of readonly transaction
2020-09-17 12:44:01,753 [DEBUG] from org.thp.scalligraph.models.Database in application-akka.actor.default-dispatcher-31 [|3fb9f069] End of readonly transaction
2020-09-17 12:44:01,760 [WARN] from org.thp.scalligraph.query.InputFilter in application-akka.actor.default-dispatcher-31 [00000007|] string filter is not supported, it is ignored
2020-09-17 12:44:01,777 [WARN] from org.thp.scalligraph.ErrorHandler in application-akka.actor.default-dispatcher-31 [00000007|] POST /api/case/_search?range=0-15&sort=-flag,-startDate&nstats=true returned 400
org.thp.scalligraph.BadRequestError: Property flag,-startDate for type org.thp.scalligraph.traversal.Traversal.V[org.thp.thehive.models.Case] not found
at org.thp.scalligraph.query.InputSort.$anonfun$apply$2(InputSort.scala:28)
at scala.Option.getOrElse(Option.scala:189)
at org.thp.scalligraph.query.InputSort.$anonfun$apply$1(InputSort.scala:28)
at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:273)
at scala.collection.immutable.List.foreach(List.scala:392)
at scala.collection.TraversableLike.map(TraversableLike.scala:273)
at scala.collection.TraversableLike.map$(TraversableLike.scala:266)
at scala.collection.immutable.List.map(List.scala:298)
at org.thp.scalligraph.query.InputSort.apply(InputSort.scala:23)
at org.thp.scalligraph.query.SortQuery.apply(Query.scala:133)
at org.thp.scalligraph.query.SortQuery.apply(Query.scala:122)
at org.thp.scalligraph.query.ParamQuery$$anon$1.apply(Query.scala:32)
at org.thp.scalligraph.query.ParamQuery$$anon$1.apply(Query.scala:28)
at org.thp.scalligraph.query.Query$$anon$2.apply(Query.scala:49)
at org.thp.scalligraph.query.Query$$anon$2.apply(Query.scala:44)
at org.thp.scalligraph.query.Query$$anon$2.apply(Query.scala:49)
at org.thp.scalligraph.query.Query$$anon$2.apply(Query.scala:44)
at org.thp.scalligraph.query.QueryExecutor.$anonfun$execute$2(QueryExecutor.scala:40)
at org.thp.scalligraph.janus.JanusDatabase.source(JanusDatabase.scala:160)
at org.thp.scalligraph.query.QueryExecutor.$anonfun$execute$1(QueryExecutor.scala:39)
at scala.util.Success.$anonfun$map$1(Try.scala:255)
at scala.util.Success.map(Try.scala:213)
at org.thp.scalligraph.query.QueryExecutor.execute(QueryExecutor.scala:37)
at org.thp.thehive.controllers.v0.QueryCtrl.$anonfun$search$1(QueryCtrl.scala:117)
at org.thp.scalligraph.controllers.Entrypoint$EntryPointBuilder.$anonfun$auth$1(Entrypoint.scala:86)
at org.thp.scalligraph.controllers.Entrypoint$EntryPointBuilder.$anonfun$asyncAuth$3(Entrypoint.scala:107)
at org.scalactic.Good.fold(Or.scala:1229)
at org.thp.scalligraph.controllers.Entrypoint$EntryPointBuilder.$anonfun$asyncAuth$2(Entrypoint.scala:107)
at org.thp.scalligraph.DiagnosticContext$.$anonfun$withRequest$2(ContextPropagatingDisptacher.scala:99)
at org.thp.scalligraph.DiagnosticContext$.saveDiagnosticContext(ContextPropagatingDisptacher.scala:106)
at org.thp.scalligraph.DiagnosticContext$.withRequest(ContextPropagatingDisptacher.scala:97)
at org.thp.scalligraph.controllers.Entrypoint$EntryPointBuilder.$anonfun$asyncAuth$1(Entrypoint.scala:107)
at org.thp.scalligraph.auth.AuthSrvWithActionFunction$$anon$1.$anonfun$invokeBlock$2(AuthSrv.scala:91)
at scala.Option.fold(Option.scala:251)
at org.thp.scalligraph.auth.AuthSrvWithActionFunction$$anon$1.invokeBlock(AuthSrv.scala:90)
at org.thp.scalligraph.auth.AuthSrvWithActionFunction$$anon$1.invokeBlock(AuthSrv.scala:87)
at org.thp.scalligraph.auth.BasicAuthSrv$$anon$1.$anonfun$invokeBlock$1(BasicAuthSrv.scala:52)
at scala.Option.fold(Option.scala:251)
at org.thp.scalligraph.auth.BasicAuthSrv$$anon$1.invokeBlock(BasicAuthSrv.scala:52)
at org.thp.scalligraph.auth.BasicAuthSrv$$anon$1.invokeBlock(BasicAuthSrv.scala:50)
at org.thp.scalligraph.auth.SessionAuthSrv$$anon$1.$anonfun$invokeBlock$1(SessionAuthSrv.scala:87)
at scala.Option.fold(Option.scala:251)
at org.thp.scalligraph.auth.SessionAuthSrv$$anon$1.invokeBlock(SessionAuthSrv.scala:87)
at org.thp.scalligraph.auth.SessionAuthSrv$$anon$1.invokeBlock(SessionAuthSrv.scala:84)
at play.api.mvc.ActionBuilder$$anon$10.$anonfun$invokeBlock$2(Action.scala:408)
at play.api.mvc.ActionBuilderImpl.invokeBlock(Action.scala:441)
at play.api.mvc.ActionBuilderImpl.invokeBlock(Action.scala:439)
at play.api.mvc.ActionBuilder$$anon$10.invokeBlock(Action.scala:408)
at play.api.mvc.ActionBuilder$$anon$10.invokeBlock(Action.scala:404)
at play.api.mvc.ActionBuilder$$anon$9.apply(Action.scala:379)
at play.api.mvc.Action.$anonfun$apply$4(Action.scala:82)
at play.api.libs.streams.StrictAccumulator.$anonfun$mapFuture$4(Accumulator.scala:168)
at scala.util.Try$.apply(Try.scala:213)
at play.api.libs.streams.StrictAccumulator.$anonfun$mapFuture$3(Accumulator.scala:168)
at scala.Function1.$anonfun$andThen$1(Function1.scala:57)
at scala.Function1.$anonfun$andThen$1(Function1.scala:57)
at play.api.libs.streams.StrictAccumulator.run(Accumulator.scala:200)
at play.core.server.AkkaHttpServer.$anonfun$runAction$4(AkkaHttpServer.scala:417)
at akka.http.scaladsl.util.FastFuture$.strictTransform$1(FastFuture.scala:41)
at akka.http.scaladsl.util.FastFuture$.$anonfun$transformWith$3(FastFuture.scala:51)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
at org.thp.scalligraph.ContextPropagatingDisptacher$$anon$1.$anonfun$execute$2(ContextPropagatingDisptacher.scala:56)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at org.thp.scalligraph.DiagnosticContext$$anon$2.withContext(ContextPropagatingDisptacher.scala:75)
at org.thp.scalligraph.ContextPropagatingDisptacher$$anon$1.$anonfun$execute$1(ContextPropagatingDisptacher.scala:56)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:48)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
2020-09-17 12:44:01,778 [INFO] from org.thp.scalligraph.AccessLogFilter in application-akka.actor.default-dispatcher-41 [00000007|] 172.20.144.1 POST /api/case/_search?range=0-15&sort=-flag,-startDate&nstats=true took 74ms and returned 400 148 bytes
2020-09-17 12:44:13,600 [DEBUG] from org.thp.thehive.services.TOTPAuthSrv in application-akka.actor.default-dispatcher-41 [|] session AuthenticationError Operation not supported
2020-09-17 12:44:13,600 [DEBUG] from org.thp.thehive.services.TOTPAuthSrv in application-akka.actor.default-dispatcher-41 [|] basic AuthenticationError Operation not supported
2020-09-17 12:44:13,600 [DEBUG] from org.thp.thehive.services.TOTPAuthSrv in application-akka.actor.default-dispatcher-41 [|] local AuthenticationError Operation not supported
2020-09-17 12:44:13,601 [DEBUG] from org.thp.scalligraph.models.Database in application-akka.actor.default-dispatcher-41 [|7fb2c9c8] Begin of readonly transaction
2020-09-17 12:44:13,602 [DEBUG] from org.thp.scalligraph.traversal.TraversalOps in application-akka.actor.default-dispatcher-41 [|7fb2c9c8] Execution of [GraphStep(vertex,[]), HasStep([_label.eq(User), ~label.eq(User), apikey.eq(LBrzDepm8PxAdu3GtUNE6G1HL1Z9Yf2U)])] (headOption)
2020-09-17 12:44:13,617 [DEBUG] from org.thp.scalligraph.models.Database in application-akka.actor.default-dispatcher-41 [|081caf16] Begin of readonly transaction
2020-09-17 12:44:13,617 [DEBUG] from org.thp.scalligraph.traversal.TraversalOps in application-akka.actor.default-dispatcher-41 [|081caf16] Execution of [GraphStep(vertex,[]), HasStep([_label.eq(User), ~label.eq(User), login.eq(user@local)])] (exists)
2020-09-17 12:44:13,621 [DEBUG] from org.thp.scalligraph.traversal.TraversalOps in application-akka.actor.default-dispatcher-41 [|081caf16] Execution of [GraphStep(vertex,[]), HasStep([_label.eq(User), ~label.eq(User), login.eq(user@local)]), VertexStep(OUT,[UserRole],vertex), OrderGlobalStep([[value(_createdAt), asc]]), VertexStep(OUT,[RoleOrganisation],vertex), PropertiesStep([name],value)] (headOption)
2020-09-17 12:44:13,631 [DEBUG] from org.thp.scalligraph.traversal.TraversalOps in application-akka.actor.default-dispatcher-41 [|081caf16] Execution of [GraphStep(vertex,[]), HasStep([_label.eq(User), ~label.eq(User), login.eq(user@local)]), TraversalFilterStep([VertexStep(OUT,[UserRole],vertex), VertexStep(OUT,[RoleOrganisation],vertex), HasStep([name.eq(user)])]), HasStep([locked.eq(false)]), ProjectStep([e6e419dc-8330-4863-b3ce-54bfbb277dfc, e85e32f2-e225-4c61-930c-10813d513f86, e6729939-bc84-4d8e-a005-98ca85fc8f8a],[value(login), value(name), [VertexStep(OUT,[UserRole],vertex), TraversalFilterStep([VertexStep(OUT,[RoleOrganisation],vertex), HasStep([name.eq(user)])]), VertexStep(OUT,[RoleProfile],vertex)]])] (headOption)
2020-09-17 12:44:13,643 [DEBUG] from org.thp.scalligraph.models.Database in application-akka.actor.default-dispatcher-41 [|081caf16] End of readonly transaction
2020-09-17 12:44:13,643 [DEBUG] from org.thp.scalligraph.models.Database in application-akka.actor.default-dispatcher-41 [|7fb2c9c8] End of readonly transaction
2020-09-17 12:44:13,644 [WARN] from org.thp.scalligraph.query.InputFilter in application-akka.actor.default-dispatcher-41 [00000008|] string filter is not supported, it is ignored
2020-09-17 12:44:13,650 [DEBUG] from org.thp.scalligraph.traversal.TraversalOps in application-akka.actor.default-dispatcher-41 [00000008|] Execution of [GraphStep(vertex,[]), HasStep([_label.eq(Organisation), ~label.eq(Organisation), name.eq(user)]), VertexStep(OUT,[OrganisationShare],vertex), VertexStep(OUT,[ShareCase],vertex), TraversalFilterStep([]), OrderGlobalStep([[[PropertiesStep([flag],value)], desc]])] (richPage)
2020-09-17 12:44:13,707 [DEBUG] from org.thp.scalligraph.traversal.TraversalOps in application-akka.actor.default-dispatcher-41 [00000008|] Execution of [GraphStep(vertex,[]), HasStep([_label.eq(Organisation), ~label.eq(Organisation), name.eq(user)]), VertexStep(OUT,[OrganisationShare],vertex), VertexStep(OUT,[ShareCase],vertex), TraversalFilterStep([]), OrderGlobalStep([[[PropertiesStep([flag],value)], desc]]), RangeGlobalStep(0,15), ProjectStep([5add1eba-79b8-44a4-859c-511e066cecfd, 880c6a8c-864f-44dc-a0b5-d5dd4321ee4a, bcba3c77-aeae-4104-bd1d-1fe81d2d45d2, 08ca97af-76c7-4942-bfe3-2aa49db3c123, dd494bb7-ac6b-49aa-9b62-26f898b2ff6a, 0e67ca74-4211-4081-a897-8cf390028fe6, 5d21ca70-c001-4e80-86a1-5b050af0652f, 8a0083f7-1275-4350-af93-a6e1f451a583],[identity, [VertexStep(OUT,[CaseTag],vertex), FoldStep], [VertexStep(OUT,[CaseImpactStatus],vertex), PropertiesStep([value],value), FoldStep], [VertexStep(OUT,[CaseResolutionStatus],vertex), PropertiesStep([value],value), FoldStep], [VertexStep(OUT,[CaseUser],vertex), PropertiesStep([login],value), FoldStep], [VertexStep(OUT,[CaseCustomField],edge), ProjectStep([c9ce9f6b-7f0c-4b69-8d6e-6ab737b72ae7, 9eb81ae8-5b9d-478b-9432-b11ae7fc86cf],[identity, [EdgeVertexStep(IN)]]), FoldStep], [ProjectStep([a4e58cbb-a09f-4674-a6be-66b2a9fee55a, 03d8e9eb-fb2e-4d9e-bbc5-7a93ba9a102d, e27311ee-48d7-46fd-8aa1-f3eb9ba02be9, fef8d304-a314-4627-8022-ad2a92f78659, 8c051655-9cb5-48d9-aa6d-bb5207faa78a, 4a662e3d-011d-48c0-a322-200dbb646407],[[CoalesceStep([[VertexStep(IN,[ShareCase],vertex), TraversalFilterStep([VertexStep(IN,[OrganisationShare],vertex), HasStep([name.eq(user)])]), ProjectStep([f5c21537-3f15-4e5c-9545-ca64ba5d0876, df0cca6a-e101-4454-bbed-9b718156b56a],[[VertexStep(OUT,[ShareTask],vertex), TraversalFilterStep([HasStep([status.eq(Cancel)]), CountGlobalStep, IsStep(eq(0))]), GroupCountStep(value(status))], [VertexStep(OUT,[ShareObservable],vertex), CountGlobalStep]])], [ConstantStep(1)]])], [VertexStep(IN,[AlertCase],vertex), GroupStep(value(type),[TraversalMapStep(value(source)), FoldStep])], [ConstantStep(null)], [ConstantStep(null)], [VertexStep(IN,[ShareCase],vertex), HasStep([owner.eq(true)]), VertexStep(IN,[OrganisationShare],vertex), PropertiesStep([name],value)], [VertexStep(IN,[ShareCase],vertex), VertexStep(IN,[OrganisationShare],vertex), CountGlobalStep]])], [VertexStep(IN,[ShareCase],vertex), TraversalFilterStep([VertexStep(IN,[OrganisationShare],vertex), HasStep([name.eq(user)])]), VertexStep(OUT,[ShareProfile],vertex)]])] (toIterator)
2020-09-17 12:44:13,709 [DEBUG] from org.thp.scalligraph.traversal.TraversalOps in application-akka.actor.default-dispatcher-41 [00000008|] Execution of [GraphStep(vertex,[]), HasStep([_label.eq(Organisation), ~label.eq(Organisation), name.eq(user)]), VertexStep(OUT,[OrganisationShare],vertex), VertexStep(OUT,[ShareCase],vertex), TraversalFilterStep([]), OrderGlobalStep([[[PropertiesStep([flag],value)], desc]]), RangeGlobalStep(0,15), ProjectStep([5add1eba-79b8-44a4-859c-511e066cecfd, 880c6a8c-864f-44dc-a0b5-d5dd4321ee4a, bcba3c77-aeae-4104-bd1d-1fe81d2d45d2, 08ca97af-76c7-4942-bfe3-2aa49db3c123, dd494bb7-ac6b-49aa-9b62-26f898b2ff6a, 0e67ca74-4211-4081-a897-8cf390028fe6, 5d21ca70-c001-4e80-86a1-5b050af0652f, 8a0083f7-1275-4350-af93-a6e1f451a583],[identity, [VertexStep(OUT,[CaseTag],vertex), FoldStep], [VertexStep(OUT,[CaseImpactStatus],vertex), PropertiesStep([value],value), FoldStep], [VertexStep(OUT,[CaseResolutionStatus],vertex), PropertiesStep([value],value), FoldStep], [VertexStep(OUT,[CaseUser],vertex), PropertiesStep([login],value), FoldStep], [VertexStep(OUT,[CaseCustomField],edge), ProjectStep([c9ce9f6b-7f0c-4b69-8d6e-6ab737b72ae7, 9eb81ae8-5b9d-478b-9432-b11ae7fc86cf],[identity, [EdgeVertexStep(IN)]]), FoldStep], [ProjectStep([a4e58cbb-a09f-4674-a6be-66b2a9fee55a, 03d8e9eb-fb2e-4d9e-bbc5-7a93ba9a102d, e27311ee-48d7-46fd-8aa1-f3eb9ba02be9, fef8d304-a314-4627-8022-ad2a92f78659, 8c051655-9cb5-48d9-aa6d-bb5207faa78a, 4a662e3d-011d-48c0-a322-200dbb646407],[[CoalesceStep([[VertexStep(IN,[ShareCase],vertex), TraversalFilterStep([VertexStep(IN,[OrganisationShare],vertex), HasStep([name.eq(user)])]), ProjectStep([f5c21537-3f15-4e5c-9545-ca64ba5d0876, df0cca6a-e101-4454-bbed-9b718156b56a],[[VertexStep(OUT,[ShareTask],vertex), TraversalFilterStep([HasStep([status.eq(Cancel)]), CountGlobalStep, IsStep(eq(0))]), GroupCountStep(value(status))], [VertexStep(OUT,[ShareObservable],vertex), CountGlobalStep]])], [ConstantStep(1)]])], [VertexStep(IN,[AlertCase],vertex), GroupStep(value(type),[TraversalMapStep(value(source)), FoldStep])], [ConstantStep(null)], [ConstantStep(null)], [VertexStep(IN,[ShareCase],vertex), HasStep([owner.eq(true)]), VertexStep(IN,[OrganisationShare],vertex), PropertiesStep([name],value)], [VertexStep(IN,[ShareCase],vertex), VertexStep(IN,[OrganisationShare],vertex), CountGlobalStep]])], [VertexStep(IN,[ShareCase],vertex), TraversalFilterStep([VertexStep(IN,[OrganisationShare],vertex), HasStep([name.eq(user)])]), VertexStep(OUT,[ShareProfile],vertex)]]), CountGlobalStep] (head)
2020-09-17 12:44:13,827 [INFO] from org.thp.scalligraph.AccessLogFilter in application-akka.actor.default-dispatcher-43 [00000008|] 172.20.144.1 POST /api/case/_search?range=0-15&sort=-flag&nstats=true took 228ms and returned 200
The text was updated successfully, but these errors were encountered:
The parsing of the field "sort" has been fixed.
Your request contains the operator _string which can work in TheHive4. _string uses the Lucene format (ElasticSearch) which is not used anymore in TheHive4.
Request Type
Bug
Work Environment
Problem Description
From what I understand reading other issues, TheHive4's v0 API is supposed to be backwards compatible with TheHive3's API (Albeit slower).
To check this, I attempted to copy a request made by TheHive3's frontend, and send it to TheHive4, it turns out that sort criterias on fields that were renamed don't seem to work properly.
Steps to Reproduce
Send this request to your server:
With Body:
Complementary information
Log with trace mode on:
The text was updated successfully, but these errors were encountered: