-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.13.0
- Loading branch information
Showing
26 changed files
with
276 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ lazy val rpmPackageRelease = (project in file("package/rpm-release")) | |
maintainer := "TheHive Project <[email protected]>", | ||
version := "1.0.0", | ||
rpmRelease := "3", | ||
rpmVendor in Rpm := "TheHive Project", | ||
rpmVendor := "TheHive Project", | ||
rpmUrl := Some("http://thehive-project.org/"), | ||
rpmLicense := Some("AGPL"), | ||
maintainerScripts in Rpm := Map.empty, | ||
|
@@ -134,7 +134,7 @@ linuxMakeStartScript in Debian := None | |
|
||
// RPM // | ||
rpmRelease := "1" | ||
rpmVendor in Rpm := "TheHive Project" | ||
rpmVendor := "TheHive Project" | ||
rpmUrl := Some("http://thehive-project.org/") | ||
rpmLicense := Some("AGPL") | ||
rpmRequirements += "java-1.8.0-openjdk-headless" | ||
|
@@ -172,12 +172,18 @@ mappings in Docker ~= (_.filterNot { | |
case (_, filepath) => filepath == "/opt/thehive/conf/application.conf" | ||
}) | ||
dockerCommands ~= { dc => | ||
val (dockerInitCmds, dockerTailCmds) = dc.splitAt(4) | ||
val (dockerInitCmds, dockerTailCmds) = dc | ||
.collect { | ||
case ExecCmd("RUN", "chown", _*) => ExecCmd("RUN", "chown", "-R", "daemon:root", ".") | ||
case other => other | ||
} | ||
.splitAt(4) | ||
dockerInitCmds ++ | ||
Seq( | ||
Cmd("ADD", "var", "/var"), | ||
Cmd("ADD", "var", "/var"), | ||
Cmd("ADD", "etc", "/etc"), | ||
ExecCmd("RUN", "chown", "-R", "daemon:daemon", "/var/log/thehive")) ++ | ||
ExecCmd("RUN", "chown", "-R", "daemon:root", "/var/log/thehive"), | ||
ExecCmd("RUN", "chmod", "+x", "/opt/thehive/bin/thehive", "/opt/thehive/entrypoint")) ++ | ||
dockerTailCmds | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
(function() { | ||
'use strict'; | ||
|
||
angular | ||
.module('theHiveControllers') | ||
.controller('CaseExportDialogCtrl', function(MispSrv, NotificationSrv, clipboard, $uibModalInstance, caze, config) { | ||
var self = this; | ||
|
||
this.caze = caze; | ||
this.mode = ''; | ||
this.servers = config.servers; | ||
this.failures = []; | ||
|
||
this.existingExports = {}; | ||
this.loading = false; | ||
|
||
_.each(_.filter(this.caze.stats.alerts || [], function(item) { | ||
return item.type === 'misp'; | ||
}), function(item) { | ||
self.existingExports[item.source] = true; | ||
}); | ||
|
||
var extractExportErrors = function (errors) { | ||
var result = []; | ||
|
||
result = errors.map(function(item) { | ||
return { | ||
data: item.object.dataType === 'file' ? item.object.attachment.name : item.object.data, | ||
message: item.message | ||
}; | ||
}); | ||
|
||
return result; | ||
} | ||
|
||
this.copyToClipboard = function() { | ||
clipboard.copyText(_.pluck(self.failures, 'data').join('\n')); | ||
$uibModalInstance.dismiss(); | ||
} | ||
|
||
this.cancel = function() { | ||
$uibModalInstance.dismiss(); | ||
}; | ||
|
||
this.confirm = function() { | ||
$uibModalInstance.close(); | ||
}; | ||
|
||
this.export = function(server) { | ||
self.loading = true; | ||
self.failures = []; | ||
|
||
MispSrv.export(self.caze.id, server) | ||
.then(function(response){ | ||
var success = 0, | ||
failure = 0; | ||
|
||
if (response.status === 207) { | ||
success = response.data.success.length; | ||
failure = response.data.failure.length; | ||
|
||
self.mode = 'error'; | ||
self.failures = extractExportErrors(response.data.failure); | ||
|
||
NotificationSrv.log('The case has been successfully exported, but '+ failure +' observable(s) failed', 'warning'); | ||
} else { | ||
success = angular.isObject(response.data) ? 1 : response.data.length; | ||
NotificationSrv.log('The case has been successfully exported with ' + success+ ' observable(s)', 'success'); | ||
$uibModalInstance.close(); | ||
} | ||
self.loading = false; | ||
|
||
}, function(err) { | ||
if(!err) { | ||
return; | ||
} | ||
|
||
if (err.status === 400) { | ||
self.mode = 'error'; | ||
self.failures = extractExportErrors(err.data); | ||
} else { | ||
NotificationSrv.error('CaseExportCtrl', 'An unexpected error occurred while exporting case', err.status); | ||
} | ||
self.loading = false; | ||
}); | ||
} | ||
}); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.