-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from joernio/andrei/thorat-downloader
[datasets] added THORAT for PYSRC and SEMGREP
- Loading branch information
Showing
3 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ jobs: | |
mv workspace/securibench-micro-JAVASRC.zip securibench-micro-JAVASRC.zip | ||
mv workspace/OWASP-BenchmarkJava-JAVA.zip OWASP-BenchmarkJava-JAVA.zip | ||
mv workspace/OWASP-BenchmarkJava-JAVASRC.zip OWASP-BenchmarkJava-JAVASRC.zip | ||
mv workspace/THORAT.zip THORAT.zip | ||
- name: Set next release version | ||
id: taggerFinal | ||
uses: anothrNick/[email protected] | ||
|
@@ -62,3 +63,4 @@ jobs: | |
securibench-micro-JAVASRC.zip | ||
OWASP-BenchmarkJava-JAVA.zip | ||
OWASP-BenchmarkJava-JAVASRC.zip | ||
THORAT.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/scala/io/joern/benchmarks/datasets/runner/ThoratDownloader.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package io.joern.benchmarks.datasets.runner | ||
|
||
import better.files.File | ||
import io.joern.benchmarks.* | ||
import org.slf4j.LoggerFactory | ||
import upickle.default.* | ||
|
||
import java.net.{URI, URL} | ||
import scala.util.{Failure, Success, Try} | ||
|
||
class ThoratDownloader(datasetDir: File) extends DatasetDownloader(datasetDir) with SingleFileDownloader { | ||
|
||
private val logger = LoggerFactory.getLogger(getClass) | ||
|
||
private val version = "0.0.7" | ||
override val benchmarkName = s"Thorat Python v$version" | ||
|
||
override protected val benchmarkUrl: URL = URI( | ||
s"https://github.com/DavidBakerEffendi/benchmark-for-taint-analysis-tools-for-python/archive/refs/tags/v$version.zip" | ||
).toURL | ||
override protected val benchmarkFileName: String = s"benchmark-for-taint-analysis-tools-for-python-$version" | ||
override protected val benchmarkBaseDir: File = datasetDir / benchmarkFileName | ||
|
||
override def initialize(): Try[File] = Try { | ||
val outputFile = File(s"${datasetDir.pathAsString}/THORAT.zip") | ||
|
||
if !outputFile.exists then | ||
downloadBenchmarkAndUnarchive(CompressionTypes.ZIP) | ||
compressBenchmark(benchmarkBaseDir, Option(File(s"${datasetDir.pathAsString}/THORAT.zip"))) | ||
else outputFile | ||
} | ||
|
||
override def run(): Unit = Try { | ||
initialize() match { | ||
case Failure(exception) => | ||
logger.error(s"Unable to initialize benchmark '$getClass'", exception) | ||
case Success(benchmarkDir) => | ||
} | ||
} | ||
} |