diff --git a/CHANGELOG.md b/CHANGELOG.md index ce18e60d3..c08f4587c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Change Log +## [2.1.1](https://github.com/TheHive-Project/Cortex/tree/2.1.1) (2018-10-09) + +[Full Changelog](https://github.com/TheHive-Project/Cortex/compare/2.1.0...2.1.1) + +**Implemented enhancements:** + +- Change Debian dependencies [\#141](https://github.com/TheHive-Project/Cortex/issues/141) +- Allow Cortex to use a custom root context [\#140](https://github.com/TheHive-Project/Cortex/issues/140) +- Publish stable versions in beta package channels [\#138](https://github.com/TheHive-Project/Cortex/issues/138) + +**Fixed bugs:** + +- Fix Cache column in analyzers admin page [\#139](https://github.com/TheHive-Project/Cortex/issues/139) +- RPM update replace configuration file [\#137](https://github.com/TheHive-Project/Cortex/issues/137) +- Console output should not be logged in syslog [\#136](https://github.com/TheHive-Project/Cortex/issues/136) + ## [2.1.0](https://github.com/TheHive-Project/Cortex/tree/2.1.0) (2018-09-25) [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/2.1.0-RC1...2.1.0) @@ -10,10 +26,10 @@ **Fixed bugs:** -- Temporary files are not removed at the end of job [\#129](https://github.com/TheHive-Project/Cortex/issues/129) -- MISP fails to run analyzers [\#128](https://github.com/TheHive-Project/Cortex/issues/128) - MISP API fails [\#109](https://github.com/TheHive-Project/Cortex/issues/109) - File\_Info issue [\#53](https://github.com/TheHive-Project/Cortex/issues/53) +- Temporary files are not removed at the end of job [\#129](https://github.com/TheHive-Project/Cortex/issues/129) +- MISP fails to run analyzers [\#128](https://github.com/TheHive-Project/Cortex/issues/128) **Merged pull requests:** diff --git a/app/org/thp/cortex/controllers/Home.scala b/app/org/thp/cortex/controllers/Home.scala new file mode 100644 index 000000000..9f111ece4 --- /dev/null +++ b/app/org/thp/cortex/controllers/Home.scala @@ -0,0 +1,13 @@ +package org.thp.cortex.controllers + +import play.api.Configuration +import play.api.mvc.{ AbstractController, Action, AnyContent, ControllerComponents } + +import javax.inject.{ Inject, Singleton } + +@Singleton +class Home @Inject() (configuration: Configuration, components: ControllerComponents) extends AbstractController(components) { + def redirect: Action[AnyContent] = Action { + Redirect(configuration.get[String]("play.http.context").stripSuffix("/") + "/index.html") + } +} \ No newline at end of file diff --git a/app/org/thp/cortex/controllers/JobCtrl.scala b/app/org/thp/cortex/controllers/JobCtrl.scala index fda48c528..feab4b916 100644 --- a/app/org/thp/cortex/controllers/JobCtrl.scala +++ b/app/org/thp/cortex/controllers/JobCtrl.scala @@ -46,8 +46,8 @@ class JobCtrl @Inject() ( val query = request.body.getValue("query").fold[QueryDef](deleteFilter)(q ⇒ and(q.as[QueryDef], deleteFilter)) val range = request.body.getString("range") val sort = request.body.getStrings("sort").getOrElse(Nil) - val (users, total) = jobSrv.findForUser(request.userId, query, range, sort) - renderer.toOutput(OK, users, total) + val (jobs, total) = jobSrv.findForUser(request.userId, query, range, sort) + renderer.toOutput(OK, jobs, total) } diff --git a/conf/routes b/conf/routes index 9c7f89687..4145627fd 100644 --- a/conf/routes +++ b/conf/routes @@ -3,7 +3,7 @@ # ~~~~ -GET / controllers.Default.redirect(to = "/index.html") +GET / org.thp.cortex.controllers.Home.redirect GET /api/health org.thp.cortex.controllers.StatusCtrl.health GET /api/logout org.thp.cortex.controllers.AuthenticationCtrl.logout() POST /api/login org.thp.cortex.controllers.AuthenticationCtrl.login() diff --git a/debian.sbt b/debian.sbt index 505bc5c1f..798a7905f 100644 --- a/debian.sbt +++ b/debian.sbt @@ -1,7 +1,7 @@ import Common._ version in Debian := getVersion(version.value) + '-' + getRelease(version.value) -debianPackageDependencies += "openjdk-8-jre-headless" +debianPackageDependencies += "java8-runtime | java8-runtime-headless" maintainerScripts in Debian := maintainerScriptsFromDirectory( baseDirectory.value / "package" / "debian", Seq(DebianConstants.Postinst, DebianConstants.Prerm, DebianConstants.Postrm) diff --git a/docker/cortex/docker-compose.yml b/docker/cortex/docker-compose.yml index 680d3fb0f..2ba0a692b 100644 --- a/docker/cortex/docker-compose.yml +++ b/docker/cortex/docker-compose.yml @@ -12,7 +12,7 @@ services: - thread_pool.search.queue_size=100000 - thread_pool.bulk.queue_size=100000 cortex: - image: certbdf/cortex:latest + image: thehiveproject/cortex:latest depends_on: - elasticsearch ports: diff --git a/package/cortex.service b/package/cortex.service index 3f235d827..f67192759 100644 --- a/package/cortex.service +++ b/package/cortex.service @@ -15,8 +15,8 @@ ExecStart=/opt/cortex/bin/cortex \ -Dlogger.file=/etc/cortex/logback.xml \ -Dpidfile.path=/dev/null -StandardOutput=journal -StandardError=inherit +StandardOutput=null +StandardError=null # Specifies the maximum file descriptor number that can be opened by this process LimitNOFILE=65536 diff --git a/project/Bintray.scala b/project/Bintray.scala index 1aaca6672..b2a22b324 100644 --- a/project/Bintray.scala +++ b/project/Bintray.scala @@ -69,13 +69,13 @@ object Bintray extends AutoPlugin { publishDebian in ThisBuild := { if ((version in ThisBuild).value.endsWith("-SNAPSHOT")) sys.error("Snapshot version can't be released") - val repositoryName = if (version.value.contains('-')) "debian-beta" else "debian-stable" val file = (debianSign in Debian).value + val bintrayCredentials = bintrayEnsureCredentials.value btPublish(file.getName, file, - bintrayEnsureCredentials.value, + bintrayCredentials, bintrayOrganization.value, - repositoryName, + "debian-beta", bintrayPackage.value, version.value, sLog.value, @@ -83,20 +83,42 @@ object Bintray extends AutoPlugin { "deb_component" → "main", "deb_architecture" → "all" ) + if (!version.value.contains('-')) + btPublish(file.getName, + file, + bintrayCredentials, + bintrayOrganization.value, + "debian-stable", + bintrayPackage.value, + version.value, + sLog.value, + "deb_distribution" → "any", + "deb_component" → "main", + "deb_architecture" → "all" + ) }, publishRpm in ThisBuild := { if ((version in ThisBuild).value.endsWith("-SNAPSHOT")) sys.error("Snapshot version can't be released") - val repositoryName = if (version.value.contains('-')) "rpm-beta" else "rpm-stable" val file = (packageBin in Rpm).value + val bintrayCredentials = bintrayEnsureCredentials.value btPublish(file.getName, file, - bintrayEnsureCredentials.value, + bintrayCredentials, bintrayOrganization.value, - repositoryName, + "rpm-beta", bintrayPackage.value, (version in Rpm).value + '-' + (rpmRelease in Rpm).value, sLog.value) + if (!version.value.contains('-')) + btPublish(file.getName, + file, + bintrayCredentials, + bintrayOrganization.value, + "rpm-stable", + bintrayPackage.value, + (version in Rpm).value + '-' + (rpmRelease in Rpm).value, + sLog.value) } ) diff --git a/project/BuildSettings.scala b/project/BuildSettings.scala deleted file mode 100644 index 0aa3cedc7..000000000 --- a/project/BuildSettings.scala +++ /dev/null @@ -1,29 +0,0 @@ -import sbt.Keys._ -import sbt._ - -object BasicSettings extends AutoPlugin { - override def trigger: PluginTrigger = allRequirements - - override def projectSettings = Seq( - organization := "org.cert-bdf", - licenses += "AGPL-V3" → url("https://www.gnu.org/licenses/agpl-3.0.html"), - resolvers += Resolver.bintrayRepo("cert-bdf", "elastic4play"), - scalacOptions ++= Seq( - "-deprecation", // Emit warning and location for usages of deprecated APIs. - "-feature", // Emit warning and location for usages of features that should be imported explicitly. - "-unchecked", // Enable additional warnings where generated code depends on assumptions. - //"-Xfatal-warnings", // Fail the compilation if there are any warnings. - "-Xlint", // Enable recommended additional warnings. - "-Ywarn-adapted-args", // Warn if an argument list is modified to match the receiver. - "-Ywarn-dead-code", // Warn when dead code is identified. - "-Ywarn-inaccessible", // Warn about inaccessible types in method signatures. - "-Ywarn-nullary-override", // Warn when non-nullary overrides nullary, e.g. def foo() over def foo. - "-Ywarn-numeric-widen" // Warn when numerics are widened. - ), - scalacOptions in Test ~= { (options: Seq[String]) ⇒ - options filterNot (_ == "-Ywarn-dead-code") // Allow dead code in tests (to support using mockito). - }, - parallelExecution in Test := false, - fork in Test := true, - javaOptions += "-Xmx1G") -} diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 26b55b1a4..8076d7fd2 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -17,6 +17,6 @@ object Dependencies { val reflections = "org.reflections" % "reflections" % "0.9.11" val zip4j = "net.lingala.zip4j" % "zip4j" % "1.3.2" - val elastic4play = "org.thehive-project" %% "elastic4play" % "1.6.2" + val elastic4play = "org.thehive-project" %% "elastic4play" % "1.6.3" } diff --git a/rpm.sbt b/rpm.sbt index a4539d9c9..888e87752 100644 --- a/rpm.sbt +++ b/rpm.sbt @@ -10,6 +10,7 @@ maintainerScripts in Rpm := maintainerScriptsFromDirectory( baseDirectory.value / "package" / "rpm", Seq(RpmConstants.Pre, RpmConstants.Preun, RpmConstants.Postun) ) +linuxPackageMappings in Rpm := configWithNoReplace((linuxPackageMappings in Rpm).value) linuxPackageSymlinks in Rpm := Nil rpmPrefix := Some(defaultLinuxInstallLocation.value) linuxEtcDefaultTemplate in Rpm := (baseDirectory.value / "package" / "etc_default_cortex").asURL diff --git a/version.sbt b/version.sbt index 65e0ce175..4a324e004 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "2.1.0" +version in ThisBuild := "2.1.1" diff --git a/www/config/webpack/environments/development.js b/www/config/webpack/environments/development.js index bf4994a25..d5ea55427 100644 --- a/www/config/webpack/environments/development.js +++ b/www/config/webpack/environments/development.js @@ -1,7 +1,7 @@ 'use strict'; let webpack = require('webpack'); -module.exports = function(_path) { +module.exports = function (_path) { return { context: _path, devtool: 'source-map', @@ -15,4 +15,4 @@ module.exports = function(_path) { }, plugins: [new webpack.HotModuleReplacementPlugin()] }; -}; +}; \ No newline at end of file diff --git a/www/config/webpack/environments/production.js b/www/config/webpack/environments/production.js index dd1dede4e..7a3e41eac 100644 --- a/www/config/webpack/environments/production.js +++ b/www/config/webpack/environments/production.js @@ -2,12 +2,12 @@ let CleanWebpackPlugin = require('clean-webpack-plugin'); let webpack = require('webpack'); -module.exports = function(_path) { +module.exports = function (_path) { return { context: _path, devtool: 'source-map', output: { - publicPath: '/', + publicPath: './', filename: '[name].[chunkhash].js' }, plugins: [ @@ -23,4 +23,4 @@ module.exports = function(_path) { }) ] }; -}; +}; \ No newline at end of file diff --git a/www/package.json b/www/package.json index 4547d37b8..5479e1972 100755 --- a/www/package.json +++ b/www/package.json @@ -1,6 +1,6 @@ { "name": "cortex", - "version": "2.1.0", + "version": "2.1.1", "description": "A powerfull observable analysis engine", "license": "AGPL-v3", "homepage": "https://github.com/TheHive-Project/Cortex", diff --git a/www/src/app/pages/admin/organizations/components/analyzers/analyzers-list.html b/www/src/app/pages/admin/organizations/components/analyzers/analyzers-list.html index 388982b26..a7b2a90e2 100644 --- a/www/src/app/pages/admin/organizations/components/analyzers/analyzers-list.html +++ b/www/src/app/pages/admin/organizations/components/analyzers/analyzers-list.html @@ -81,6 +81,7 @@