diff --git a/CHANGELOG.md b/CHANGELOG.md index 43969d449..ba5c00fdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,27 @@ # Change Log -## [2.0.3](https://github.com/TheHive-Project/Cortex/tree/2.0.3) (2018-04-09) +## [2.0.4](https://github.com/TheHive-Project/Cortex/tree/2.0.4) (2018-04-13) +[Full Changelog](https://github.com/TheHive-Project/Cortex/compare/2.0.3...2.0.4) + +**Implemented enhancements:** + +- Let a Read/Analyze User Display/Change their API Key [\#89](https://github.com/TheHive-Project/Cortex/issues/89) + +**Fixed bugs:** +- Strictly filter the list of analyzers in the run dialog [\#95](https://github.com/TheHive-Project/Cortex/issues/95) +- Updating users by orgAdmin users fails silently [\#94](https://github.com/TheHive-Project/Cortex/issues/94) +- Fix analyzer configurations icons [\#93](https://github.com/TheHive-Project/Cortex/issues/93) +- Wrong page redirection [\#92](https://github.com/TheHive-Project/Cortex/issues/92) +- Sort analyzers list by name [\#91](https://github.com/TheHive-Project/Cortex/issues/91) +- Cortex 2.0.3 docker container having cortex analyzer errors [\#90](https://github.com/TheHive-Project/Cortex/issues/90) +- Install python3 requirements for analyzers in public docker image [\#58](https://github.com/TheHive-Project/Cortex/issues/58) + +**Closed issues:** + +- Insufficient Rights To Perform This Action [\#87](https://github.com/TheHive-Project/Cortex/issues/87) + +## [2.0.3](https://github.com/TheHive-Project/Cortex/tree/2.0.3) (2018-04-09) [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/2.0.2...2.0.3) **Implemented enhancements:** diff --git a/app/org/thp/cortex/controllers/AnalyzerCtrl.scala b/app/org/thp/cortex/controllers/AnalyzerCtrl.scala index adf802682..795dfdd23 100644 --- a/app/org/thp/cortex/controllers/AnalyzerCtrl.scala +++ b/app/org/thp/cortex/controllers/AnalyzerCtrl.scala @@ -4,7 +4,7 @@ import javax.inject.{ Inject, Singleton } import scala.concurrent.{ ExecutionContext, Future } -import play.api.libs.json.{ JsNull, JsObject, Json } +import play.api.libs.json.{ JsObject, Json } import play.api.mvc.{ AbstractController, Action, AnyContent, ControllerComponents } import akka.stream.Materializer diff --git a/app/org/thp/cortex/controllers/MispCtrl.scala b/app/org/thp/cortex/controllers/MispCtrl.scala index dac5e034a..783493b92 100644 --- a/app/org/thp/cortex/controllers/MispCtrl.scala +++ b/app/org/thp/cortex/controllers/MispCtrl.scala @@ -2,11 +2,10 @@ package org.thp.cortex.controllers import javax.inject.Inject import org.elastic4play.controllers.{ Authenticated, Fields, FieldsBodyParser, Renderer } -import org.elastic4play.services.QueryDSL import org.thp.cortex.models.Roles import org.thp.cortex.services.{ AnalyzerSrv, MispSrv } import play.api.Logger -import play.api.libs.json.{ JsObject, JsValue, Json } +import play.api.libs.json.{ JsObject, JsValue } import play.api.mvc._ import scala.concurrent.{ ExecutionContext, Future } diff --git a/app/org/thp/cortex/controllers/UserCtrl.scala b/app/org/thp/cortex/controllers/UserCtrl.scala index f6aceec8e..8277fdff0 100644 --- a/app/org/thp/cortex/controllers/UserCtrl.scala +++ b/app/org/thp/cortex/controllers/UserCtrl.scala @@ -210,9 +210,11 @@ class UserCtrl @Inject() ( } @Timed - def getKey(userId: String): Action[AnyContent] = authenticated(Roles.orgAdmin, Roles.superAdmin).async { implicit request ⇒ + def getKey(userId: String): Action[AnyContent] = authenticated().async { implicit request ⇒ for { _ ← checkUserOrganization(userId) + _ ← if (userId == request.userId || request.roles.contains(Roles.orgAdmin) || request.roles.contains(Roles.superAdmin)) Future.successful(()) + else Future.failed(AuthorizationError("You are not authorized to perform this operation")) key ← authSrv.getKey(userId) } yield Ok(key) } @@ -226,9 +228,11 @@ class UserCtrl @Inject() ( } @Timed - def renewKey(userId: String): Action[AnyContent] = authenticated(Roles.orgAdmin, Roles.superAdmin).async { implicit request ⇒ + def renewKey(userId: String): Action[AnyContent] = authenticated().async { implicit request ⇒ for { _ ← checkUserOrganization(userId) + _ ← if (userId == request.userId || request.roles.contains(Roles.orgAdmin) || request.roles.contains(Roles.superAdmin)) Future.successful(()) + else Future.failed(AuthorizationError("You are not authorized to perform this operation")) key ← authSrv.renewKey(userId) } yield Ok(key) } diff --git a/build.sbt b/build.sbt index 94be3abc0..481c9145e 100644 --- a/build.sbt +++ b/build.sbt @@ -145,8 +145,8 @@ dockerCommands ~= { dc => "pip3 install -U pip setuptools && " + "cd /opt && " + "git clone https://github.com/CERT-BDF/Cortex-Analyzers.git && " + - "pip install $(sort -u Cortex-Analyzers/analyzers/*/requirements.txt) && " + - "sort -u Cortex-Analyzers/analyzers/*/requirements.txt | grep -v ';python_version' | xargs -n 1 pip3 install || true"), + "for I in Cortex-Analyzers/analyzers/*/requirements.txt; do pip2 install -r $I; done && " + + "for I in Cortex-Analyzers/analyzers/*/requirements.txt; do pip3 install -r $I || true; done"), Cmd("ADD", "var", "/var"), Cmd("ADD", "etc", "/etc"), ExecCmd("RUN", "chown", "-R", "daemon:root", "/var/log/cortex"), diff --git a/conf/reference.conf b/conf/reference.conf index 3d3aa6375..9f91ef006 100644 --- a/conf/reference.conf +++ b/conf/reference.conf @@ -50,6 +50,7 @@ search { } auth.provider = ["local"] +auth.method.basic = false # Datastore datastore { diff --git a/version.sbt b/version.sbt index 3e00daab6..740abf8d0 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "2.0.3" +version in ThisBuild := "2.0.4" diff --git a/www/package.json b/www/package.json index 66fee3a1b..88c4e376f 100755 --- a/www/package.json +++ b/www/package.json @@ -1,6 +1,6 @@ { "name": "cortex", - "version": "2.0.3", + "version": "2.0.4", "description": "A powerfull observable analysis engine", "license": "AGPL-v3", "homepage": "https://github.com/TheHive-Project/Cortex", diff --git a/www/src/app/components/header/header.html b/www/src/app/components/header/header.html index 9e20213e2..e6601af2c 100644 --- a/www/src/app/components/header/header.html +++ b/www/src/app/components/header/header.html @@ -13,7 +13,7 @@
+ +
+
+
+

API Key

+
+
+
+

You don't have any API key.

+

Please contact your organization's administrator.

+
+
+

You have an API key defined. You can renew it if needed.

+
+ + Renew + Reveal + + + + + +
+
+
+
+
+