diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 000000000..8d86d704a --- /dev/null +++ b/.drone.yml @@ -0,0 +1,192 @@ +--- +kind: pipeline +name: default + +# Disable default clone +clone: + disable: true + +steps: + # This clone step doesn't use "root" user + - name: clone + image: plugins/git:next + + # Restore cache of downloaded dependencies + - name: restore cache + image: drillster/drone-volume-cache + settings: + restore: true + mount: + - .sbt + - .ivy2 + - www/node_modules + volumes: [{name: cache, path: /cache}] + + # Run project tests + - name: run tests and build stage + image: thehiveproject/drone-scala-node + commands: + - . ~/.nvm/nvm.sh + - sbt -Duser.home=$PWD test stage + + # Build packages + - name: build packages + image: thehiveproject/drone-scala-node + settings: + pgp_key: {from_secret: pgp_key} + commands: + - | + . ~/.nvm/nvm.sh + [ -n "$PLUGIN_PGP_KEY" ] && gpg --batch --import - <<< $PLUGIN_PGP_KEY + sbt -Duser.home=$PWD docker:stage debian:packageBin rpm:packageBin universal:packageBin + when: + event: [tag] + + # Save external libraries in cache + - name: save cache + image: drillster/drone-volume-cache + settings: + rebuild: true + mount: + - .sbt + - .ivy2 + - www/node_modules + volumes: [{name: cache, path: /cache}] + + - name: publish packages + image: thehiveproject/drone-bintray + settings: + user: {from_secret: bintray_user} + key: {from_secret: bintray_key} + subject: thehive-project + package: cortex + commands: + - | + export PLUGIN_USER + export PLUGIN_KEY + export PLUGIN_SUBJECT + export PLUGIN_PACKAGE + export PLUGIN_VERSION=$(cut -d\" -f2 version.sbt) + echo "Publishing package version $PLUGIN_VERSION" + + if echo $PLUGIN_VERSION | grep -qvi -E \ + -e '^[0-9]+\.[0-9]+\.[0-9]+$' \ + -e '^[0-9]+\.[0-9]+\.[0-9]+-[0-9]+$' \ + -e '^[0-9]+\.[0-9]+\.[0-9]+-RC[0-9]+$'; then + echo The version $PLUGIN_VERSION has invalid format + exit 1 + fi + + CHANNEL=stable + echo $PLUGIN_VERSION | grep -qi rc && CHANNEL=beta + + DEB_FILE=target/cortex_$${PLUGIN_VERSION}_all.deb + RPM_FILE=target/rpm/RPMS/noarch/cortex-$${PLUGIN_VERSION}.noarch.rpm + ZIP_FILE=target/universal/cortex-$${PLUGIN_VERSION}.zip + + upload \ + --file $DEB_FILE \ + --repo debian-beta \ + --extra-param deb_distribution=any \ + --extra-param deb_component=main \ + --extra-param deb_architecture=all + + [ $CHANNEL = stable ] && upload \ + --file $DEB_FILE \ + --repo debian-stable \ + --extra-param deb_distribution=any \ + --extra-param deb_component=main \ + --extra-param deb_architecture=all + + upload \ + --file $RPM_FILE \ + --repo rpm-beta + + [ $CHANNEL = stable ] && upload \ + --file $RPM_FILE \ + --repo rpm-stable + + upload \ + --file $ZIP_FILE \ + --repo binary + + LATEST_VERSION=latest + [ $CHANNEL = beta ] && LATEST_VERSION=latest-beta + + removeVersion \ + --repo binary \ + --version $LATEST_VERSION + + upload \ + --file $ZIP_FILE \ + --repo binary \ + --version $LATEST_VERSION \ + --dest-file cortex-$${LATEST_VERSION}.zip + when: + event: [tag] + + # Publish docker image + - name: docker + image: plugins/docker + settings: + context: target/docker/stage + dockerfile: target/docker/stage/Dockerfile + repo: thehiveproject/cortex + auto_tag: true + username: {from_secret: docker_username} + password: {from_secret: docker_password} + when: + event: [tag] + + # Deploy binaries in integration environment + - name: copy binaries in integration environment + image: appleboy/drone-scp + settings: + host: {from_secret: deploy_beta_host} + username: {from_secret: deploy_username} + key: {from_secret: deploy_key} + target: ./cortex-builds/${DRONE_BUILD_NUMBER} + source: target/universal/stage + strip_components: 3 + when: + branch: [develop] + + - name: deploy binaries in integration environment + image: appleboy/drone-ssh + settings: + host: {from_secret: deploy_beta_host} + username: {from_secret: deploy_username} + key: {from_secret: deploy_key} + script: + - ./start cortex ${DRONE_BUILD_NUMBER} + when: + branch: [develop] + + # Deploy binaries in staging environment + - name: copy binaries in staging environment + image: appleboy/drone-scp + settings: + host: {from_secret: deploy_stable_host} + username: {from_secret: deploy_username} + key: {from_secret: deploy_key} + target: ./cortex-builds/${DRONE_BUILD_NUMBER} + source: target/universal/stage + strip_components: 3 + when: + branch: [master] + + - name: deploy binaries in staging environment + image: appleboy/drone-ssh + settings: + host: {from_secret: deploy_stable_host} + username: {from_secret: deploy_username} + key: {from_secret: deploy_key} + script: + - ./start cortex ${DRONE_BUILD_NUMBER} + when: + branch: [master] + +volumes: + - name: cache + host: + path: /opt/drone/cache diff --git a/CHANGELOG.md b/CHANGELOG.md index 305a27c03..4b0e1971f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,32 @@ # Change Log -## [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...HEAD) +## [2.1.3](https://github.com/TheHive-Project/Cortex/tree/2.1.3) + +[Full Changelog](https://github.com/TheHive-Project/Cortex/compare/2.1.2...2.1.3) + +**Implemented enhancements:** + +- Add configuration for drone continuous integration [\#156](https://github.com/TheHive-Project/Cortex/issues/156) +- Add PAP property to jobs list [\#146](https://github.com/TheHive-Project/Cortex/issues/146) **Fixed bugs:** +- Wrong checks of role when an user is created [\#158](https://github.com/TheHive-Project/Cortex/issues/158) +- Unable to disable invalid responders [\#157](https://github.com/TheHive-Project/Cortex/issues/157) +- PAP field is ignored from job modal [\#152](https://github.com/TheHive-Project/Cortex/issues/152) +- SinkDB analyzer could not find DIG in the Cortex docker image [\#147](https://github.com/TheHive-Project/Cortex/issues/147) - GUI Search Function is broken [\#145](https://github.com/TheHive-Project/Cortex/issues/145) + +**Closed issues:** + +- 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:** + - 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) diff --git a/app/org/thp/cortex/controllers/UserCtrl.scala b/app/org/thp/cortex/controllers/UserCtrl.scala index 7db3d66f1..3e2124bfb 100644 --- a/app/org/thp/cortex/controllers/UserCtrl.scala +++ b/app/org/thp/cortex/controllers/UserCtrl.scala @@ -42,7 +42,7 @@ class UserCtrl @Inject() ( if organization.status() == OrganizationStatus.Active && (request.roles.contains(Roles.superAdmin) || (userOrganizationId == organizationId && - !request.body.getStrings("roles").getOrElse(Nil).contains(Roles.superAdmin.toString))) + !request.body.getStrings("roles").getOrElse(Nil).contains(Roles.superAdmin.name))) user ← userSrv.create(request.body.set("organization", organizationId)) } yield renderer.toOutput(CREATED, user)) .recoverWith { diff --git a/debian.sbt b/debian.sbt index 798a7905f..c4d194d5b 100644 --- a/debian.sbt +++ b/debian.sbt @@ -1,6 +1,15 @@ -import Common._ +import Common.{stableVersion, betaVersion, snapshotVersion} -version in Debian := getVersion(version.value) + '-' + getRelease(version.value) +linuxPackageMappings in Debian += packageMapping(file("LICENSE") -> "/usr/share/doc/cortex/copyright").withPerms("644") +version in Debian := { + version.value match { + case stableVersion(_, _) => version.value + case betaVersion(v1, v2) => v1 + "-0.1RC" + v2 + case snapshotVersion(_, _) => version.value + "-SNAPSHOT" + case _ => sys.error("Invalid version: " + version.value) + } +} +debianPackageRecommends := Seq("elasticsearch") debianPackageDependencies += "java8-runtime | java8-runtime-headless" maintainerScripts in Debian := maintainerScriptsFromDirectory( baseDirectory.value / "package" / "debian", diff --git a/docker.sbt b/docker.sbt index df6ed9ef8..1a64fabbb 100644 --- a/docker.sbt +++ b/docker.sbt @@ -1,20 +1,26 @@ -import Common._ -import com.typesafe.sbt.packager.docker.{ Cmd, ExecCmd } +import Common.{betaVersion, snapshotVersion, stableVersion} +import com.typesafe.sbt.packager.docker.{Cmd, ExecCmd} -version in Docker := getVersion(version.value) + '-' + getRelease(version.value) +version in Docker := { + version.value match { + case stableVersion(_, _) => version.value + case betaVersion(v1, v2) => v1 + "-0.1RC" + v2 + case snapshotVersion(_, _) => version.value + "-SNAPSHOT" + case _ => sys.error("Invalid version: " + version.value) + } +} defaultLinuxInstallLocation in Docker := "/opt/cortex" dockerRepository := Some("thehiveproject") -dockerUpdateLatest := true +dockerUpdateLatest := !version.value.toUpperCase.contains("RC") dockerEntrypoint := Seq("/opt/cortex/entrypoint") -dockerExposedPorts := Seq(9001) +dockerExposedPorts := Seq(9000) mappings in Docker ++= Seq( file("package/docker/entrypoint") -> "/opt/cortex/entrypoint", - file("conf/logback.xml") -> "/etc/cortex/logback.xml", + file("package/logback.xml") -> "/etc/cortex/logback.xml", file("package/empty") -> "/var/log/cortex/application.log") mappings in Docker ~= (_.filterNot { case (_, filepath) => filepath == "/opt/cortex/conf/application.conf" }) - dockerCommands ~= { dc => val (dockerInitCmds, dockerTailCmds) = dc .collect { @@ -27,7 +33,7 @@ dockerCommands ~= { dc => Cmd("USER", "root"), ExecCmd("RUN", "bash", "-c", "apt-get update && " + - "apt-get install -y --no-install-recommends python-pip python2.7-dev python3-pip python3-dev ssdeep libfuzzy-dev libfuzzy2 libimage-exiftool-perl libmagic1 build-essential git libssl-dev && " + + "apt-get install -y --no-install-recommends python-pip python2.7-dev python3-pip python3-dev ssdeep libfuzzy-dev libfuzzy2 libimage-exiftool-perl libmagic1 build-essential git libssl-dev dnsutils && " + "pip2 install -U pip setuptools && " + "pip3 install -U pip setuptools && " + "hash -r && " + diff --git a/package/logback.xml b/package/logback.xml index 2f1ff1748..2cd26af14 100644 --- a/package/logback.xml +++ b/package/logback.xml @@ -1,39 +1,47 @@ - - - - /var/log/cortex/application.log - - %date [%level] from %logger in %thread - %message%n%xException - - - - - - %coloredLevel %logger{15} - %message%n%xException{10} - - - - - - - - - - - - - - - - - - - - - + + + + /var/log/cortex/application.log + + /var/log/cortex/application.%i.log.zip + 1 + 10 + + + 10MB + + + %date [%level] from %logger in %thread - %message%n%xException + + + + + + %coloredLevel %logger{15} - %message%n%xException{10} + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/project/Common.scala b/project/Common.scala index 836f979dd..a382ef5ee 100644 --- a/project/Common.scala +++ b/project/Common.scala @@ -1,14 +1,17 @@ -import sbt._ +import scala.util.matching.Regex + import sbt.Keys._ +import sbt._ object Common { val projectSettings = Seq( organizationName := "TheHive-Project", organization := "org.thehive-project", - licenses += "AGPL-V3" -> url("https://www.gnu.org/licenses/agpl-3.0.html"), + licenses += "AGPL-V3" → url("https://www.gnu.org/licenses/agpl-3.0.html"), organizationHomepage := Some(url("http://thehive-project.org/")), resolvers += Resolver.bintrayRepo("thehive-project", "maven"), + resolvers += "elasticsearch-releases" at "https://artifacts.elastic.co/maven", scalaVersion := Dependencies.scalaVersion, scalacOptions ++= Seq( "-deprecation", // Emit warning and location for usages of deprecated APIs. @@ -22,7 +25,7 @@ object Common { "-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 => + scalacOptions in Test ~= { options ⇒ options filterNot (_ == "-Ywarn-dead-code") // Allow dead code in tests (to support using mockito). }, parallelExecution in Test := false, @@ -34,13 +37,15 @@ object Common { excludeDependencies += "org.apache.logging.log4j" % "log4j-core" ) - def getVersion(version: String): String = version.takeWhile(_ != '-') - - def getRelease(version: String): String = { - version.dropWhile(_ != '-').dropWhile(_ == '-') match { - case "" => "1" - case r if r.contains('-') => sys.error("Version can't have more than one dash") - case r => s"0.1$r" + val stableVersion: Regex = "(\\d+\\.\\d+\\.\\d+)-(\\d+)".r + val betaVersion: Regex = "(\\d+\\.\\d+\\.\\d+)-[Rr][Cc](\\d+)".r + object snapshotVersion { + def unapplySeq(version: String): Option[List[String]] = { + if (version.endsWith("-SNAPSHOT")) { + val v = version.dropRight(9) + stableVersion.unapplySeq(v) orElse betaVersion.unapplySeq(v) + } + else None } } } \ No newline at end of file diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 8076d7fd2..247b0fcf9 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -1,7 +1,7 @@ import sbt._ object Dependencies { - val scalaVersion = "2.12.6" + val scalaVersion = "2.12.7" object Play { val version = play.core.PlayVersion.current @@ -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.3" + val elastic4play = "org.thehive-project" %% "elastic4play" % "1.7.2" } diff --git a/project/build.properties b/project/build.properties index d6e35076c..72f902892 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.1.6 +sbt.version=1.2.7 diff --git a/project/plugins.sbt b/project/plugins.sbt index 1e913ddde..c2e5b0186 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,7 +2,7 @@ logLevel := Level.Info // The Play plugin -addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.16") +addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.20") addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1") diff --git a/rpm.sbt b/rpm.sbt index 888e87752..0f5ba9ba9 100644 --- a/rpm.sbt +++ b/rpm.sbt @@ -1,23 +1,46 @@ -import Common._ +import Common.{stableVersion, betaVersion, snapshotVersion} -version in Rpm := getVersion(version.value) -rpmRelease := getRelease(version.value) -rpmVendor := "TheHive Project" +version in Rpm := { + version.value match { + case stableVersion(v1, v2) => v1 + case betaVersion(v1, v2) => v1 + case snapshotVersion(v1, v2) => v1 + case _ => sys.error("Invalid version: " + version.value) + } +} +rpmRelease := { + version.value match { + case stableVersion(_, v2) => v2 + case betaVersion(v1, v2) => "0.1RC" + v2 + case snapshotVersion(v1, v2) => v2 + "-SNAPSHOT" + case _ => sys.error("Invalid version: " + version.value) + } +} +rpmVendor := organizationName.value rpmUrl := organizationHomepage.value.map(_.toString) rpmLicense := Some("AGPL") rpmRequirements += "java-1.8.0-openjdk-headless" + 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 + +linuxPackageMappings in Rpm := configWithNoReplace((linuxPackageMappings in Rpm).value) + packageBin in Rpm := { import scala.sys.process._ - val rpmFile = (packageBin in Rpm).value - s"rpm --addsign $rpmFile".!! + Process("rpm" :: + "--define" :: "_gpg_name TheHive Project" :: + "--define" :: "_signature gpg" :: + "--define" :: "__gpg_check_password_cmd /bin/true" :: + "--define" :: "__gpg_sign_cmd %{__gpg} gpg --batch --no-verbose --no-armor --use-agent --no-secmem-warning -u \"%{_gpg_name}\" -sbo %{__signature_filename} %{__plaintext_filename}" :: + "--addsign" :: rpmFile.toString :: + Nil).!! rpmFile } diff --git a/test/org/thp/cortex/AnalyzersSpec.scala b/test/org/thp/cortex/AnalyzersSpec.scala deleted file mode 100644 index df0c93827..000000000 --- a/test/org/thp/cortex/AnalyzersSpec.scala +++ /dev/null @@ -1,79 +0,0 @@ -package org.thp.cortex - -import java.nio.file.Paths - -import scala.concurrent.Future - -import play.api.Application -import play.api.inject.bind -import play.api.inject.guice.GuiceApplicationBuilder -import play.api.libs.json.{ JsValue, Json } -import play.api.mvc.RequestHeader -import play.api.test._ - -import org.mockito.Matchers -import org.specs2.mock._ -import org.thp.cortex.controllers.AnalyzerCtrl -import org.thp.cortex.models.{ Organization, Roles } -import org.thp.cortex.services.{ OrganizationSrv, UserSrv } - -import org.elastic4play.services.AuthContext - -class AnalyzersSpec extends PlaySpecification with Mockito { - - abstract class WithTheHiveApp(app: Application) extends WithApplication(app) with Injecting { - - def this(builder: GuiceApplicationBuilder ⇒ GuiceApplicationBuilder) { - this({ - val UserSrv = mock[UserSrv].verbose - val adminUser = mock[AuthContext].verbose - adminUser.roles returns Seq(Roles.read, Roles.analyze, Roles.orgAdmin) - adminUser.userId returns "admin" - UserSrv.getFromId(Matchers.any[RequestHeader], Matchers.eq("admin")) returns Future.successful(adminUser) - - builder(GuiceApplicationBuilder().configure("analyzer.path" → Seq(Paths.get("test/resources/analyzers").toAbsolutePath.toString)) - .configure("search.index" → "TEST") - .overrides(bind[UserSrv].toInstance(UserSrv))) - .build() - }) - } - - def this() = this((builder: GuiceApplicationBuilder) ⇒ builder) - } - - "analyzer" should { - - "scan and read definitions" in new WithTheHiveApp { - private val analyzerCtrl = inject[AnalyzerCtrl] - private val result = analyzerCtrl.listDefinitions()(FakeRequest() - .withSession("username" → "admin")) - - status(result) must equalTo(OK) - contentType(result) must beSome("application/json") - contentAsJson(result) - .as[Seq[JsValue]] - .map(j ⇒ (j \ "id").as[String]) must contain(allOf("fakeAnalyzer_1_0")) - } - - "be created from definition" in new WithTheHiveApp(builder ⇒ { - val organizationSrv = mock[OrganizationSrv].verbose - val fakeOrganization = mock[Organization] - organizationSrv.get("fakeOrganization") returns Future.successful(fakeOrganization) - builder.overrides(bind[OrganizationSrv].toInstance(organizationSrv)) - }) { - - private val analyzerCtrl = inject[AnalyzerCtrl] - private val result = analyzerCtrl.create("fakeAnalyzer_1_0")(FakeRequest() - .withSession("username" → "admin") - .withHeaders("Content-Type" → "application/json") - .withJsonBody(Json.obj("name" → "myFakeAnalyzerInstance"))) - - //println(s"DEBUG: body=${contentAsString(result)}") - status(result) must equalTo(CREATED) - contentType(result) must beSome("application/json") - // contentAsJson(result) must_=== Json.obj( - // "" → "") - - } - } -} diff --git a/version.sbt b/version.sbt index ee9594954..4de3efb74 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "2.1.2" +version in ThisBuild := "2.1.3-1" diff --git a/www/package.json b/www/package.json index d92084911..22c06c72e 100755 --- a/www/package.json +++ b/www/package.json @@ -52,14 +52,13 @@ "font-awesome": "^4.7.0", "html-loader": "^0.4.4", "html-webpack-plugin": "^2.22.0", - "imagemin-pngquant": "^5.0.0", "jquery": "^3.2.1", "lodash": "^4.17.4", "manifest-revision-webpack-plugin": "^0.3.0", "moment": "^2.20.1", "ng-storage": "^0.3.2", "ngtemplate-loader": "^1.3.1", - "node-sass": "^3.10.0", + "node-sass": "^4.11.0", "oclazyload": "^1.1.0", "postcss-loader": "^0.13.0", "sass-loader": "^4.0.2", 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 a7b2a90e2..ab8af8120 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 @@ -72,7 +72,7 @@

- +
diff --git a/www/src/app/pages/admin/organizations/components/responders/responders-list.html b/www/src/app/pages/admin/organizations/components/responders/responders-list.html index a7ef9299c..46b4c2933 100644 --- a/www/src/app/pages/admin/organizations/components/responders/responders-list.html +++ b/www/src/app/pages/admin/organizations/components/responders/responders-list.html @@ -1,15 +1,15 @@
-
+
-

You have {{$ctrl.invalidReponders.length}} invalid - +

You have {{$ctrl.invalidResponders.length}} invalid +

Invalid responders have no definition and cannot be run on any observable. You have to remove them.

-
+

{{r.name}} diff --git a/www/src/app/pages/analyzers/analyzers.service.js b/www/src/app/pages/analyzers/analyzers.service.js index e31fe69ec..b1061a4fe 100644 --- a/www/src/app/pages/analyzers/analyzers.service.js +++ b/www/src/app/pages/analyzers/analyzers.service.js @@ -60,7 +60,10 @@ export default class AnalyzerService { this.$http .get('./api/analyzer', { - params: { range: 'all', sort: '+name' } + params: { + range: 'all', + sort: '+name' + } }) .then( response => { @@ -152,7 +155,8 @@ export default class AnalyzerService { postData = { attachment: artifact.attachment, dataType: artifact.dataType, - tlp: artifact.tlp + tlp: artifact.tlp, + pap: artifact.pap }; return this.$http({ @@ -189,11 +193,12 @@ export default class AnalyzerService { data: artifact.data, attributes: { dataType: artifact.dataType, - tlp: artifact.tlp + tlp: artifact.tlp, + pap: artifact.pap } }; return this.$http.post('./api/analyzer/' + id + '/run', postData); } } -} +} \ No newline at end of file diff --git a/www/src/app/pages/jobs/components/jobs.list.html b/www/src/app/pages/jobs/components/jobs.list.html index a1db8d1fa..1d836edc8 100644 --- a/www/src/app/pages/jobs/components/jobs.list.html +++ b/www/src/app/pages/jobs/components/jobs.list.html @@ -16,7 +16,8 @@
Status
Job details
-
TLP
+
TLP
+
PAP
@@ -53,9 +54,12 @@

-
+
+
+ +
View diff --git a/www/src/app/pages/jobs/jobs.controller.js b/www/src/app/pages/jobs/jobs.controller.js index abd2b84f6..4a4b07872 100644 --- a/www/src/app/pages/jobs/jobs.controller.js +++ b/www/src/app/pages/jobs/jobs.controller.js @@ -101,7 +101,7 @@ export default class JobsController extends PageController { if (!_.isEmpty(this.filters.analyzer)) { criteria.push({ _in: { - _field: 'analyzerDefinitionId', + _field: 'workerDefinitionId', _values: _.map(this.filters.analyzer, 'analyzerDefinitionId') } });