diff --git a/CHANGELOG.md b/CHANGELOG.md index 574b5dd31..eb83e9c9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,22 +1,30 @@ # Change Log -## [3.0.0-RC4](https://github.com/TheHive-Project/Cortex/tree/3.0.0-RC4) (2019-07-10) +## [3.0.0](https://github.com/TheHive-Project/Cortex/tree/HEAD) (2019-09-05) + +[Full Changelog](https://github.com/TheHive-Project/Cortex/compare/3.0.0-RC4...3.0.0) + +**Fixed bugs:** + +- cortex 3.0.0-RC4 container : StreamSrv error popup spamming the setup page [\#210](https://github.com/TheHive-Project/Cortex/issues/210) +## [3.0.0-RC4](https://github.com/TheHive-Project/Cortex/tree/3.0.0-RC4) (2019-07-10) [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/3.0.0-RC3...3.0.0-RC4) **Fixed bugs:** +- Yara analyzer configuration dialog broken [\#134](https://github.com/TheHive-Project/Cortex/issues/134) - Responder run displayed as Analyzer run [\#207](https://github.com/TheHive-Project/Cortex/issues/207) - docker version of cortex breaks when you don't create a user immediately [\#204](https://github.com/TheHive-Project/Cortex/issues/204) - Login error after Cortex upgrade to 3 [\#199](https://github.com/TheHive-Project/Cortex/issues/199) -- Yara analyzer configuration dialog broken [\#134](https://github.com/TheHive-Project/Cortex/issues/134) **Closed issues:** -- docker version of cortex prints a lot of errors for auth failures [\#205](https://github.com/TheHive-Project/Cortex/issues/205) -- dockerhub sample uses the wrong port [\#203](https://github.com/TheHive-Project/Cortex/issues/203) +- PassiveTotal SSL Certificate History analyzer always report at least one record, even if there isn't one [\#209](https://github.com/TheHive-Project/Cortex/issues/209) - Custom Responder not showing up in Responders Config Tab [\#201](https://github.com/TheHive-Project/Cortex/issues/201) - Can't enable some "free" Analyzers [\#200](https://github.com/TheHive-Project/Cortex/issues/200) +- docker version of cortex prints a lot of errors for auth failures [\#205](https://github.com/TheHive-Project/Cortex/issues/205) +- dockerhub sample uses the wrong port [\#203](https://github.com/TheHive-Project/Cortex/issues/203) ## [3.0.0-RC3](https://github.com/TheHive-Project/Cortex/tree/3.0.0-RC3) (2019-06-05) @@ -33,7 +41,6 @@ - Get user detials via API is available to non-admin users [\#194](https://github.com/TheHive-Project/Cortex/issues/194) ## [3.0.0-RC2](https://github.com/TheHive-Project/Cortex/tree/3.0.0-RC2) (2019-05-03) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/3.0.0-RC1...3.0.0-RC2) **Fixed bugs:** @@ -43,7 +50,6 @@ - Docker container exposes tcp/9000 instead of tcp/9001 [\#166](https://github.com/TheHive-Project/Cortex/issues/166) ## [3.0.0-RC1](https://github.com/TheHive-Project/Cortex/tree/3.0.0-RC1) (2019-04-05) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/2.1.3...3.0.0-RC1) **Implemented enhancements:** @@ -54,7 +60,7 @@ **Fixed bugs:** -- SSO: Authentication module not found [\#181](https://github.com/TheHive-Project/Cortex/issues/181) +- SSO: Authentication module not found [\#181](https://github.com/TheHive-Project/Cortex/issues/181) - Akka Dispatcher Blocked [\#170](https://github.com/TheHive-Project/Cortex/issues/170) **Closed issues:** @@ -65,7 +71,6 @@ - File extraction [\#120](https://github.com/TheHive-Project/Cortex/issues/120) ## [2.1.3](https://github.com/TheHive-Project/Cortex/tree/2.1.3) (2018-12-20) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/2.1.2...2.1.3) **Implemented enhancements:** @@ -83,11 +88,10 @@ **Closed issues:** -- Systemd: cortex.service: Failed with result 'exit-code'. [\#155](https://github.com/TheHive-Project/Cortex/issues/155) +- Systemd: cortex.service: Failed with result 'exit-code'. [\#155](https://github.com/TheHive-Project/Cortex/issues/155) - conf/logback.xml: Rotate logs [\#62](https://github.com/TheHive-Project/Cortex/issues/62) ## [2.1.2](https://github.com/TheHive-Project/Cortex/tree/2.1.2) (2018-10-12) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/2.1.1...2.1.2) **Fixed bugs:** @@ -95,7 +99,6 @@ - findSimilarJob function broken [\#144](https://github.com/TheHive-Project/Cortex/issues/144) ## [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:** @@ -111,7 +114,6 @@ - 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) **Implemented enhancements:** @@ -122,7 +124,7 @@ **Fixed bugs:** - MISP API fails [\#109](https://github.com/TheHive-Project/Cortex/issues/109) -- File_Info issue [\#53](https://github.com/TheHive-Project/Cortex/issues/53) +- 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) @@ -131,7 +133,6 @@ - Update resolvers in build.sbt to contain Maven as a dependency [\#130](https://github.com/TheHive-Project/Cortex/pull/130) ([adl1995](https://github.com/adl1995)) ## [2.1.0-RC1](https://github.com/TheHive-Project/Cortex/tree/2.1.0-RC1) (2018-07-31) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/2.0.4...2.1.0-RC1) **Implemented enhancements:** @@ -162,7 +163,6 @@ - Update GitHub path [\#100](https://github.com/TheHive-Project/Cortex/pull/100) ([saadkadhi](https://github.com/saadkadhi)) ## [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:** @@ -184,7 +184,6 @@ - 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:** @@ -204,7 +203,6 @@ - Allow configuring auto artifacts extraction per analyzer [\#80](https://github.com/TheHive-Project/Cortex/issues/80) ## [2.0.2](https://github.com/TheHive-Project/Cortex/tree/2.0.2) (2018-04-04) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/2.0.1...2.0.2) **Fixed bugs:** @@ -216,7 +214,6 @@ - Session collision when TheHive & Cortex 2 share the same URL [\#70](https://github.com/TheHive-Project/Cortex/issues/70) ## [2.0.1](https://github.com/TheHive-Project/Cortex/tree/2.0.1) (2018-03-30) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/2.0.0...2.0.1) **Fixed bugs:** @@ -226,7 +223,6 @@ - User can't change his password [\#67](https://github.com/TheHive-Project/Cortex/issues/67) ## [2.0.0](https://github.com/TheHive-Project/Cortex/tree/2.0.0) (2018-03-30) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/1.1.4...2.0.0) **Implemented enhancements:** @@ -249,7 +245,7 @@ - Local, LDAP, AD and API Key Authentication [\#7](https://github.com/TheHive-Project/Cortex/issues/7) - Limit Rates and Respect Quotas [\#6](https://github.com/TheHive-Project/Cortex/issues/6) - Persistence and Report Caching [\#5](https://github.com/TheHive-Project/Cortex/issues/5) -- Provide alternative paths for analyzers in addition to standard path. [\#4](https://github.com/TheHive-Project/Cortex/issues/4) +- Provide alternative paths for analyzers in addition to standard path. [\#4](https://github.com/TheHive-Project/Cortex/issues/4) - Provide way to reload conf file for new API keys without shutdown. [\#3](https://github.com/TheHive-Project/Cortex/issues/3) - Provide Secret Key auth to upstream service [\#2](https://github.com/TheHive-Project/Cortex/issues/2) @@ -260,7 +256,6 @@ - Adding WOT config sample [\#43](https://github.com/TheHive-Project/Cortex/pull/43) ([mthlvt](https://github.com/mthlvt)) ## [1.1.4](https://github.com/TheHive-Project/Cortex/tree/1.1.4) (2017-09-15) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/1.1.3...1.1.4) **Fixed bugs:** @@ -274,7 +269,6 @@ - Disable analyzer in configuration file [\#32](https://github.com/TheHive-Project/Cortex/issues/32) ## [1.1.3](https://github.com/TheHive-Project/Cortex/tree/1.1.3) (2017-06-14) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/debian/1.1.2-2...1.1.3) **Fixed bugs:** @@ -283,11 +277,9 @@ - Error when parsing analyzer failure report [\#33](https://github.com/TheHive-Project/Cortex/issues/33) ## [debian/1.1.2-2](https://github.com/TheHive-Project/Cortex/tree/debian/1.1.2-2) (2017-05-24) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/1.1.2...debian/1.1.2-2) ## [1.1.2](https://github.com/TheHive-Project/Cortex/tree/1.1.2) (2017-05-24) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/debian/1.1.1-2...1.1.2) **Implemented enhancements:** @@ -302,11 +294,9 @@ - Error 500 in TheHive when a job is submited to Cortex [\#27](https://github.com/TheHive-Project/Cortex/issues/27) ## [debian/1.1.1-2](https://github.com/TheHive-Project/Cortex/tree/debian/1.1.1-2) (2017-05-19) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/rpm/1.1.1-2...debian/1.1.1-2) ## [rpm/1.1.1-2](https://github.com/TheHive-Project/Cortex/tree/rpm/1.1.1-2) (2017-05-19) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/1.1.1...rpm/1.1.1-2) **Fixed bugs:** @@ -314,7 +304,6 @@ - After Upgrade from Cortex 1.0.2 to 1.1.1 system does not come up [\#26](https://github.com/TheHive-Project/Cortex/issues/26) ## [1.1.1](https://github.com/TheHive-Project/Cortex/tree/1.1.1) (2017-05-17) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/1.1.0...1.1.1) **Fixed bugs:** @@ -327,7 +316,6 @@ - MISP integration [\#21](https://github.com/TheHive-Project/Cortex/issues/21) ## [1.1.0](https://github.com/TheHive-Project/Cortex/tree/1.1.0) (2017-05-12) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/1.0.2...1.1.0) **Implemented enhancements:** @@ -342,7 +330,6 @@ - Use new logo and favicon [\#22](https://github.com/TheHive-Project/Cortex/issues/22) ## [1.0.2](https://github.com/TheHive-Project/Cortex/tree/1.0.2) (2017-04-19) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/1.0.1...1.0.2) **Fixed bugs:** @@ -358,7 +345,6 @@ - Documentation on 'How to create an analyzer' [\#10](https://github.com/TheHive-Project/Cortex/issues/10) ## [1.0.1](https://github.com/TheHive-Project/Cortex/tree/1.0.1) (2017-03-08) - [Full Changelog](https://github.com/TheHive-Project/Cortex/compare/1.0.0...1.0.1) **Fixed bugs:** @@ -371,4 +357,5 @@ ## [1.0.0](https://github.com/TheHive-Project/Cortex/tree/1.0.0) (2017-02-01) -\* _This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)_ + +\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file diff --git a/app/org/thp/cortex/controllers/StreamCtrl.scala b/app/org/thp/cortex/controllers/StreamCtrl.scala index e5aab089c..2059af71f 100644 --- a/app/org/thp/cortex/controllers/StreamCtrl.scala +++ b/app/org/thp/cortex/controllers/StreamCtrl.scala @@ -21,7 +21,7 @@ import org.thp.cortex.services.StreamActor.StreamMessages import org.elastic4play.Timed import org.elastic4play.controllers._ -import org.elastic4play.services.{AuxSrv, EventSrv, MigrationSrv} +import org.elastic4play.services.{AuxSrv, EventSrv, MigrationSrv, UserSrv} @Singleton class StreamCtrl( @@ -32,6 +32,7 @@ class StreamCtrl( authenticated: Authenticated, renderer: Renderer, eventSrv: EventSrv, + userSrv: UserSrv, auxSrv: AuxSrv, migrationSrv: MigrationSrv, components: ControllerComponents, @@ -45,6 +46,7 @@ class StreamCtrl( authenticated: Authenticated, renderer: Renderer, eventSrv: EventSrv, + userSrv: UserSrv, auxSrv: AuxSrv, migrationSrv: MigrationSrv, components: ControllerComponents, @@ -59,6 +61,7 @@ class StreamCtrl( authenticated, renderer, eventSrv, + userSrv, auxSrv, migrationSrv, components, @@ -94,7 +97,7 @@ class StreamCtrl( Future.successful(BadRequest("Invalid stream id")) } else { val futureStatus = authenticated.expirationStatus(request) match { - case ExpirationError if !migrationSrv.isMigrating ⇒ authenticated.getFromApiKey(request).map(_ ⇒ OK) + case ExpirationError if !migrationSrv.isMigrating ⇒ userSrv.getInitialUser(request).recoverWith { case _ => authenticated.getFromApiKey(request)}.map(_ ⇒ OK) case _: ExpirationWarning ⇒ Future.successful(220) case _ ⇒ Future.successful(OK) } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index c6f1b3467..7e7ace2f0 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -18,7 +18,7 @@ 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.11.4" + val elastic4play = "org.thehive-project" %% "elastic4play" % "1.11.5" val dockerClient = "com.spotify" % "docker-client" % "8.14.4" } diff --git a/version.sbt b/version.sbt index 280820ca0..8ba1f6fcb 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "3.0.0-RC4" +version in ThisBuild := "3.0.0-1" diff --git a/www/package.json b/www/package.json index 54df46419..56138bc12 100755 --- a/www/package.json +++ b/www/package.json @@ -75,4 +75,4 @@ "webpack": "^3.5.0", "webpack-dev-server": "^2.2.0" } -} \ No newline at end of file +} diff --git a/www/src/app/core/services/common/StreamService.js b/www/src/app/core/services/common/StreamService.js index 53cad16e3..7c98593c8 100644 --- a/www/src/app/core/services/common/StreamService.js +++ b/www/src/app/core/services/common/StreamService.js @@ -3,7 +3,7 @@ import lo from 'lodash'; import angular from 'angular'; -export default function(app) { +export default function (app) { function StreamSrv( $rootScope, $http, @@ -15,15 +15,15 @@ export default function(app) { this.isPolling = false; this.streamId = null; - this.init = function() { + this.init = function () { this.streamId = null; this.requestStream(); }; - this.runCallbacks = function(id, objectType, message) { + this.runCallbacks = function (id, objectType, message) { $rootScope.$broadcast('stream:' + id + '-' + objectType, message); }; - this.handleStreamResponse = function(data) { + this.handleStreamResponse = function (data) { if (!data || data.length === 0) { return; } @@ -37,9 +37,8 @@ export default function(app) { let rootId = message.base.rootId; let objectType = message.base.objectType; let rootIdWithObjectType = rootId + '|' + objectType; - let secondaryObjectTypes = message.summary - ? lo.without(lo.keys(message.summary), objectType) - : []; + let secondaryObjectTypes = message.summary ? + lo.without(lo.keys(message.summary), objectType) : []; if (rootId in byRootIds) { byRootIds[rootId].push(message); @@ -94,7 +93,7 @@ export default function(app) { this.runCallbacks('any', 'any', data); }; - this.poll = function() { + this.poll = function () { // Skip polling is a poll is already running if (this.streamId === null || this.isPolling === true) { return; @@ -104,46 +103,46 @@ export default function(app) { this.isPolling = true; // Poll stream changes - $http.get('./api/stream/' + this.streamId).then( - response => { - // Flag polling end - this.isPolling = false; - - // Handle stream data and callbacks - this.handleStreamResponse(response.data); - - // Check if the session will expire soon - // TODO - // if (status === 220) { - // AfkSrv.prompt().then(function () { - // UserSrv.getUserInfo(AuthService.currentUser.id).then( - // function () {}, - // function (response) { - // NotificationService.error('StreamSrv', response.data, response.status); - // } - // ); - // }); - // } - this.poll(); - }, - (data, status) => { + $http.get('./api/stream/' + this.streamId) + .then( + response => { + // Flag polling end + this.isPolling = false; + + // Handle stream data and callbacks + this.handleStreamResponse(response.data); + + // Check if the session will expire soon + // TODO + // if (status === 220) { + // AfkSrv.prompt().then(function () { + // UserSrv.getUserInfo(AuthService.currentUser.id).then( + // function () {}, + // function (response) { + // NotificationService.error('StreamSrv', response.data, response.status); + // } + // ); + // }); + // } + this.poll(); + }) + .catch(err => { // Initialize the stream; this.isPolling = false; - if (status !== 404) { - NotificationService.error('StreamSrv', data, status); + if (err.status !== 404) { + NotificationService.error('StreamSrv', err.data, err.status); - if (status === 401) { + if (err.status === 401) { return; } } this.init(); - } - ); + }); }; - this.requestStream = function() { + this.requestStream = function () { if (this.streamId !== null) { return; } @@ -166,7 +165,7 @@ export default function(app) { *