Skip to content

Commit 4f28902

Browse files
committed
Merge branch 'hotfix/4.1.15'
2 parents 01498d1 + c04b835 commit 4f28902

File tree

80 files changed

+839
-547
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+839
-547
lines changed

.drone.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ steps:
3333
nvm install 14
3434
npm install -g bower grunt
3535
sbt -Duser.home=$PWD test:compile test Universal/packageBin
36+
when:
37+
event:
38+
exclude: [promote]
3639

3740
# Build packages
3841
- name: build-packages
@@ -61,7 +64,7 @@ steps:
6164
mv target/rpm/RPMS/noarch/thehive*.rpm target/
6265
mv target/universal/thehive*.zip target/
6366
when:
64-
event: [tag]
67+
event: [promote]
6568

6669
# Save external libraries in cache
6770
- name: save-cache
@@ -91,7 +94,7 @@ steps:
9194
- target/thehive*.zip
9295
strip_components: 1
9396
when:
94-
event: [tag]
97+
event: [promote]
9598

9699
# Publish packages
97100
- name: publish packages
@@ -104,7 +107,7 @@ steps:
104107
commands:
105108
- PLUGIN_SCRIPT="bash $PLUGIN_PUBLISH_SCRIPT thehive4 $(cat thehive-version.txt)" /bin/drone-ssh
106109
when:
107-
event: [tag]
110+
event: [promote]
108111

109112
# Publish docker image on Docker Hub
110113
- name: docker
@@ -116,7 +119,7 @@ steps:
116119
username: {from_secret: docker_username}
117120
password: {from_secret: docker_password}
118121
when:
119-
event: [tag]
122+
event: [promote]
120123

121124
# Publish docker image on Harbor
122125
# - name: harbor

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Change Log
22

3+
## [4.1.15](https://github.com/TheHive-Project/TheHive/milestone/85) (2021-12-06)
4+
5+
**Implemented enhancements:**
6+
7+
- [Feature Request] Add query to retrieve audit from an object [\#2266](https://github.com/TheHive-Project/TheHive/issues/2266)
8+
- [Feature Request] Sort similar Alerts by Observables [\#2270](https://github.com/TheHive-Project/TheHive/issues/2270)
9+
- [Enhancement] Add space after the title prefix from case template [\#2278](https://github.com/TheHive-Project/TheHive/issues/2278)
10+
11+
**Fixed bugs:**
12+
13+
- [Bug] Search without sort make queries slow [\#2261](https://github.com/TheHive-Project/TheHive/issues/2261)
14+
- [Bug] Marking an alert as read do not update it's "updatedAt" field [\#2262](https://github.com/TheHive-Project/TheHive/issues/2262)
15+
- [Bug] dataType removal doesn't work [\#2263](https://github.com/TheHive-Project/TheHive/issues/2263)
16+
- [Bug] Fix index creation and rebuild [\#2265](https://github.com/TheHive-Project/TheHive/issues/2265)
17+
318
## [4.1.14](https://github.com/TheHive-Project/TheHive/milestone/84) (2021-11-19)
419

520
**Implemented enhancements:**

build.sbt

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Dependencies._
22
import com.typesafe.sbt.packager.Keys.bashScriptDefines
33
import org.thp.ghcl.Milestone
44

5-
val thehiveVersion = "4.1.14-1"
5+
val thehiveVersion = "4.1.15-1"
66
val scala212 = "2.12.13"
77
val scala213 = "2.13.1"
88
val supportedScalaVersions = List(scala212, scala213)
@@ -351,28 +351,3 @@ lazy val thehiveMigration = (project in file("migration"))
351351
),
352352
normalizedName := "migrate"
353353
)
354-
355-
lazy val rpmPackageRelease = (project in file("package/rpm-release"))
356-
.enablePlugins(RpmPlugin)
357-
.settings(
358-
name := "thehive-project-release",
359-
maintainer := "TheHive Project <[email protected]>",
360-
version := "1.2.0",
361-
rpmRelease := "1",
362-
rpmVendor := "TheHive Project",
363-
rpmUrl := Some("http://thehive-project.org/"),
364-
rpmLicense := Some("AGPL"),
365-
maintainerScripts in Rpm := Map.empty,
366-
linuxPackageSymlinks in Rpm := Nil,
367-
packageSummary := "TheHive-Project RPM repository",
368-
packageDescription :=
369-
"""This package contains the TheHive-Project packages repository
370-
|GPG key as well as configuration for yum.""".stripMargin,
371-
linuxPackageMappings in Rpm := Seq(
372-
packageMapping(
373-
file("PGP-PUBLIC-KEY") -> "etc/pki/rpm-gpg/GPG-TheHive-Project",
374-
file("package/rpm-release/thehive-rpm.repo") -> "/etc/yum.repos.d/thehive-rpm.repo",
375-
file("LICENSE") -> "/usr/share/doc/thehive-project-release/LICENSE"
376-
)
377-
)
378-
)

cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/ActionCtrl.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ class PublicAction @Inject() (actionSrv: ActionSrv, organisationSrv: Organisatio
8585
"getAction",
8686
(idOrName, graph, authContext) => actionSrv.get(idOrName)(graph).visible(organisationSrv)(authContext)
8787
)
88-
override val pageQuery: ParamQuery[OutputParam] = Query.withParam[OutputParam, Traversal.V[Action], IteratorOutput](
89-
"page",
90-
(range, actionSteps, _) => actionSteps.richPage(range.from, range.to, withTotal = true)(_.richAction)
91-
)
88+
override def pageQuery(limitedCountThreshold: Long): ParamQuery[OutputParam] =
89+
Query.withParam[OutputParam, Traversal.V[Action], IteratorOutput](
90+
"page",
91+
(range, actionSteps, _) => actionSteps.richPage(range.from, range.to, withTotal = true, limitedCountThreshold)(_.richAction)
92+
)
9293
override val outputQuery: Query = Query.output[RichAction, Traversal.V[Action]](_.richAction)
9394
val actionsQuery: Query = new Query {
9495
override val name: String = "actions"

cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/AnalyzerTemplateCtrl.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ class PublicAnalyzerTemplate @Inject() (analyzerTemplateSrv: AnalyzerTemplateSrv
104104
"getReportTemplate",
105105
(idOrName, graph, _) => analyzerTemplateSrv.get(idOrName)(graph)
106106
)
107-
override val pageQuery: ParamQuery[OutputParam] =
107+
override def pageQuery(limitedCountThreshold: Long): ParamQuery[OutputParam] =
108108
Query.withParam[OutputParam, Traversal.V[AnalyzerTemplate], IteratorOutput](
109109
"page",
110-
(range, analyzerTemplateTraversal, _) => analyzerTemplateTraversal.page(range.from, range.to, withTotal = true)
110+
(range, analyzerTemplateTraversal, _) => analyzerTemplateTraversal.page(range.from, range.to, withTotal = true, limitedCountThreshold)
111111
)
112112
override val outputQuery: Query = Query.output[AnalyzerTemplate with Entity]
113113
override val publicProperties: PublicProperties = PublicPropertyListBuilder[AnalyzerTemplate]

cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/CortexQueryExecutor.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class CortexQueryExecutor @Inject() (
3737
override lazy val queries: Seq[ParamQuery[_]] =
3838
controllers.map(_.initialQuery) :::
3939
controllers.map(_.getQuery) :::
40-
controllers.map(_.pageQuery) :::
40+
controllers.map(_.pageQuery(limitedCountThreshold)) ::: // FIXME the value of limitedCountThreshold is read only once. The value is not updated.
4141
controllers.map(_.outputQuery) :::
4242
controllers.flatMap(_.extraQueries)
4343

cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/controllers/v0/JobCtrl.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,16 @@ class PublicJob @Inject() (jobSrv: JobSrv) extends PublicData with JobRenderer {
8383
"getJob",
8484
(idOrName, graph, authContext) => jobSrv.get(idOrName)(graph).visible(authContext)
8585
)
86-
override val pageQuery: ParamQuery[OutputParam] =
86+
override def pageQuery(limitedCountThreshold: Long): ParamQuery[OutputParam] =
8787
Query.withParam[OutputParam, Traversal.V[Job], IteratorOutput](
8888
"page",
8989
{
9090
case (OutputParam(from, to, _, withParents), jobSteps, authContext) if withParents > 0 =>
91-
jobSteps.richPage(from, to, withTotal = true)(_.richJobWithCustomRenderer(jobParents(_)(authContext))(authContext))
91+
jobSteps.richPage(from, to, withTotal = true, limitedCountThreshold)(_.richJobWithCustomRenderer(jobParents(_)(authContext))(authContext))
9292
case (range, jobSteps, authContext) =>
93-
jobSteps.richPage(range.from, range.to, withTotal = true)(_.richJob(authContext).domainMap((_, None: Option[(RichObservable, RichCase)])))
93+
jobSteps.richPage(range.from, range.to, withTotal = true, limitedCountThreshold)(
94+
_.richJob(authContext).domainMap((_, None: Option[(RichObservable, RichCase)]))
95+
)
9496
}
9597
)
9698
override val outputQuery: Query = Query.outputWithContext[RichJob, Traversal.V[Job]]((jobSteps, authContext) => jobSteps.richJob(authContext))

cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/models/CortexSchemaDefinition.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CortexSchemaDefinition @Inject() () extends Schema with UpdatableSchema {
3535
.map(modelClass => rm.reflectModule(rm.classSymbol(modelClass).companion.companion.asModule).instance)
3636
.collect {
3737
case hasModel: HasModel =>
38-
logger.info(s"Loading model ${hasModel.model.label}")
38+
logger.debug(s"Loading model ${hasModel.model.label}")
3939
hasModel.model
4040
}
4141
.toSeq

cortex/connector/src/main/scala/org/thp/thehive/connector/cortex/services/ActionOperationSrv.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ class ActionOperationSrv @Inject() (
7272
case CloseTask() =>
7373
for {
7474
t <- relatedTask.fold[Try[Task with Entity]](Failure(InternalError("Unable to apply action CloseTask without task")))(Success(_))
75-
_ <- taskSrv.get(t).update(_.status, TaskStatus.Completed).getOrFail("Task")
75+
_ <-
76+
taskSrv
77+
.get(t)
78+
.update(_.status, TaskStatus.Completed)
79+
.update(_._updatedAt, Some(new Date))
80+
.update(_._updatedBy, Some(authContext.userId))
81+
.getOrFail("Task")
7682
} yield updateOperation(operation)
7783

7884
case MarkAlertAsRead() =>

0 commit comments

Comments
 (0)