Skip to content

Commit

Permalink
Merge branch 'hotfix/4.1.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jul 19, 2021
2 parents f1f85a3 + 8b2faa8 commit d3972a1
Show file tree
Hide file tree
Showing 26 changed files with 322 additions and 218 deletions.
22 changes: 11 additions & 11 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ steps:
event: [tag]

# Publish docker image on Harbor
- name: harbor
image: plugins/docker
settings:
context: target/docker/stage
dockerfile: target/docker/stage/Dockerfile
registry: {from_secret: harbor_registry}
repo: {from_secret: harbor_repo}
username: {from_secret: harbor_username}
password: {from_secret: harbor_password}
when:
event: [tag]
# - name: harbor
# image: plugins/docker
# settings:
# context: target/docker/stage
# dockerfile: target/docker/stage/Dockerfile
# registry: {from_secret: harbor_registry}
# repo: {from_secret: harbor_repo}
# username: {from_secret: harbor_username}
# password: {from_secret: harbor_password}
# when:
# event: [tag]

- name: send message
image: thehiveproject/drone_keybase
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Change Log

## [4.1.8](https://github.com/TheHive-Project/TheHive/milestone/77) (2021-07-19)

**Implemented enhancements:**

- [Feature Request] Improve SSO user auto creation [\#2127](https://github.com/TheHive-Project/TheHive/issues/2127)
- [Feature Request] Add simple improvements in alerts list [\#2129](https://github.com/TheHive-Project/TheHive/issues/2129)

**Closed issues:**

- typo in entrypoint man for "cortex-hostnames" [\#2114](https://github.com/TheHive-Project/TheHive/issues/2114)

**Fixed bugs:**

- [Bug] TheHive updates an alert from an updated MISP event but not the promoted Case [\#2110](https://github.com/TheHive-Project/TheHive/issues/2110)

## [4.1.7](https://github.com/TheHive-Project/TheHive/milestone/76) (2021-07-05)

**Implemented enhancements:**
Expand Down
3 changes: 2 additions & 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.7-1"
val thehiveVersion = "4.1.8-1"
val scala212 = "2.12.13"
val scala213 = "2.13.1"
val supportedScalaVersions = List(scala212, scala213)
Expand Down Expand Up @@ -39,6 +39,7 @@ scalacOptions in ThisBuild ++= Seq(
"-Xprint-types"
)
fork in Test in ThisBuild := true
javaOptions in Test in ThisBuild += s"-Dlogger.file=${file("test/resources/logback-test.xml").getAbsoluteFile}"
javaOptions in ThisBuild ++= Seq(
"-Xms512M",
"-Xmx2048M",
Expand Down
59 changes: 30 additions & 29 deletions frontend/app/scripts/components/alert/AlertSimilarCaseListCmp.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
(function() {
(function () {
'use strict';

angular.module('theHiveComponents')
.component('alertSimilarCaseList', {
controller: function($scope, AlertingSrv, FilteringSrv, PaginatedQuerySrv, CaseResolutionStatus, UiSettingsSrv) {
controller: function ($scope, AlertingSrv, FilteringSrv, PaginatedQuerySrv, CaseResolutionStatus, UiSettingsSrv) {
var self = this;

self.CaseResolutionStatus = CaseResolutionStatus;
Expand Down Expand Up @@ -35,7 +35,7 @@
defaultAlertSimilarCaseFilter: UiSettingsSrv.defaultAlertSimilarCaseFilter()
};

self.$onInit = function() {
self.$onInit = function () {
this.filtering = new FilteringSrv('case', 'alert.dialog.similar-cases', {
version: 'v1',
defaults: {
Expand All @@ -48,11 +48,11 @@
});

self.filtering.initContext('alert.dialog.similar-cases')
.then(function() {
.then(function () {
var defaultFilter = AlertingSrv.getSimilarityFilter(self.state.defaultAlertSimilarCaseFilter);

if(_.isEmpty(self.filtering.context.filters) && defaultFilter && defaultFilter.length > 0) {
_.each(defaultFilter, function(item) {
if (_.isEmpty(self.filtering.context.filters) && defaultFilter && defaultFilter.length > 0) {
_.each(defaultFilter, function (item) {
self.filtering.addFilter(item);
});
}
Expand All @@ -64,24 +64,24 @@
});

$scope.$watch('$cmp.list.total', function (total) {
self.onListLoad({count: total});
self.onListLoad({ count: total });
});
});
};

this.load = function() {
this.load = function () {
this.list = new PaginatedQuerySrv({
name: 'alert-similar-cases',
skipStream: true,
version: 'v1',
loadAll: true,
//pageSize: self.filtering.context.pageSize,
operations: [
{'_name': 'getAlert', 'idOrName': this.alertId},
{'_name': 'similarCases', 'caseFilter': this.filtering.buildQuery()}
{ '_name': 'getAlert', 'idOrName': this.alertId },
{ '_name': 'similarCases', 'caseFilter': this.filtering.buildQuery() }
],
onUpdate: function(data) {
_.each(data, function(item) {
onUpdate: function (data) {
_.each(data, function (item) {
item.fTitle = item.case.title;
item.fMatches = _.keys(item.observableTypes);
item.fObservables = Math.floor((item.similarObservableCount / item.observableCount) * 100);
Expand All @@ -90,21 +90,21 @@
item.sCreatedAt = item.case._createdAt;
});

self.matches = _.uniq(_.flatten(_.map(data, function(item){
self.matches = _.uniq(_.flatten(_.map(data, function (item) {
return _.keys(item.observableTypes);
}))).sort();
}
});
};

self.merge = function(caseId) {
self.merge = function (caseId) {
this.onMergeIntoCase({
caseId: caseId
});
};

// Frontend filter methods
this.clearLocalFilters = function() {
this.clearLocalFilters = function () {
self.similarityFilters = {
fTitle: undefined
};
Expand All @@ -119,14 +119,14 @@
};
};

this.greaterThan = function(prop){
return function(item){
this.greaterThan = function (prop) {
return function (item) {
return !self.rateFilters[prop] || item[prop] >= self.rateFilters[prop];
};
};

this.matchFilter = function() {
return function(item){
this.matchFilter = function () {
return function (item) {
return !self.matchFilters.fMatches || self.matchFilters.fMatches.length === 0 ||
_.intersection(self.matchFilters.fMatches, item.fMatches).length > 0;
};
Expand Down Expand Up @@ -159,20 +159,20 @@
.then(self.search);
};

this.filterBy = function(field, value) {
this.filterBy = function (field, value) {
self.filtering.clearFilters()
.then(function(){
.then(function () {
self.addFilterValue(field, value);
});
};

this.applyDefaultFilter = function() {
this.applyDefaultFilter = function () {
self.filtering.clearFilters()
.then(function(){
.then(function () {
var defaultFilter = AlertingSrv.getSimilarityFilter(self.state.defaultAlertSimilarCaseFilter);

if(defaultFilter && defaultFilter.length > 0) {
_.each(defaultFilter, function(item) {
if (defaultFilter && defaultFilter.length > 0) {
_.each(defaultFilter, function (item) {
self.filtering.addFilter(item);
});

Expand All @@ -181,17 +181,17 @@
});
};

this.filterSimilarities = function(data) {
this.filterSimilarities = function (data) {
return data;
};

this.sortByField = function(field) {
this.sortByField = function (field) {
var sort = null;

if(this.sortField.substr(1) !== field) {
if (this.sortField.substr(1) !== field) {
sort = '+' + field;
} else {
sort = (this.sortField === '+' + field) ? '-'+field : '+'+field;
sort = (this.sortField === '+' + field) ? '-' + field : '+' + field;
}

this.sortField = sort;
Expand All @@ -203,6 +203,7 @@
templateUrl: 'views/components/alert/similar-case-list.component.html',
bindings: {
alertId: '<',
readonly: '<',
onListLoad: '&',
onMergeIntoCase: '&'
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/scripts/controllers/alert/AlertListCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
});
};

self.import = function (event) {
self.import = function (event, readonly) {
var modalInstance = $uibModal.open({
templateUrl: 'views/partials/alert/event.dialog.html',
controller: 'AlertEventCtrl',
Expand All @@ -198,7 +198,7 @@
templates: function () {
return CaseTemplateSrv.list();
},
readonly: false
readonly: readonly
}
});

Expand Down
2 changes: 1 addition & 1 deletion frontend/app/scripts/services/api/AlertingSrv.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
operations: [
{ '_name': 'listAlert' }
],
extraData: ['importDate']
extraData: ['importDate', 'caseNumber']
});
},

Expand Down
Loading

0 comments on commit d3972a1

Please sign in to comment.