Skip to content

Commit 2d4328d

Browse files
committed
#2305 Adjust integrity check timers
1 parent 226a60b commit 2d4328d

File tree

4 files changed

+49
-69
lines changed

4 files changed

+49
-69
lines changed

project/Dependencies.scala

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,46 @@ object Dependencies {
44
val janusVersion = "0.5.3"
55
val akkaVersion: String = play.core.PlayVersion.akkaVersion
66

7-
lazy val specs = "com.typesafe.play" %% "play-specs2" % play.core.PlayVersion.current
8-
lazy val playLogback = "com.typesafe.play" %% "play-logback" % play.core.PlayVersion.current
9-
lazy val playGuice = "com.typesafe.play" %% "play-guice" % play.core.PlayVersion.current
10-
lazy val playFilters = "com.typesafe.play" %% "filters-helpers" % play.core.PlayVersion.current
11-
lazy val logbackClassic = "ch.qos.logback" % "logback-classic" % "1.2.8"
12-
lazy val playMockws = "de.leanovate.play-mockws" %% "play-mockws" % "2.8.0"
13-
lazy val akkaActor = "com.typesafe.akka" %% "akka-actor" % akkaVersion
14-
lazy val akkaCluster = "com.typesafe.akka" %% "akka-cluster" % akkaVersion
15-
lazy val akkaClusterTools = "com.typesafe.akka" %% "akka-cluster-tools" % akkaVersion
16-
lazy val akkaClusterTyped = "com.typesafe.akka" %% "akka-cluster-typed" % akkaVersion
17-
lazy val akkaHttp = "com.typesafe.akka" %% "akka-http" % play.core.PlayVersion.akkaHttpVersion
18-
lazy val akkaHttpXml = "com.typesafe.akka" %% "akka-http-xml" % play.core.PlayVersion.akkaHttpVersion
19-
lazy val janusGraph = "org.janusgraph" % "janusgraph" % janusVersion
20-
lazy val janusGraphCore = "org.janusgraph" % "janusgraph-core" % janusVersion
21-
lazy val janusGraphBerkeleyDB = "org.janusgraph" % "janusgraph-berkeleyje" % janusVersion
22-
lazy val janusGraphLucene = "org.janusgraph" % "janusgraph-lucene" % janusVersion
23-
lazy val janusGraphElasticSearch = "org.janusgraph" % "janusgraph-es" % janusVersion
24-
lazy val janusGraphCassandra = "org.janusgraph" % "janusgraph-cql" % janusVersion
25-
lazy val janusGraphInMemory = "org.janusgraph" % "janusgraph-inmemory" % janusVersion
26-
lazy val tinkerpop = "org.apache.tinkerpop" % "gremlin-core" % "3.4.6" // align with janusgraph
27-
lazy val scalactic = "org.scalactic" %% "scalactic" % "3.2.3"
28-
lazy val scalaGuice = "net.codingwell" %% "scala-guice" % "4.2.11"
29-
lazy val shapeless = "com.chuusai" %% "shapeless" % "2.3.3"
30-
lazy val bouncyCastle = "org.bouncycastle" % "bcprov-jdk15on" % "1.68"
31-
lazy val apacheConfiguration = "commons-configuration" % "commons-configuration" % "1.10"
32-
lazy val macroParadise = "org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full
33-
lazy val chimney = "io.scalaland" %% "chimney" % "0.6.1"
34-
lazy val reflections = "org.reflections" % "reflections" % "0.9.12"
35-
lazy val hadoopClient = "org.apache.hadoop" % "hadoop-client" % "3.3.0" exclude ("log4j", "log4j")
36-
lazy val zip4j = "net.lingala.zip4j" % "zip4j" % "2.6.4"
37-
lazy val alpakka = "com.lightbend.akka" %% "akka-stream-alpakka-json-streaming" % "2.0.2"
38-
lazy val handlebars = "com.github.jknack" % "handlebars" % "4.2.0"
39-
lazy val playMailer = "com.typesafe.play" %% "play-mailer" % "8.0.1"
40-
lazy val playMailerGuice = "com.typesafe.play" %% "play-mailer-guice" % "8.0.1"
41-
lazy val pbkdf2 = "io.github.nremond" %% "pbkdf2-scala" % "0.6.5"
42-
lazy val alpakkaS3 = "com.lightbend.akka" %% "akka-stream-alpakka-s3" % "2.0.2"
43-
lazy val commonCodec = "commons-codec" % "commons-codec" % "1.15"
44-
lazy val scopt = "com.github.scopt" %% "scopt" % "4.0.0"
45-
lazy val aix = "ai.x" %% "play-json-extensions" % "0.42.0"
7+
lazy val specs = "com.typesafe.play" %% "play-specs2" % play.core.PlayVersion.current
8+
lazy val playLogback = "com.typesafe.play" %% "play-logback" % play.core.PlayVersion.current
9+
lazy val playGuice = "com.typesafe.play" %% "play-guice" % play.core.PlayVersion.current
10+
lazy val playFilters = "com.typesafe.play" %% "filters-helpers" % play.core.PlayVersion.current
11+
lazy val logbackClassic = "ch.qos.logback" % "logback-classic" % "1.2.8"
12+
lazy val playMockws = "de.leanovate.play-mockws" %% "play-mockws" % "2.8.0"
13+
lazy val akkaActor = "com.typesafe.akka" %% "akka-actor" % akkaVersion
14+
lazy val akkaCluster = "com.typesafe.akka" %% "akka-cluster" % akkaVersion
15+
lazy val akkaClusterTools = "com.typesafe.akka" %% "akka-cluster-tools" % akkaVersion
16+
lazy val akkaClusterTyped = "com.typesafe.akka" %% "akka-cluster-typed" % akkaVersion
17+
lazy val akkaHttp = "com.typesafe.akka" %% "akka-http" % play.core.PlayVersion.akkaHttpVersion
18+
lazy val akkaHttpXml = "com.typesafe.akka" %% "akka-http-xml" % play.core.PlayVersion.akkaHttpVersion
19+
lazy val janusGraph = "org.janusgraph" % "janusgraph" % janusVersion
20+
lazy val janusGraphCore = "org.janusgraph" % "janusgraph-core" % janusVersion
21+
lazy val janusGraphBerkeleyDB = "org.janusgraph" % "janusgraph-berkeleyje" % janusVersion
22+
lazy val janusGraphLucene = "org.janusgraph" % "janusgraph-lucene" % janusVersion
23+
lazy val janusGraphElasticSearch = "org.janusgraph" % "janusgraph-es" % janusVersion
24+
lazy val janusGraphCassandra = "org.janusgraph" % "janusgraph-cql" % janusVersion
25+
lazy val janusGraphInMemory = "org.janusgraph" % "janusgraph-inmemory" % janusVersion
26+
lazy val tinkerpop = "org.apache.tinkerpop" % "gremlin-core" % "3.4.6" // align with janusgraph
27+
lazy val scalactic = "org.scalactic" %% "scalactic" % "3.2.3"
28+
lazy val scalaGuice = "net.codingwell" %% "scala-guice" % "4.2.11"
29+
lazy val shapeless = "com.chuusai" %% "shapeless" % "2.3.3"
30+
lazy val bouncyCastle = "org.bouncycastle" % "bcprov-jdk15on" % "1.68"
31+
lazy val apacheConfiguration = "commons-configuration" % "commons-configuration" % "1.10"
32+
lazy val macroParadise = "org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full
33+
lazy val chimney = "io.scalaland" %% "chimney" % "0.6.1"
34+
lazy val reflections = "org.reflections" % "reflections" % "0.9.12"
35+
lazy val hadoopClient = "org.apache.hadoop" % "hadoop-client" % "3.3.0" exclude ("log4j", "log4j")
36+
lazy val zip4j = "net.lingala.zip4j" % "zip4j" % "2.6.4"
37+
lazy val alpakka = "com.lightbend.akka" %% "akka-stream-alpakka-json-streaming" % "2.0.2"
38+
lazy val handlebars = "com.github.jknack" % "handlebars" % "4.2.0"
39+
lazy val playMailer = "com.typesafe.play" %% "play-mailer" % "8.0.1"
40+
lazy val playMailerGuice = "com.typesafe.play" %% "play-mailer-guice" % "8.0.1"
41+
lazy val pbkdf2 = "io.github.nremond" %% "pbkdf2-scala" % "0.6.5"
42+
lazy val alpakkaS3 = "com.lightbend.akka" %% "akka-stream-alpakka-s3" % "2.0.2"
43+
lazy val commonCodec = "commons-codec" % "commons-codec" % "1.15"
44+
lazy val scopt = "com.github.scopt" %% "scopt" % "4.0.0"
45+
lazy val aix = "ai.x" %% "play-json-extensions" % "0.42.0"
46+
lazy val bloomFilter = "com.github.alexandrnikitin" %% "bloom-filter" % "0.13.1"
4647

4748
def scalaReflect(scalaVersion: String) = "org.scala-lang" % "scala-reflect" % scalaVersion
4849
def scalaCompiler(scalaVersion: String) = "org.scala-lang" % "scala-compiler" % scalaVersion

thehive/app/org/thp/thehive/services/IntegrityCheckActor.scala

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ class IntegrityCheckActor() extends Actor {
115115
result + ("startDate" -> startDate) + ("endDate" -> endDate) + ("duration" -> (endDate - startDate))
116116
}
117117

118-
private var globalTimers: Seq[Cancellable] = Nil
119-
120118
override def preStart(): Unit = {
121119
super.preStart()
122120
implicit val authContext: AuthContext = LocalUserSrv.getSystemAuthContext
@@ -128,25 +126,6 @@ class IntegrityCheckActor() extends Actor {
128126
integrityCheckOps.foreach { integrityCheck =>
129127
self ! DuplicationCheck(integrityCheck.name)
130128
}
131-
globalTimers = integrityCheckOps.map { integrityCheck =>
132-
val interval = globalInterval(integrityCheck.name)
133-
val initialDelay = FiniteDuration((interval.toNanos * Random.nextDouble()).round, NANOSECONDS)
134-
context
135-
.system
136-
.scheduler
137-
.scheduleWithFixedDelay(initialDelay, interval) { () =>
138-
logger.debug(s"Global check of ${integrityCheck.name}")
139-
val startDate = System.currentTimeMillis()
140-
val result = integrityCheck.globalCheck().mapValues(_.toLong)
141-
val duration = System.currentTimeMillis() - startDate
142-
self ! GlobalCheckResult(integrityCheck.name, result + ("duration" -> duration))
143-
}
144-
}.toSeq
145-
}
146-
147-
override def postStop(): Unit = {
148-
super.postStop()
149-
globalTimers.foreach(_.cancel())
150129
}
151130

152131
override def receive: Receive = {

thehive/conf/reference.conf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ integrityCheck {
137137
default {
138138
initialDelay: 1 minute
139139
interval: 10 minutes
140-
globalInterval: 6 hours
140+
globalInterval: 5 days
141141
}
142142
Profile {
143143
initialDelay: 10 seconds
@@ -151,8 +151,8 @@ integrityCheck {
151151
}
152152
Tag {
153153
initialDelay: 5 minute
154-
interval: 30 minutes
155-
globalInterval: 6 hours
154+
interval: 6 hours
155+
globalInterval: 5 days
156156
}
157157
User {
158158
initialDelay: 30 seconds
@@ -187,22 +187,22 @@ integrityCheck {
187187
Data {
188188
initialDelay: 5 minute
189189
interval: 30 minutes
190-
globalInterval: 6 hours
190+
globalInterval: 5 days
191191
}
192192
Case {
193193
initialDelay: 1 minute
194194
interval: 10 minutes
195-
globalInterval: 6 hours
195+
globalInterval: 5 days
196196
}
197197
Alert {
198198
initialDelay: 5 minute
199199
interval: 30 minutes
200-
globalInterval: 6 hours
200+
globalInterval: 5 days
201201
}
202202
Task {
203203
initialDelay: 5 minute
204204
interval: 30 minutes
205-
globalInterval: 6 hours
205+
globalInterval: 5 days
206206
}
207207
Log {
208208
initialDelay: 5 minute
@@ -212,7 +212,7 @@ integrityCheck {
212212
Observable {
213213
initialDelay: 5 minute
214214
interval: 30 minutes
215-
globalInterval: 6 hours
215+
globalInterval: 5 days
216216
}
217217
}
218218

0 commit comments

Comments
 (0)