forked from TheHive-Project/Cortex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.sbt
55 lines (52 loc) · 2.7 KB
/
package.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Add information in manifest
import Package.ManifestAttributes
import java.util.jar.Attributes.Name._
packageOptions ++= Seq(
ManifestAttributes(IMPLEMENTATION_TITLE -> name.value),
ManifestAttributes(IMPLEMENTATION_VERSION -> version.value),
ManifestAttributes(SPECIFICATION_VENDOR -> "TheHive Project"),
ManifestAttributes(SPECIFICATION_TITLE -> name.value),
ManifestAttributes(SPECIFICATION_VERSION -> "TheHive Project")
)
// Install files //
mappings in Universal ~= {
_.flatMap {
case (_, "conf/application.conf") => Nil
case (file, "conf/apllication.sample") => Seq(file -> "conf/application.conf")
case (_, "conf/logback.xml") => Nil
case other => Seq(other)
} ++ Seq(
file("package/cortex.service") -> "package/cortex.service",
file("package/cortex.conf") -> "package/cortex.conf",
file("package/cortex") -> "package/cortex",
file("package/logback.xml") -> "conf/logback.xml"
)
}
maintainer := "TheHive Project <[email protected]>"
packageSummary := "Powerful Observable Analysis Engine"
packageDescription := """Cortex tries to solve a common problem frequently encountered by SOCs, CSIRTs and security
| researchers in the course of threat intelligence, digital forensics and incident response: how to analyze
| observables they have collected, at scale, by querying a single tool instead of several?
| Cortex, an open source and free software, has been created by TheHive Project for this very purpose. Observables,
| such as IP and email addresses, URLs, domain names, files or hashes, can be analyzed one by one or in bulk mode
| using a Web interface. Analysts can also automate these operations thanks to the Cortex REST API. """.stripMargin
defaultLinuxInstallLocation := "/opt"
linuxPackageMappings ~= {
_.map { pm =>
val mappings = pm.mappings.filterNot {
case (_, path) => path.startsWith("/opt/cortex/package") || (path.startsWith("/opt/cortex/conf") && path != "/opt/cortex/conf/reference.conf")
}
com.typesafe.sbt.packager.linux.LinuxPackageMapping(mappings, pm.fileData).withConfig()
} :+ packageMapping(
file("package/cortex.service") -> "/etc/systemd/system/cortex.service",
file("package/cortex.conf") -> "/etc/init/cortex.conf",
file("package/cortex") -> "/etc/init.d/cortex",
file("conf/application.sample") -> "/etc/cortex/application.conf",
file("package/logback.xml") -> "/etc/cortex/logback.xml"
).withConfig()
}
packageBin := {
(packageBin in Debian).value
(packageBin in Rpm).value
(packageBin in Universal).value
}