Skip to content

Commit

Permalink
TheHive-Project#317 Use CA certificates in process analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om authored and jaredjennings committed May 11, 2021
1 parent da75a6e commit 9254733
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/org/thp/cortex/services/ProcessJobRunnerSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class ProcessJobRunnerSrv @Inject() (implicit val system: ActorSystem) {
val baseDirectory = Paths.get(command).getParent.getParent
val output = StringBuilder.newBuilder
logger.info(s"Execute $command in $baseDirectory, timeout is ${timeout.fold("none")(_.toString)}")
val process = Process(Seq(command, jobDirectory.toString), baseDirectory.toFile)
val cacertsFile = jobDirectory.resolve("input").resolve("cacerts")
val env = if (Files.exists(cacertsFile)) Seq("REQUESTS_CA_BUNDLE" -> "/job/input/cacerts") else Nil
val process = Process(Seq(command, jobDirectory.toString), baseDirectory.toFile, env: _*)
.run(ProcessLogger { s =>
logger.info(s" Job ${job.id}: $s")
output ++= s
Expand Down

0 comments on commit 9254733

Please sign in to comment.