From 83b8bdbe892eb24db10272c841768ce3996cc989 Mon Sep 17 00:00:00 2001 From: To-om Date: Wed, 14 Apr 2021 15:33:53 +0200 Subject: [PATCH 01/17] #1964 Prevent failure if index is not found --- .../app/org/thp/thehive/controllers/v1/AdminCtrl.scala | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/thehive/app/org/thp/thehive/controllers/v1/AdminCtrl.scala b/thehive/app/org/thp/thehive/controllers/v1/AdminCtrl.scala index 77ca67817b..21637a1986 100644 --- a/thehive/app/org/thp/thehive/controllers/v1/AdminCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v1/AdminCtrl.scala @@ -117,7 +117,15 @@ class AdminCtrl @Inject() ( entrypoint("Get index status") .authPermittedRoTransaction(db, Permissions.managePlatform) { _ => graph => val indices = labels.map { label => - Json.obj("name" -> label, "count" -> graph.indexCountQuery(s"""v."_label":$label""")) + val count = + try graph.indexCountQuery(s"""v."_label":$label""") + catch { + case error: Throwable => + logger.error("Index fetch error", error) + 0 + } + Json.obj("name" -> label, "count" -> count) + } val indexCount = Json.obj("name" -> "global", "indices" -> indices) Success(Results.Ok(Json.obj("index" -> Seq(indexCount)))) From 852f8290137297ac65387421003e3646e7abef35 Mon Sep 17 00:00:00 2001 From: To-om Date: Wed, 14 Apr 2021 15:35:17 +0200 Subject: [PATCH 02/17] #1964 Hide not-real-errors --- conf/logback.xml | 1 + package/logback.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/conf/logback.xml b/conf/logback.xml index d8072baa3e..81ebc5d266 100644 --- a/conf/logback.xml +++ b/conf/logback.xml @@ -37,6 +37,7 @@ + diff --git a/package/logback.xml b/package/logback.xml index ae905cd3d9..bf16f2bb5e 100644 --- a/package/logback.xml +++ b/package/logback.xml @@ -37,6 +37,7 @@ + From 0550a0823ecc25bb60d2b2332c2e904c9316f184 Mon Sep 17 00:00:00 2001 From: To-om Date: Wed, 14 Apr 2021 15:35:50 +0200 Subject: [PATCH 03/17] #1964 Set fielddata parameter on full-text fields --- ScalliGraph | 2 +- .../app/org/thp/thehive/models/TheHiveSchemaDefinition.scala | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ScalliGraph b/ScalliGraph index 78de3a32ac..97ecfaf7e9 160000 --- a/ScalliGraph +++ b/ScalliGraph @@ -1 +1 @@ -Subproject commit 78de3a32ac7d9d09142eff2dd5b4c0d44147067b +Subproject commit 97ecfaf7e9d0f29afa5b12d2f831ca85b7504d8f diff --git a/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala b/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala index 0763d4397e..83e6ac6acf 100644 --- a/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala +++ b/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala @@ -469,7 +469,8 @@ class TheHiveSchemaDefinition @Inject() extends Schema with UpdatableSchema { .removeIndex("Observable", IndexType.standard) .removeIndex("Tag", IndexType.standard) .removeIndex("Task", IndexType.standard) - //=====[release 4.1.3]===== + //=====[release 4.1.3]===== + .removeIndex("global", IndexType.fulltext) val reflectionClasses = new Reflections( new ConfigurationBuilder() From 7335da976d6abe6613c4fc424186535bfb9f0c2a Mon Sep 17 00:00:00 2001 From: To-om Date: Wed, 14 Apr 2021 16:39:22 +0200 Subject: [PATCH 04/17] #1965 Fix customField selection query for alerts --- thehive/app/org/thp/thehive/controllers/v0/AlertCtrl.scala | 4 +--- thehive/app/org/thp/thehive/services/CustomFieldSrv.scala | 7 ------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/thehive/app/org/thp/thehive/controllers/v0/AlertCtrl.scala b/thehive/app/org/thp/thehive/controllers/v0/AlertCtrl.scala index 33e6294d49..076d7746fe 100644 --- a/thehive/app/org/thp/thehive/controllers/v0/AlertCtrl.scala +++ b/thehive/app/org/thp/thehive/controllers/v0/AlertCtrl.scala @@ -468,9 +468,7 @@ class PublicAlert @Inject() ( .property("user", UMapping.string)(_.field.updatable) .property("customFields", UMapping.jsonNative)(_.subSelect { case (FPathElem(_, FPathElem(idOrName, _)), alerts) => - alerts - .customFields(EntityIdOrName(idOrName)) - .jsonValue + alerts.customFieldJsonValue(customFieldSrv, EntityIdOrName(idOrName)) case (_, alerts) => alerts.customFields.nameJsonValue.fold.domainMap(JsObject(_)) } .filter[JsValue] { diff --git a/thehive/app/org/thp/thehive/services/CustomFieldSrv.scala b/thehive/app/org/thp/thehive/services/CustomFieldSrv.scala index 5b0c9af5be..9f379b5400 100644 --- a/thehive/app/org/thp/thehive/services/CustomFieldSrv.scala +++ b/thehive/app/org/thp/thehive/services/CustomFieldSrv.scala @@ -131,13 +131,6 @@ object CustomFieldOps { name -> CustomFieldType.map(tpe).getJsonValue(new CustomFieldValueEdge(edge)) } - def jsonValue: Traversal[JsValue, JMap[String, Any], Converter[JsValue, JMap[String, Any]]] = - edgeNameType - .domainMap { - case (edge, _, tpe) => - CustomFieldType.map(tpe).getJsonValue(new CustomFieldValueEdge(edge)) - } - def nameValue: Traversal[(String, Option[_]), JMap[String, Any], Converter[(String, Option[_]), JMap[String, Any]]] = edgeNameType .domainMap { From 67dfae203b2055aa9c183f58db30b282ea86719e Mon Sep 17 00:00:00 2001 From: To-om Date: Wed, 14 Apr 2021 16:54:12 +0200 Subject: [PATCH 05/17] #1966 Change database initialisation timeout --- thehive/conf/reference.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thehive/conf/reference.conf b/thehive/conf/reference.conf index 0bcf7561f6..c2d37f6e68 100644 --- a/thehive/conf/reference.conf +++ b/thehive/conf/reference.conf @@ -9,7 +9,7 @@ db { directory: /opt/thp/thehive/database } } - initialisationTimeout: 1 hour + initialisationTimeout: 14 days } query.limitedCountThreshold: 1000 From 23e407ced50d59574157e35c3c78eb67551492c1 Mon Sep 17 00:00:00 2001 From: To-om Date: Wed, 14 Apr 2021 17:26:56 +0200 Subject: [PATCH 06/17] #1967 Make alert deletion more robust --- .../org/thp/thehive/services/AlertSrv.scala | 15 ++++--- .../thp/thehive/services/ObservableSrv.scala | 40 ++++++++++--------- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/thehive/app/org/thp/thehive/services/AlertSrv.scala b/thehive/app/org/thp/thehive/services/AlertSrv.scala index 9783100087..44924b27a3 100644 --- a/thehive/app/org/thp/thehive/services/AlertSrv.scala +++ b/thehive/app/org/thp/thehive/services/AlertSrv.scala @@ -354,12 +354,15 @@ class AlertSrv @Inject() ( .map(_ => ()) def remove(alert: Alert with Entity)(implicit graph: Graph, authContext: AuthContext): Try[Unit] = - for { - organisation <- organisationSrv.getOrFail(authContext.organisation) - _ <- get(alert).observables.toIterator.toTry(observableSrv.delete(_)) - _ = get(alert).remove() - _ <- auditSrv.alert.delete(alert, organisation) - } yield () + auditSrv.mergeAudits { + get(alert).observables.toIterator.foreach(observableSrv.delete(_)) + Success(()) + } { _ => + for { + organisation <- organisationSrv.getOrFail(authContext.organisation) + _ <- auditSrv.alert.delete(alert, organisation) + } yield get(alert).remove() + } } object AlertOps { diff --git a/thehive/app/org/thp/thehive/services/ObservableSrv.scala b/thehive/app/org/thp/thehive/services/ObservableSrv.scala index cbea7a27e1..a2e9f0d8cd 100644 --- a/thehive/app/org/thp/thehive/services/ObservableSrv.scala +++ b/thehive/app/org/thp/thehive/services/ObservableSrv.scala @@ -137,24 +137,28 @@ class ObservableSrv @Inject() ( override def delete(observable: Observable with Entity)(implicit graph: Graph, authContext: AuthContext): Try[Unit] = get(observable).alert.headOption match { case None => - get(observable).share.getOrFail("Share").flatMap { - case share if share.owner => - get(observable) - .shares - .toIterator - .toTry { share => - auditSrv - .observable - .delete(observable, share) - } - .map(_ => get(observable).remove()) - case share => - for { - organisation <- organisationSrv.current.getOrFail("Organisation") - _ <- shareSrv.unshareObservable(observable, organisation) - _ <- auditSrv.observable.delete(observable, share) - } yield () - } + get(observable) + .share + .toIterator + .toTry { + case share if share.owner => + get(observable) + .shares + .toIterator + .toTry { share => + auditSrv + .observable + .delete(observable, share) + } + .map(_ => get(observable).remove()) + case share => + for { + organisation <- organisationSrv.current.getOrFail("Organisation") + _ <- shareSrv.unshareObservable(observable, organisation) + _ <- auditSrv.observable.delete(observable, share) + } yield () + } + .map(_ => ()) case Some(alert) => get(observable).remove() auditSrv.observableInAlert.delete(observable, alert) From c8b24f9b650de831ae66e616da14f99617dc8e71 Mon Sep 17 00:00:00 2001 From: To-om Date: Wed, 14 Apr 2021 19:25:11 +0200 Subject: [PATCH 07/17] #1968 Add manageProcedure to analyst role --- thehive/app/org/thp/thehive/models/Role.scala | 3 ++- .../models/TheHiveSchemaDefinition.scala | 27 ++++++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/thehive/app/org/thp/thehive/models/Role.scala b/thehive/app/org/thp/thehive/models/Role.scala index 996b9709bd..953974dce6 100644 --- a/thehive/app/org/thp/thehive/models/Role.scala +++ b/thehive/app/org/thp/thehive/models/Role.scala @@ -27,7 +27,8 @@ object Profile { Permissions.manageShare, Permissions.manageAnalyse, Permissions.managePage, - Permissions.accessTheHiveFS + Permissions.accessTheHiveFS, + Permissions.manageProcedure ) ) val readonly: Profile = Profile("read-only", Set.empty) diff --git a/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala b/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala index 83e6ac6acf..492ceca462 100644 --- a/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala +++ b/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala @@ -184,14 +184,15 @@ class TheHiveSchemaDefinition @Inject() extends Schema with UpdatableSchema { traversal.unsafeHas("name", "admin").raw.property("permissions", "managePattern").iterate() Success(()) } - .updateGraph("Add manageProcedure permission to org-admin and analyst profiles", "Profile") { traversal => - traversal - .unsafeHas("name", P.within("org-admin", "analyst")) - .raw - .property("permissions", "manageProcedure") - .iterate() - Success(()) - } + .noop +// .updateGraph("Add manageProcedure permission to org-admin and analyst profiles", "Profile") { traversal => +// traversal +// .unsafeHas("name", P.within("org-admin", "analyst")) +// .raw +// .property("permissions", "manageProcedure") +// .iterate() +// Success(()) +// } // Index backend /* Alert index */ .addProperty[Seq[String]]("Alert", "tags") @@ -266,7 +267,7 @@ class TheHiveSchemaDefinition @Inject() extends Schema with UpdatableSchema { } /* CaseTemplate index */ .addProperty[Seq[String]]("CaseTemplate", "tags") - .updateGraph("Add tags in caseTempates", "CaseTemplate") { traversal => + .updateGraph("Add tags in caseTemplates", "CaseTemplate") { traversal => traversal .project( _.by @@ -471,6 +472,14 @@ class TheHiveSchemaDefinition @Inject() extends Schema with UpdatableSchema { .removeIndex("Task", IndexType.standard) //=====[release 4.1.3]===== .removeIndex("global", IndexType.fulltext) + .updateGraph("Add manageProcedure permission to org-admin and analyst profiles", "Profile") { traversal => + traversal + .unsafeHas("name", P.within("org-admin", "analyst")) + .raw + .property("permissions", "manageProcedure") + .iterate() + Success(()) + } val reflectionClasses = new Reflections( new ConfigurationBuilder() From 6475b8657d53678c821eaef75d45df04c0159b59 Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Thu, 15 Apr 2021 06:25:50 +0200 Subject: [PATCH 08/17] #1968 Add manageProcedure permission to profile dialog. --- .../app/scripts/services/api/ProfileSrv.js | 28 ++++---- .../views/partials/case/case.procedures.html | 67 +++++++++++++------ .../partials/case/procedures/toolbar.html | 6 +- 3 files changed, 65 insertions(+), 36 deletions(-) diff --git a/frontend/app/scripts/services/api/ProfileSrv.js b/frontend/app/scripts/services/api/ProfileSrv.js index 3a1becdfac..1523daa2ac 100644 --- a/frontend/app/scripts/services/api/ProfileSrv.js +++ b/frontend/app/scripts/services/api/ProfileSrv.js @@ -1,7 +1,7 @@ -(function() { +(function () { 'use strict'; angular.module('theHiveServices') - .service('ProfileSrv', function($http) { + .service('ProfileSrv', function ($http) { var self = this; var baseUrl = './api/profile'; @@ -46,6 +46,7 @@ 'manageShare', 'manageObservable', 'manageTask', + 'manageProcedure', 'manageAction', 'manageAnalyse', 'accessTheHiveFS' @@ -59,6 +60,7 @@ manageShare: 'Manage sharing', manageObservable: 'Manage observables', manageTask: 'Manage tasks', + manageProcedure: 'Manage TTPs', manageAction: 'Run Cortex responders', manageAnalyse: 'Run Cortex analyzer', accessTheHiveFS: 'Access to TheHiveFS service' @@ -66,32 +68,34 @@ } }; - this.list = function() { - return $http.get(baseUrl, {params: { - range: 'all' - }}); + this.list = function () { + return $http.get(baseUrl, { + params: { + range: 'all' + } + }); }; - this.get = function(name) { + this.get = function (name) { return $http.get(baseUrl + '/' + name); }; - this.map = function() { + this.map = function () { return self.list() - .then(function(response) { + .then(function (response) { return _.indexBy(response.data, 'name'); }); }; - this.create = function(profile) { + this.create = function (profile) { return $http.post(baseUrl, profile); }; - this.update = function(id, profile) { + this.update = function (id, profile) { return $http.patch(baseUrl + '/' + id, profile); }; - this.remove = function(id) { + this.remove = function (id) { return $http.delete(baseUrl + '/' + id); }; }); diff --git a/frontend/app/views/partials/case/case.procedures.html b/frontend/app/views/partials/case/case.procedures.html index 27a86a1415..37198179e4 100644 --- a/frontend/app/views/partials/case/case.procedures.html +++ b/frontend/app/views/partials/case/case.procedures.html @@ -1,6 +1,7 @@
-
+
@@ -11,7 +12,8 @@

- + @@ -28,7 +30,8 @@

Tactic - + @@ -36,7 +39,8 @@

Technique - + @@ -45,7 +49,8 @@

Occur Date - + @@ -55,29 +60,36 @@

-
+
- + {{$vm.tactics[proc.tactic].label}} - +
- {{proc.patternId}} - {{proc.extraData.patternParent.name}}:{{proc.extraData.pattern.name}} + {{proc.patternId}} - + {{proc.extraData.patternParent.name}}:{{proc.extraData.pattern.name}} - +
- {{proc.patternId}} - {{proc.extraData.pattern.name}} + {{proc.patternId}} - + {{proc.extraData.pattern.name}} - +
@@ -86,11 +98,13 @@

--> @@ -100,35 +114,44 @@

- / + /
- {{proc._createdAt | shortDate}} + {{proc._createdAt | shortDate}}
- {{(proc._updatedAt | shortDate) || '-'}} + {{(proc._updatedAt | shortDate) || '-'}}
-
- +
+ +
+
+ {{(proc.occurDate | shortDate) || '-'}}
-
- +
+ +
-
+
+
+ Not Specified +
diff --git a/frontend/app/views/partials/case/procedures/toolbar.html b/frontend/app/views/partials/case/procedures/toolbar.html index 5cf4cdb69c..763089d138 100644 --- a/frontend/app/views/partials/case/procedures/toolbar.html +++ b/frontend/app/views/partials/case/procedures/toolbar.html @@ -2,7 +2,7 @@

}[!!taxonomy.extraData.enabled]"> - + - +
From b9cd5bee4a44548d87ea24ee766a59882f399079 Mon Sep 17 00:00:00 2001 From: To-om Date: Thu, 15 Apr 2021 08:07:46 +0200 Subject: [PATCH 10/17] #1964 Renew global index only if ElasticSearch is used --- .../org/thp/thehive/models/TheHiveSchemaDefinition.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala b/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala index 492ceca462..a910840f40 100644 --- a/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala +++ b/thehive/app/org/thp/thehive/models/TheHiveSchemaDefinition.scala @@ -471,7 +471,12 @@ class TheHiveSchemaDefinition @Inject() extends Schema with UpdatableSchema { .removeIndex("Tag", IndexType.standard) .removeIndex("Task", IndexType.standard) //=====[release 4.1.3]===== - .removeIndex("global", IndexType.fulltext) + .dbOperation[JanusDatabase]("Remove global index if ElasticSearch is used") { db => + db.managementTransaction(mgmt => Try(mgmt.get("index.search.backend"))).flatMap { + case "elasticsearch" => db.removeIndex("global", IndexType.fulltext, Nil) + case _ => Success(()) + } + } .updateGraph("Add manageProcedure permission to org-admin and analyst profiles", "Profile") { traversal => traversal .unsafeHas("name", P.within("org-admin", "analyst")) From 707b40e779e01c63ffbd8439636f670b928128a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leonard?= Date: Thu, 15 Apr 2021 11:48:11 +0200 Subject: [PATCH 11/17] #1971 give more context info of the running instance --- .github/ISSUE_TEMPLATE/thehive3_bug_report.md | 8 +++++++- .github/ISSUE_TEMPLATE/thehive4_bug_report.md | 6 ++++++ .github/ISSUE_TEMPLATE/thehive4_question.md | 20 ++++++++++++------- ScalliGraph | 2 +- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/thehive3_bug_report.md b/.github/ISSUE_TEMPLATE/thehive3_bug_report.md index f73685e1cc..f49a423737 100644 --- a/.github/ISSUE_TEMPLATE/thehive3_bug_report.md +++ b/.github/ISSUE_TEMPLATE/thehive3_bug_report.md @@ -16,8 +16,14 @@ Bug | -------------------------- | ------------------------------------- | | OS version (server) | Debian, Ubuntu, CentOS, RedHat, ... | | OS version (client) | XP, Seven, 10, Ubuntu, ... | -| TheHive version / git hash | 3.x, hash of the commit | +| Virtualized Env. | True / False | +| Dedicated RAM | XX GB | +| vCPU | 4 / 8 / 16 / 32 | +| TheHive version / git hash | 4.x, hash of the commit | | Package Type | RPM, DEB, Docker, Binary, From source | +| Database | Cassandra / BerlkelyDB | +| Index type | Lucene / Elasticsearch | +| Attachments storage | Local, NFS, S3, HDFS | | Browser type & version | If applicable | diff --git a/.github/ISSUE_TEMPLATE/thehive4_bug_report.md b/.github/ISSUE_TEMPLATE/thehive4_bug_report.md index 3e158e3a33..19a0214625 100644 --- a/.github/ISSUE_TEMPLATE/thehive4_bug_report.md +++ b/.github/ISSUE_TEMPLATE/thehive4_bug_report.md @@ -16,8 +16,14 @@ Bug | -------------------------- | ------------------------------------- | | OS version (server) | Debian, Ubuntu, CentOS, RedHat, ... | | OS version (client) | XP, Seven, 10, Ubuntu, ... | +| Virtualized Env. | True / False | +| Dedicated RAM | XX GB | +| vCPU | 4 / 8 / 16 / 32 | | TheHive version / git hash | 4.x, hash of the commit | | Package Type | RPM, DEB, Docker, Binary, From source | +| Database | Cassandra / BerlkelyDB | +| Index type | Lucene / Elasticsearch | +| Attachments storage | Local, NFS, S3, HDFS | | Browser type & version | If applicable | diff --git a/.github/ISSUE_TEMPLATE/thehive4_question.md b/.github/ISSUE_TEMPLATE/thehive4_question.md index a551433c07..3cab78c3e0 100644 --- a/.github/ISSUE_TEMPLATE/thehive4_question.md +++ b/.github/ISSUE_TEMPLATE/thehive4_question.md @@ -13,13 +13,19 @@ Question ### Work Environment -| Question | Answer -|---------------------------|-------------------- -| OS version (server) | Debian, Ubuntu, CentOS, RedHat, ... -| OS version (client) | XP, Seven, 10, Ubuntu, ... -| TheHive version / git hash | 4.x, hash of the commit -| Package Type | RPM, DEB, Docker, Binary, From source -| Browser type & version | If applicable +| Question | Answer | +| -------------------------- | ------------------------------------- | +| OS version (server) | Debian, Ubuntu, CentOS, RedHat, ... | +| OS version (client) | XP, Seven, 10, Ubuntu, ... | +| Virtualized Env. | True / False | +| Dedicated RAM | XX GB | +| vCPU | 4 / 8 / 16 / 32 | +| TheHive version / git hash | 4.x, hash of the commit | +| Package Type | RPM, DEB, Docker, Binary, From source | +| Database | Cassandra / BerlkelyDB | +| Index type | Lucene / Elasticsearch | +| Attachments storage | Local, NFS, S3, HDFS | +| Browser type & version | If applicable | ### Question diff --git a/ScalliGraph b/ScalliGraph index 97ecfaf7e9..ae7ceb013c 160000 --- a/ScalliGraph +++ b/ScalliGraph @@ -1 +1 @@ -Subproject commit 97ecfaf7e9d0f29afa5b12d2f831ca85b7504d8f +Subproject commit ae7ceb013c923295f3ac95f7e2514b8e19218355 From 907e2d6425d41c15c10c148cf044d9257f32a4c7 Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Thu, 15 Apr 2021 12:06:05 +0200 Subject: [PATCH 12/17] #1911 Update alert counter on alert create/update/delete --- frontend/app/scripts/controllers/RootCtrl.js | 1 - .../controllers/alert/AlertListCtrl.js | 7 +- .../app/views/partials/case/case.alerts.html | 96 ++++++++++--------- .../org/thp/thehive/services/AuditSrv.scala | 2 + 4 files changed, 54 insertions(+), 52 deletions(-) diff --git a/frontend/app/scripts/controllers/RootCtrl.js b/frontend/app/scripts/controllers/RootCtrl.js index 6abb174e2a..f7a82c3edc 100644 --- a/frontend/app/scripts/controllers/RootCtrl.js +++ b/frontend/app/scripts/controllers/RootCtrl.js @@ -106,7 +106,6 @@ angular.module('theHiveControllers').controller('RootCtrl', name: 'unread-alert-count' } }, - guard: UtilsSrv.hasAddDeleteEvents, onUpdate: function (data) { $scope.unreadAlertCount = data; } diff --git a/frontend/app/scripts/controllers/alert/AlertListCtrl.js b/frontend/app/scripts/controllers/alert/AlertListCtrl.js index c53e33f3da..ef698f5404 100755 --- a/frontend/app/scripts/controllers/alert/AlertListCtrl.js +++ b/frontend/app/scripts/controllers/alert/AlertListCtrl.js @@ -262,11 +262,10 @@ self.menu.markAsUnread = temp.length === 1 && temp[0] === true; // TODO nadouani: don't rely on alert status - self.menu.createNewCase = temp.indexOf('Imported') === -1; - self.menu.mergeInCase = temp.indexOf('Imported') === -1; - - temp = _.without(_.uniq(_.pluck(self.selection, 'case')), null, undefined); + temp = _.without(_.uniq(_.pluck(self.selection, 'caseId')), null, undefined); + self.menu.createNewCase = temp.length === 0; + self.menu.mergeInCase = temp.length === 0; self.menu.delete = temp.length === 0; }; diff --git a/frontend/app/views/partials/case/case.alerts.html b/frontend/app/views/partials/case/case.alerts.html index 590976743b..2da03ea95b 100644 --- a/frontend/app/views/partials/case/case.alerts.html +++ b/frontend/app/views/partials/case/case.alerts.html @@ -4,21 +4,19 @@

-