From 7a3c3b40ae57ff715fb184b8e4f81d69932c04bd Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Thu, 19 Oct 2017 15:35:52 +0200 Subject: [PATCH 1/9] #343 Filter deleted observables from statistics page Conflicts: ui/app/views/directives/charts/chart.html --- ui/app/scripts/controllers/StatisticsCtrl.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/app/scripts/controllers/StatisticsCtrl.js b/ui/app/scripts/controllers/StatisticsCtrl.js index 98fcddb416..d80b4cc724 100644 --- a/ui/app/scripts/controllers/StatisticsCtrl.js +++ b/ui/app/scripts/controllers/StatisticsCtrl.js @@ -128,7 +128,8 @@ type: 'case_artifact', field: 'dataType', dateField: 'startDate', - tagsField: 'tags' + tagsField: 'tags', + filter: {status: 'Ok'} }; $scope.observableByIoc = { @@ -140,7 +141,8 @@ names: { '0': 'NOT IOC', '1': 'IOC' - } + }, + filter: {status: 'Ok'} }; $scope.observableOverTime = { @@ -154,7 +156,8 @@ }, types: { startDate: 'bar' - } + }, + filter: {status: 'Ok'} }; $scope.setTagsAggregator = function(aggregator) { From 21323738dac1dd5b069427378cea1db54fe2f498 Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Thu, 19 Oct 2017 14:49:11 +0200 Subject: [PATCH 2/9] #347 Fix the observable by IOC ministat panel --- ui/app/views/partials/observables/list/mini-stats.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/app/views/partials/observables/list/mini-stats.html b/ui/app/views/partials/observables/list/mini-stats.html index cae309b555..a042fc6bcb 100644 --- a/ui/app/views/partials/observables/list/mini-stats.html +++ b/ui/app/views/partials/observables/list/mini-stats.html @@ -22,11 +22,12 @@

Statistics

Observables as IOC
+
{{statsCtrl.byIoc.details | json}}
- +
{{(item.key === '0') ? 'Not IOC' : 'IOC' }}{{(item.key === 'false') ? 'Not IOC' : 'IOC' }} - {{item.count}} + {{item.count}}
From bf8fecf0fd23444365527918c65128399ba30288 Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Thu, 19 Oct 2017 14:49:49 +0200 Subject: [PATCH 3/9] #347 Fix the observable by IOC ministat panel --- ui/app/views/partials/observables/list/mini-stats.html | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/app/views/partials/observables/list/mini-stats.html b/ui/app/views/partials/observables/list/mini-stats.html index a042fc6bcb..ca1b0c66fa 100644 --- a/ui/app/views/partials/observables/list/mini-stats.html +++ b/ui/app/views/partials/observables/list/mini-stats.html @@ -22,7 +22,6 @@

Statistics

Observables as IOC
-
{{statsCtrl.byIoc.details | json}}
From c6acf3863aac55723f11d46e129ccae13750063b Mon Sep 17 00:00:00 2001 From: To-om Date: Wed, 11 Oct 2017 17:31:32 +0200 Subject: [PATCH 4/9] #331 Fix custom fields in merged cases --- thehive-backend/app/services/CaseMergeSrv.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/thehive-backend/app/services/CaseMergeSrv.scala b/thehive-backend/app/services/CaseMergeSrv.scala index 9bd9b7788d..bf2e80ec5c 100644 --- a/thehive-backend/app/services/CaseMergeSrv.scala +++ b/thehive-backend/app/services/CaseMergeSrv.scala @@ -123,12 +123,12 @@ class CaseMergeSrv @Inject() ( customFieldsObject ← caze.customFields().asOpt[JsObject] } yield customFieldsObject - val mergedCustomFieldsObject: Seq[(String, JsValue)] = customFields.flatMap(_.keys).distinct.map { key ⇒ + val mergedCustomFieldsObject: Seq[(String, JsValue)] = customFields.flatMap(_.keys).distinct.flatMap { key ⇒ val customFieldsValues = customFields.flatMap(cf ⇒ (cf \ key).asOpt[JsObject]).distinct if (customFieldsValues.size != 1) - key → JsNull + None else - key → customFieldsValues.head + Some(key → customFieldsValues.head) } JsObject(mergedCustomFieldsObject) From 7e87121c9b735e177924b08cdadcf484e40a8b98 Mon Sep 17 00:00:00 2001 From: To-om Date: Mon, 23 Oct 2017 14:17:04 +0200 Subject: [PATCH 5/9] Bump version --- ui/bower.json | 2 +- ui/package.json | 2 +- version.sbt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/bower.json b/ui/bower.json index d691ea0d8c..e7b02fb805 100644 --- a/ui/bower.json +++ b/ui/bower.json @@ -1,6 +1,6 @@ { "name": "thehive", - "version": "2.13.1", + "version": "2.13.2", "license": "AGPL-3.0", "dependencies": { "angular": "1.5.8", diff --git a/ui/package.json b/ui/package.json index 3398edba56..a97bef2981 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,6 +1,6 @@ { "name": "thehive", - "version": "2.13.1", + "version": "2.13.2", "license": "AGPL-3.0", "repository": { "type": "git", diff --git a/version.sbt b/version.sbt index 23a7edc177..9221cf8da7 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "2.13.1" +version in ThisBuild := "2.13.2" From 63ed72b0395757c3166b980f43336066fb0fc5de Mon Sep 17 00:00:00 2001 From: To-om Date: Mon, 23 Oct 2017 14:17:59 +0200 Subject: [PATCH 6/9] Update version of Elastic4play: 1.3.2 --- project/Dependencies.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 1985b3ceb7..9c0b6375ed 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -32,6 +32,6 @@ object Dependencies { val reflections = "org.reflections" % "reflections" % "0.9.11" val zip4j = "net.lingala.zip4j" % "zip4j" % "1.3.2" val akkaTest = "com.typesafe.akka" %% "akka-stream-testkit" % "2.5.4" - val elastic4play = "org.cert-bdf" %% "elastic4play" % "1.3.1" + val elastic4play = "org.cert-bdf" %% "elastic4play" % "1.3.2" } } From 7d0e49544a2cbf116532a5e4a5b49eab47be83d6 Mon Sep 17 00:00:00 2001 From: To-om Date: Mon, 23 Oct 2017 17:23:52 +0200 Subject: [PATCH 7/9] #343 Fix IOC labels in statistics page --- ui/app/scripts/controllers/StatisticsCtrl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/scripts/controllers/StatisticsCtrl.js b/ui/app/scripts/controllers/StatisticsCtrl.js index d80b4cc724..273dcf6ea6 100644 --- a/ui/app/scripts/controllers/StatisticsCtrl.js +++ b/ui/app/scripts/controllers/StatisticsCtrl.js @@ -139,8 +139,8 @@ dateField: 'startDate', tagsField: 'tags', names: { - '0': 'NOT IOC', - '1': 'IOC' + 'false': 'NOT IOC', + 'true': 'IOC' }, filter: {status: 'Ok'} }; From 69b7989d407fafb5a0adc06e142751aa0bb421e7 Mon Sep 17 00:00:00 2001 From: To-om Date: Tue, 24 Oct 2017 08:50:27 +0200 Subject: [PATCH 8/9] #342 Migrate database to force nested field mapping --- thehive-backend/app/models/Migration.scala | 1 + thehive-backend/app/models/package.scala | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/thehive-backend/app/models/Migration.scala b/thehive-backend/app/models/Migration.scala index d5467b7138..a3aa2af8ca 100644 --- a/thehive-backend/app/models/Migration.scala +++ b/thehive-backend/app/models/Migration.scala @@ -237,6 +237,7 @@ class Migration( val customFields = (caze \ "customFields").asOpt[JsObject].getOrElse(JsObject(Nil)) caze + ("metrics" → metrics) + ("customFields" → customFields) }) + case DatabaseState(10) ⇒ Nil } private val requestCounter = new java.util.concurrent.atomic.AtomicInteger(0) diff --git a/thehive-backend/app/models/package.scala b/thehive-backend/app/models/package.scala index f2f10fe052..a7b96e9822 100644 --- a/thehive-backend/app/models/package.scala +++ b/thehive-backend/app/models/package.scala @@ -1,5 +1,5 @@ package object models { - val modelVersion = 10 + val modelVersion = 11 } \ No newline at end of file From 254f5ce7dc8f682b37d9c1de2a5dbd42a02f26a3 Mon Sep 17 00:00:00 2001 From: To-om Date: Tue, 24 Oct 2017 10:11:34 +0200 Subject: [PATCH 9/9] Update changelog --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69dcf5dc31..f746f3754c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## [2.13.2](https://github.com/CERT-BDF/TheHive/tree/2.13.2) (2017-10-24) + +[Full Changelog](https://github.com/CERT-BDF/TheHive/compare/2.13.1...2.13.2) + +**Fixed bugs:** + +- Security issue on Play 2.6.5 [\#356](https://github.com/CERT-BDF/TheHive/issues/356) +- Incorrect stats: non-IOC observables counted as IOC and IOC word displayed twice [\#347](https://github.com/CERT-BDF/TheHive/issues/347) +- Deleted Observables, Show up on the statistics tab under Observables by Type [\#343](https://github.com/CERT-BDF/TheHive/issues/343) +- Statistics on metrics doesn't work [\#342](https://github.com/CERT-BDF/TheHive/issues/342) +- Error on custom fields format when merging cases [\#331](https://github.com/CERT-BDF/TheHive/issues/331) + ## [2.13.1](https://github.com/CERT-BDF/TheHive/tree/2.13.1) (2017-09-18) [Full Changelog](https://github.com/CERT-BDF/TheHive/compare/2.13.0...2.13.1)
{{(item.key === 'false') ? 'Not IOC' : 'IOC' }}