Skip to content

Commit

Permalink
Merge branch 'release/3.1.0-RC2'
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Aug 27, 2018
2 parents 588086a + 7aac58b commit 7a4622d
Show file tree
Hide file tree
Showing 78 changed files with 689 additions and 409 deletions.
40 changes: 40 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,45 @@
# Change Log

## [3.1.0-RC2](https://github.com/TheHive-Project/TheHive/tree/3.1.0-RC2) (2018-08-27)

[Full Changelog](https://github.com/TheHive-Project/TheHive/compare/3.1.0-RC1...3.1.0-RC2)

**Implemented enhancements:**

- Add a search box to quickly search for case by caseId [\#685](https://github.com/TheHive-Project/TheHive/issues/685)
- MISP Exports in livestream miss hyperlink to caseid [\#684](https://github.com/TheHive-Project/TheHive/issues/684)
- Remember task list configuration \(grouped/list\) [\#681](https://github.com/TheHive-Project/TheHive/issues/681)
- x509 certificate authentication option 'wantClientAuth' [\#667](https://github.com/TheHive-Project/TheHive/issues/667)
- TheHive 3.1RC1: Slow reaction if Cortex is \(unclear\) unreachable [\#664](https://github.com/TheHive-Project/TheHive/issues/664)
- TheHive 3.1RC1: Add status to cases and tasks in new search page [\#663](https://github.com/TheHive-Project/TheHive/issues/663)
- TheHive 3.1RC1: Add Username that executes an active response to json data field of responder [\#662](https://github.com/TheHive-Project/TheHive/issues/662)
- Application.conf needs clarifications [\#606](https://github.com/TheHive-Project/TheHive/issues/606)
- Ability to set custom fields as mandatory [\#652](https://github.com/TheHive-Project/TheHive/issues/652)
- Observable type boxes doesn't line break on alert preview pane [\#593](https://github.com/TheHive-Project/TheHive/issues/593)
- On branch betterDescriptions [\#660](https://github.com/TheHive-Project/TheHive/pull/660) ([secdecompiled](https://github.com/secdecompiled))

**Fixed bugs:**

- 3.1.0-RC1- Tasks list is limited to 10 items. [\#679](https://github.com/TheHive-Project/TheHive/issues/679)
- WebUI inaccessible after upgrading to 3.1.0-0-RC1 \(elastic4play and Play exceptions\) [\#674](https://github.com/TheHive-Project/TheHive/issues/674)
- play.crypto.secret is depecrated [\#671](https://github.com/TheHive-Project/TheHive/issues/671)
- The hive docker image has no latest tag [\#670](https://github.com/TheHive-Project/TheHive/issues/670)
- 'Tagged as' displayed in Related Cases even if cases are untagged [\#594](https://github.com/TheHive-Project/TheHive/issues/594)
- Horizontal Scrolling and Word-Wrap options for Logs [\#573](https://github.com/TheHive-Project/TheHive/issues/573)
- case metrics unordered in cases [\#419](https://github.com/TheHive-Project/TheHive/issues/419)

**Closed issues:**

- ES Mapping bug [\#680](https://github.com/TheHive-Project/TheHive/issues/680)
- ignore - delete me [\#675](https://github.com/TheHive-Project/TheHive/issues/675)
- HTTPS not working with Keystore [\#669](https://github.com/TheHive-Project/TheHive/issues/669)

**Merged pull requests:**

- Move input group addons from right to left for better usage [\#672](https://github.com/TheHive-Project/TheHive/pull/672) ([srilumpa](https://github.com/srilumpa))
- Update Cortex reference.conf [\#668](https://github.com/TheHive-Project/TheHive/pull/668) ([ErnHem](https://github.com/ErnHem))
- Fix some minor typos [\#658](https://github.com/TheHive-Project/TheHive/pull/658) ([srilumpa](https://github.com/srilumpa))

## [3.1.0-RC1](https://github.com/TheHive-Project/TheHive/tree/3.1.0-RC1) (2018-07-31)
[Full Changelog](https://github.com/TheHive-Project/TheHive/compare/3.0.10...3.1.0-RC1)

Expand Down
69 changes: 61 additions & 8 deletions build.sbt
@@ -1,37 +1,90 @@
import Common._
import Dependencies._

lazy val thehiveBackend = (project in file("thehive-backend"))
.enablePlugins(PlayScala)
.settings(projectSettings)
.settings(publish := {})
.settings(
publish := {},
libraryDependencies ++= Seq(
Library.Play.cache,
Library.Play.ws,
Library.Play.ahc,
Library.Play.filters,
Library.Play.guice,
Library.scalaGuice,
Library.elastic4play,
Library.zip4j,
Library.reflections,
Library.akkaCluster,
Library.akkaClusterTools
),
play.sbt.routes.RoutesKeys.routesImport -= "controllers.Assets.Asset"
)

lazy val thehiveMetrics = (project in file("thehive-metrics"))
.enablePlugins(PlayScala)
.dependsOn(thehiveBackend)
.settings(projectSettings)
.settings(publish := {})
.settings(
publish := {},
libraryDependencies ++= Seq(
Library.Play.cache,
Library.Play.ws,
Library.scalaGuice,
Library.elastic4play,
Library.reflections,
"io.dropwizard.metrics" % "metrics-core" % "3.1.2",
"io.dropwizard.metrics" % "metrics-json" % "3.1.2",
"io.dropwizard.metrics" % "metrics-jvm" % "3.1.2",
"io.dropwizard.metrics" % "metrics-logback" % "3.1.2",
"io.dropwizard.metrics" % "metrics-graphite" % "3.1.2",
"io.dropwizard.metrics" % "metrics-ganglia" % "3.1.2",
"info.ganglia.gmetric4j" % "gmetric4j" % "1.0.10"
)
)

lazy val thehiveMisp = (project in file("thehive-misp"))
.enablePlugins(PlayScala)
.dependsOn(thehiveBackend)
.settings(projectSettings)
.settings(publish := {})
.settings(
publish := {},
libraryDependencies ++= Seq(
Library.Play.ws,
Library.Play.guice,
Library.Play.ahc,
Library.zip4j,
Library.elastic4play
)
)

lazy val thehiveCortex = (project in file("thehive-cortex"))
.enablePlugins(PlayScala)
.dependsOn(thehiveBackend)
.settings(projectSettings)
.settings(publish := {})
.settings(
publish := {},
libraryDependencies ++= Seq(
Library.Play.ws,
Library.Play.guice,
Library.Play.ahc,
Library.elastic4play,
Library.zip4j
)
)

lazy val thehive = (project in file("."))
.enablePlugins(PlayScala)
.enablePlugins(PlayScala/*, PlayAkkaHttp2Support*/)
.enablePlugins(Bintray)
.dependsOn(thehiveBackend, thehiveMetrics, thehiveMisp, thehiveCortex)
.aggregate(thehiveBackend, thehiveMetrics, thehiveMisp, thehiveCortex)
.settings(projectSettings)
.settings(aggregate in Debian := false)
.settings(aggregate in Rpm := false)
.settings(aggregate in Docker := false)
.settings(
aggregate in Debian := false,
aggregate in Rpm := false,
aggregate in Docker := false
)

lazy val rpmPackageRelease = (project in file("package/rpm-release"))
.enablePlugins(RpmPlugin)
Expand Down
2 changes: 1 addition & 1 deletion conf/application.sample
@@ -1,7 +1,7 @@
# Secret Key
# The secret key is used to secure cryptographic functions.
# WARNING: If you deploy your application on several servers, make sure to use the same key.
#play.crypto.secret="***changeme***"
#play.http.secret.key="***changeme***"

# Elasticsearch
search {
Expand Down
8 changes: 4 additions & 4 deletions project/Dependencies.scala
Expand Up @@ -16,12 +16,12 @@ object Dependencies {
val guice = "com.typesafe.play" %% "play-guice" % version
}

val scalaGuice = "net.codingwell" %% "scala-guice" % "4.1.0"
val scalaGuice = "net.codingwell" %% "scala-guice" % "4.2.1"

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.0"
val akkaCluster = "com.typesafe.akka" %% "akka-cluster" % "2.5.6"
val akkaClusterTools = "com.typesafe.akka" %% "akka-cluster-tools" % "2.5.6"
val elastic4play = "org.thehive-project" %% "elastic4play" % "1.6.1"
val akkaCluster = "com.typesafe.akka" %% "akka-cluster" % "2.5.11"
val akkaClusterTools = "com.typesafe.akka" %% "akka-cluster-tools" % "2.5.11"
}
}
3 changes: 1 addition & 2 deletions project/plugins.sbt
@@ -1,9 +1,8 @@
// Comment to get more information during initialization
logLevel := Level.Info

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.16")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.18")

//addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1")

addSbtPlugin("org.scalariform" % "sbt-scalariform" % "1.8.2")
8 changes: 3 additions & 5 deletions thehive-backend/app/connectors/Connectors.scala
@@ -1,24 +1,22 @@
package connectors

import javax.inject.{ Inject, Singleton }

import scala.collection.immutable
import scala.concurrent.Future

import play.api.libs.json.{ JsObject, Json }
import play.api.mvc._
import play.api.routing.sird.UrlContext
import play.api.routing.{ Router, SimpleRouter }

import com.google.inject.AbstractModule
import javax.inject.{ Inject, Singleton }
import models.HealthStatus
import net.codingwell.scalaguice.{ ScalaModule, ScalaMultibinder }

trait Connector {
val name: String
val router: Router
def status: Future[JsObject] = Future.successful(Json.obj("enabled" true))
def health: Future[HealthStatus.Type] = Future.successful(HealthStatus.Ok)
def status: JsObject = Json.obj("enabled" true)
def health: HealthStatus.Type = HealthStatus.Ok
}

@Singleton
Expand Down
45 changes: 21 additions & 24 deletions thehive-backend/app/controllers/StatusCtrl.scala
Expand Up @@ -3,7 +3,7 @@ package controllers
import javax.inject.{ Inject, Singleton }

import scala.collection.immutable
import scala.concurrent.{ ExecutionContext, Future }
import scala.concurrent.ExecutionContext
import scala.util.Try
import play.api.Configuration
import play.api.libs.json.{ JsBoolean, JsObject, JsString, Json }
Expand All @@ -29,28 +29,25 @@ class StatusCtrl @Inject() (
private[controllers] def getVersion(c: Class[_]) = Option(c.getPackage.getImplementationVersion).getOrElse("SNAPSHOT")

@Timed("controllers.StatusCtrl.get")
def get: Action[AnyContent] = Action.async {
def get: Action[AnyContent] = Action {
val clusterStatusName = Try(dbIndex.clusterStatusName).getOrElse("ERROR")
Future.traverse(connectors)(c c.status.map(c.name _))
.map { connectorStatus
Ok(Json.obj(
"versions" Json.obj(
"TheHive" getVersion(classOf[models.Case]),
"Elastic4Play" getVersion(classOf[Timed]),
"Play" getVersion(classOf[AbstractController]),
"Elastic4s" getVersion(classOf[ElasticDsl]),
"ElasticSearch" getVersion(classOf[org.elasticsearch.Build])),
"connectors" JsObject(connectorStatus.toSeq),
"health" Json.obj("elasticsearch" clusterStatusName),
"config" Json.obj(
"protectDownloadsWith" configuration.get[String]("datastore.attachment.password"),
"authType" (authSrv match {
case multiAuthSrv: MultiAuthSrv multiAuthSrv.authProviders.map { a JsString(a.name) }
case _ JsString(authSrv.name)
}),
"capabilities" authSrv.capabilities.map(c JsString(c.toString)),
"ssoAutoLogin" JsBoolean(configuration.getOptional[Boolean]("auth.sso.autologin").getOrElse(false)))))
}
Ok(Json.obj(
"versions" Json.obj(
"TheHive" getVersion(classOf[models.Case]),
"Elastic4Play" getVersion(classOf[Timed]),
"Play" getVersion(classOf[AbstractController]),
"Elastic4s" getVersion(classOf[ElasticDsl]),
"ElasticSearch" getVersion(classOf[org.elasticsearch.Build])),
"connectors" JsObject(connectors.map(c c.name c.status).toSeq),
"health" Json.obj("elasticsearch" clusterStatusName),
"config" Json.obj(
"protectDownloadsWith" configuration.get[String]("datastore.attachment.password"),
"authType" (authSrv match {
case multiAuthSrv: MultiAuthSrv multiAuthSrv.authProviders.map { a JsString(a.name) }
case _ JsString(authSrv.name)
}),
"capabilities" authSrv.capabilities.map(c JsString(c.toString)),
"ssoAutoLogin" JsBoolean(configuration.getOptional[Boolean]("auth.sso.autologin").getOrElse(false)))))
}

@Timed("controllers.StatusCtrl.health")
Expand All @@ -62,8 +59,8 @@ class StatusCtrl @Inject() (
case 1 HealthStatus.Warning
case _ HealthStatus.Error
}
connectorStatus Future.traverse(connectors)(c c.health)
distinctStatus = connectorStatus + dbStatus
connectorStatus = connectors.map(c c.health).toSeq
distinctStatus = connectorStatus :+ dbStatus
globalStatus = if (distinctStatus.contains(HealthStatus.Ok)) {
if (distinctStatus.size > 1) HealthStatus.Warning else HealthStatus.Ok
}
Expand Down
19 changes: 0 additions & 19 deletions thehive-backend/build.sbt

This file was deleted.

2 changes: 1 addition & 1 deletion thehive-cortex/app/connectors/cortex/CortexConnector.scala
Expand Up @@ -12,7 +12,7 @@ class CortexConnector(
configuration: Configuration) extends ConnectorModule with AkkaGuiceSupport {
private[CortexConnector] lazy val logger = Logger(getClass)

def configure() {
override def configure() {
try {
registerController[CortexCtrl]
bindActor[JobReplicateActor]("JobReplicateActor")
Expand Down

0 comments on commit 7a4622d

Please sign in to comment.