Skip to content

Commit b6aad26

Browse files
committed
Merge branch 'hotfix/2.0.4'
2 parents 0a3a733 + 4fd981f commit b6aad26

File tree

19 files changed

+162
-40
lines changed

19 files changed

+162
-40
lines changed

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
11
# Change Log
22

3-
## [2.0.3](https://github.com/TheHive-Project/Cortex/tree/2.0.3) (2018-04-09)
3+
## [2.0.4](https://github.com/TheHive-Project/Cortex/tree/2.0.4) (2018-04-13)
4+
[Full Changelog](https://github.com/TheHive-Project/Cortex/compare/2.0.3...2.0.4)
5+
6+
**Implemented enhancements:**
7+
8+
- Let a Read/Analyze User Display/Change their API Key [\#89](https://github.com/TheHive-Project/Cortex/issues/89)
9+
10+
**Fixed bugs:**
411

12+
- Strictly filter the list of analyzers in the run dialog [\#95](https://github.com/TheHive-Project/Cortex/issues/95)
13+
- Updating users by orgAdmin users fails silently [\#94](https://github.com/TheHive-Project/Cortex/issues/94)
14+
- Fix analyzer configurations icons [\#93](https://github.com/TheHive-Project/Cortex/issues/93)
15+
- Wrong page redirection [\#92](https://github.com/TheHive-Project/Cortex/issues/92)
16+
- Sort analyzers list by name [\#91](https://github.com/TheHive-Project/Cortex/issues/91)
17+
- Cortex 2.0.3 docker container having cortex analyzer errors [\#90](https://github.com/TheHive-Project/Cortex/issues/90)
18+
- Install python3 requirements for analyzers in public docker image [\#58](https://github.com/TheHive-Project/Cortex/issues/58)
19+
20+
**Closed issues:**
21+
22+
- Insufficient Rights To Perform This Action [\#87](https://github.com/TheHive-Project/Cortex/issues/87)
23+
24+
## [2.0.3](https://github.com/TheHive-Project/Cortex/tree/2.0.3) (2018-04-09)
525
[Full Changelog](https://github.com/TheHive-Project/Cortex/compare/2.0.2...2.0.3)
626

727
**Implemented enhancements:**

app/org/thp/cortex/controllers/AnalyzerCtrl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import javax.inject.{ Inject, Singleton }
44

55
import scala.concurrent.{ ExecutionContext, Future }
66

7-
import play.api.libs.json.{ JsNull, JsObject, Json }
7+
import play.api.libs.json.{ JsObject, Json }
88
import play.api.mvc.{ AbstractController, Action, AnyContent, ControllerComponents }
99

1010
import akka.stream.Materializer

app/org/thp/cortex/controllers/MispCtrl.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ package org.thp.cortex.controllers
22

33
import javax.inject.Inject
44
import org.elastic4play.controllers.{ Authenticated, Fields, FieldsBodyParser, Renderer }
5-
import org.elastic4play.services.QueryDSL
65
import org.thp.cortex.models.Roles
76
import org.thp.cortex.services.{ AnalyzerSrv, MispSrv }
87
import play.api.Logger
9-
import play.api.libs.json.{ JsObject, JsValue, Json }
8+
import play.api.libs.json.{ JsObject, JsValue }
109
import play.api.mvc._
1110

1211
import scala.concurrent.{ ExecutionContext, Future }

app/org/thp/cortex/controllers/UserCtrl.scala

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,11 @@ class UserCtrl @Inject() (
210210
}
211211

212212
@Timed
213-
def getKey(userId: String): Action[AnyContent] = authenticated(Roles.orgAdmin, Roles.superAdmin).async { implicit request
213+
def getKey(userId: String): Action[AnyContent] = authenticated().async { implicit request
214214
for {
215215
_ checkUserOrganization(userId)
216+
_ if (userId == request.userId || request.roles.contains(Roles.orgAdmin) || request.roles.contains(Roles.superAdmin)) Future.successful(())
217+
else Future.failed(AuthorizationError("You are not authorized to perform this operation"))
216218
key authSrv.getKey(userId)
217219
} yield Ok(key)
218220
}
@@ -226,9 +228,11 @@ class UserCtrl @Inject() (
226228
}
227229

228230
@Timed
229-
def renewKey(userId: String): Action[AnyContent] = authenticated(Roles.orgAdmin, Roles.superAdmin).async { implicit request
231+
def renewKey(userId: String): Action[AnyContent] = authenticated().async { implicit request
230232
for {
231233
_ checkUserOrganization(userId)
234+
_ if (userId == request.userId || request.roles.contains(Roles.orgAdmin) || request.roles.contains(Roles.superAdmin)) Future.successful(())
235+
else Future.failed(AuthorizationError("You are not authorized to perform this operation"))
232236
key authSrv.renewKey(userId)
233237
} yield Ok(key)
234238
}

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ dockerCommands ~= { dc =>
145145
"pip3 install -U pip setuptools && " +
146146
"cd /opt && " +
147147
"git clone https://github.com/CERT-BDF/Cortex-Analyzers.git && " +
148-
"pip install $(sort -u Cortex-Analyzers/analyzers/*/requirements.txt) && " +
149-
"sort -u Cortex-Analyzers/analyzers/*/requirements.txt | grep -v ';python_version' | xargs -n 1 pip3 install || true"),
148+
"for I in Cortex-Analyzers/analyzers/*/requirements.txt; do pip2 install -r $I; done && " +
149+
"for I in Cortex-Analyzers/analyzers/*/requirements.txt; do pip3 install -r $I || true; done"),
150150
Cmd("ADD", "var", "/var"),
151151
Cmd("ADD", "etc", "/etc"),
152152
ExecCmd("RUN", "chown", "-R", "daemon:root", "/var/log/cortex"),

conf/reference.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ search {
5050
}
5151

5252
auth.provider = ["local"]
53+
auth.method.basic = false
5354

5455
# Datastore
5556
datastore {

version.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version in ThisBuild := "2.0.3"
1+
version in ThisBuild := "2.0.4"

www/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cortex",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"description": "A powerfull observable analysis engine",
55
"license": "AGPL-v3",
66
"homepage": "https://github.com/TheHive-Project/Cortex",

www/src/app/components/header/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="container-fluid">
1414
<div class="navbar-header">
1515
<!-- <a href class="navbar-brand"><b>Cortex</b></a> -->
16-
<a class="navbar-brand" ui-sref="main.analyzers">
16+
<a class="navbar-brand" ui-sref="index">
1717
<img alt="Cortex" src="../../../assets/images/logo-small.svg">
1818
</a>
1919
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">

www/src/app/pages/admin/common/user-dialog/user.edit.controller.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,17 @@ export default class UserEditController {
9999
return;
100100
}
101101

102-
let postData = _.pick(this.formData, 'name', 'roles', 'organization');
102+
let postData;
103103
let promise;
104104

105+
if (
106+
this.AuthService.currentUser.roles.indexOf(this.Roles.SUPERADMIN) !== -1
107+
) {
108+
postData = _.pick(this.formData, 'name', 'roles', 'organization');
109+
} else {
110+
postData = _.pick(this.formData, 'name', 'roles');
111+
}
112+
105113
if (this.user.id) {
106114
promise = this.UserService.update(this.user.id, postData);
107115
} else {

0 commit comments

Comments
 (0)