Skip to content

Commit

Permalink
Merge branch 'release/4.1.2' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Mar 29, 2021
2 parents 7575943 + 5d898a9 commit 0074446
Show file tree
Hide file tree
Showing 38 changed files with 405 additions and 281 deletions.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: TheHive Community Support
url: https://chat.thehive-project.org/
about: Please ask and answer questions here.
- name: TheHive Documentation
url: https://docs.thehive-project.org/
about: Please read documentation here.
16 changes: 7 additions & 9 deletions .github/ISSUE_TEMPLATE/thehive3_bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ assignees: ''

---

# EDIT THIS TITLE BEFORE POSTING. Use this template for bug reports. If you'd like to request a feature, please be as descriptive as possible and delete the template except the first section (Request Type)

### Request Type
Bug

### Work Environment

| Question | Answer
|---------------------------|--------------------
| OS version (server) | Debian, Ubuntu, CentOS, RedHat, ...
| OS version (client) | XP, Seven, 10, Ubuntu, ...
| TheHive version / git hash | 3.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, ... |
| TheHive version / git hash | 3.x, hash of the commit |
| Package Type | RPM, DEB, Docker, Binary, From source |
| Browser type & version | If applicable |


### Problem Description
Expand Down
16 changes: 7 additions & 9 deletions .github/ISSUE_TEMPLATE/thehive4_bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ assignees: ''

---

# EDIT THIS TITLE BEFORE POSTING. Use this template for bug reports. If you'd like to request a feature, please be as descriptive as possible and delete the template except the first section (Request Type)

### Request Type
Bug

### 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, ... |
| TheHive version / git hash | 4.x, hash of the commit |
| Package Type | RPM, DEB, Docker, Binary, From source |
| Browser type & version | If applicable |


### Problem Description
Expand Down
11 changes: 1 addition & 10 deletions .github/ISSUE_TEMPLATE/thehive4_feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,13 @@
name: Feature Request for TheHive4
about: Create a feature request for TheHive 4.
title: "[Bug]"
labels: "feature request", TheHive4
labels: feature request, TheHive4
assignees: ''
---

# EDIT THIS TITLE BEFORE POSTING. Use this template for bug reports. If you'd like to request a feature, please be as descriptive as possible and delete the template except the first section (Request Type)

### Request Type

Feature Request

### Work Environment

| Question | Answer
|---------------------------|--------------------
| TheHive version | 4.x

### Feature Description

Describe feature as clearly as possible.
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Change Log

## [4.1.2](https://github.com/TheHive-Project/TheHive/milestone/71) (2021-03-29)

**Implemented enhancements:**

- [Feature Request] Add case search by TTP [\#1893](https://github.com/TheHive-Project/TheHive/issues/1893)

**Fixed bugs:**

- [Bug] Slow loading of TheHive because of Tags [\#1869](https://github.com/TheHive-Project/TheHive/issues/1869)
- [Bug] After migration from 4.0.5 to 4.1.0 old tasklogs are not returned by "/api/v1/query?name=case-task-logs" query [\#1875](https://github.com/TheHive-Project/TheHive/issues/1875)
- Dashboards - custom fields [\#1877](https://github.com/TheHive-Project/TheHive/issues/1877)
- [Bug] TH 4.1.1 : Filter by "IMPORTED" does not work for alerts imported into existing cases [\#1891](https://github.com/TheHive-Project/TheHive/issues/1891)
- [Bug] Fix the S3 configuration options [\#1892](https://github.com/TheHive-Project/TheHive/issues/1892)
- [Bug] All attachments in task logs disappeared following upgrade to 4.1.1 [\#1894](https://github.com/TheHive-Project/TheHive/issues/1894)
- [Bug] Continued performance issues after upgrade to 4.1.1 [\#1896](https://github.com/TheHive-Project/TheHive/issues/1896)
- [Bug] Fix issues dashboard list [\#1901](https://github.com/TheHive-Project/TheHive/issues/1901)
- [Bug] Migration tool migrates unsupported elastic index [\#1907](https://github.com/TheHive-Project/TheHive/issues/1907)
- [Bug] Folder permissions are not correctly set in docker image [\#1908](https://github.com/TheHive-Project/TheHive/issues/1908)

## [4.1.1](https://github.com/TheHive-Project/TheHive/milestone/70) (2021-03-23)

**Implemented enhancements:**
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Dependencies._
import com.typesafe.sbt.packager.Keys.bashScriptDefines
import org.thp.ghcl.Milestone

val thehiveVersion = "4.1.1-1"
val thehiveVersion = "4.1.2-1"
val scala212 = "2.12.13"
val scala213 = "2.13.1"
val supportedScalaVersions = List(scala212, scala213)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import scala.reflect.runtime.{universe => ru}
class CortexSchemaDefinition @Inject() () extends Schema with UpdatableSchema {

lazy val logger: Logger = Logger(getClass)
val operations: Operations = Operations("thehive-cortex")
val operations: Operations = Operations("thehive-cortex").noop

lazy val reflectionClasses = new Reflections(
new ConfigurationBuilder()
Expand Down
2 changes: 1 addition & 1 deletion docker.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dockerCommands := Seq(
Cmd("ADD", "--chown=thehive:thehive", "var", "/var"),
Cmd("ADD", "--chown=thehive:thehive", "etc", "/etc"),
ExecCmd("RUN", "chmod", "+x", "/opt/thehive/bin/thehive", "/opt/thehive/entrypoint"),
Cmd("RUN", "mkdir", "/data", "&&", "chown", "thehive:thehive", "/data"),
Cmd("RUN", "mkdir", "/data", "/opt/thp", "&&", "chown", "thehive:thehive", "/data", "/opt/thp"),
Cmd("EXPOSE", "9000"),
Cmd("USER", "thehive"),
ExecCmd("ENTRYPOINT", "/opt/thehive/entrypoint"),
Expand Down
3 changes: 2 additions & 1 deletion dto/src/main/scala/org/thp/thehive/dto/v0/Log.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ case class OutputLog(
startDate: Date,
attachment: Option[OutputAttachment] = None,
status: String,
owner: String
owner: String,
case_task: Option[OutputTask]
)

object OutputLog {
Expand Down
71 changes: 36 additions & 35 deletions frontend/app/scripts/controllers/dashboard/DashboardViewCtrl.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(function() {
(function () {
'use strict';

angular
.module('theHiveControllers')
.controller('DashboardViewCtrl', function($scope, $q, $interval, $timeout, $uibModal, AuthenticationSrv, DashboardSrv, NotificationSrv, ModalUtilsSrv, UtilsSrv, dashboard, metadata) {
.controller('DashboardViewCtrl', function ($scope, $q, $interval, $timeout, $uibModal, AuthenticationSrv, DashboardSrv, NotificationSrv, ModalUtilsSrv, UtilsSrv, dashboard, metadata) {
var self = this;

this.currentUser = AuthenticationSrv.currentUser;
Expand All @@ -15,13 +15,13 @@
this.autoRefresh = null;
this.authRefreshRunner = null;

this.buildDashboardPeriodFilter = function(period) {
this.buildDashboardPeriodFilter = function (period) {
return period === 'custom' ?
DashboardSrv.buildPeriodQuery(period, 'createdAt', this.definition.customPeriod.fromDate, this.definition.customPeriod.toDate) :
DashboardSrv.buildPeriodQuery(period, 'createdAt');
};

this.loadDashboard = function(dashboard) {
this.loadDashboard = function (dashboard) {
this.dashboard = dashboard;
this.definition = JSON.parse(dashboard.definition) || {
period: 'all',
Expand All @@ -37,22 +37,22 @@

this.loadDashboard(dashboard);

$scope.$watch('$vm.autoRefresh', function(value) {
if(value === self.authRefreshRunner || self.options.editLayout === true) {
$scope.$watch('$vm.autoRefresh', function (value) {
if (value === self.authRefreshRunner || self.options.editLayout === true) {
return;
}

if(value === null) {
if (value === null) {
$interval.cancel(self.authRefreshRunner);
} else {
$interval.cancel(self.authRefreshRunner);
self.authRefreshRunner = $interval(function() {
self.authRefreshRunner = $interval(function () {
$scope.$broadcast('refresh-chart', self.periodFilter);
}, value * 1000);
}
});

this.canEditDashboard = function() {
this.canEditDashboard = function () {
return (this.createdBy === this.currentUser.login) || this.dashboardStatus === 'Shared';
};

Expand All @@ -70,23 +70,23 @@
text: 'Text',
multiline: 'Multi Lines'
},
editLayout: !_.find(this.definition.items, function(row) {
editLayout: !_.find(this.definition.items, function (row) {
return row.items.length > 0;
}) && this.canEditDashboard()
};

this.applyPeriod = function(period) {
this.applyPeriod = function (period) {
this.definition.period = period;
this.periodFilter = this.buildDashboardPeriodFilter(period);

$scope.$broadcast('refresh-chart', this.periodFilter);
};

this.removeContainer = function(index) {
this.removeContainer = function (index) {
var row = this.definition.items[index];

var promise;
if(row.items.length === 0) {
if (row.items.length === 0) {
// If the container is empty, don't ask for confirmation
promise = $q.resolve();
} else {
Expand All @@ -96,89 +96,90 @@
});
}

promise.then(function() {
promise.then(function () {
self.definition.items.splice(index, 1);
});
};

this.saveDashboard = function() {
var copy = _.pick(this.dashboard, 'title', 'description', 'status');
copy.definition = angular.toJson(this.definition);
this.saveDashboard = function () {
var copy = {
definition: angular.toJson(this.definition)
};

DashboardSrv.update(this.dashboard.id, copy)
.then(function(/*response*/) {
.then(function (/*response*/) {
self.options.editLayout = false;
self.resizeCharts();
NotificationSrv.log('The dashboard has been successfully updated', 'success');
})
.catch(function(err) {
.catch(function (err) {
NotificationSrv.error('DashboardEditCtrl', err.data, err.status);
});
};

this.removeItem = function(rowIndex, colIndex) {
this.removeItem = function (rowIndex, colIndex) {

ModalUtilsSrv.confirm('Remove widget', 'Are you sure you want to remove this item', {
okText: 'Yes, remove it',
flavor: 'danger'
}).then(function() {
}).then(function () {
var row = self.definition.items[rowIndex];
row.items.splice(colIndex, 1);

$timeout(function() {
$timeout(function () {
$scope.$broadcast('resize-chart-' + rowIndex);
}, 0);
});

};

this.itemInserted = function(item, rows/*, rowIndex, index*/) {
if(!item.id){
this.itemInserted = function (item, rows/*, rowIndex, index*/) {
if (!item.id) {
item.id = UtilsSrv.guid();
}

for(var i=0; i < rows.length; i++) {
for (var i = 0; i < rows.length; i++) {
$scope.$broadcast('resize-chart-' + i);
}

if (this.options.containerAllowedTypes.indexOf(item.type) !== -1 && !item.options.entity) {
// The item is a widget
$timeout(function() {
$timeout(function () {
$scope.$broadcast('edit-chart-' + item.id);
}, 0);
}

return item;
};

this.itemDragStarted = function(colIndex, row) {
this.itemDragStarted = function (colIndex, row) {
row.items.splice(colIndex, 1);
};

this.exportDashboard = function() {
this.exportDashboard = function () {
DashboardSrv.exportDashboard(this.dashboard);
};

this.resizeCharts = function() {
$timeout(function() {
for(var i=0; i < self.definition.items.length; i++) {
this.resizeCharts = function () {
$timeout(function () {
for (var i = 0; i < self.definition.items.length; i++) {
$scope.$broadcast('resize-chart-' + i);
}
}, 100);
};

this.enableEditMode = function() {
this.enableEditMode = function () {
this.options.editLayout = true;
this.resizeCharts();
};

this.enableViewMode = function() {
this.enableViewMode = function () {
DashboardSrv.get(this.dashboard.id)
.then(function(response) {
.then(function (response) {
self.loadDashboard(response.data);
self.options.editLayout = false;
self.resizeCharts();
}, function(err) {
}, function (err) {
NotificationSrv.error('DashboardViewCtrl', err.data, err.status);
});
};
Expand Down
Loading

0 comments on commit 0074446

Please sign in to comment.