diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7f88be8..2180a40 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ apache-commoms = "3.17.0" junit = "5.11.3" ktfmt = "0.21.0" versions = "0.51.0" -sphaVersion = "0.0.4" +sphaVersion = "0.0.5" semver = "0.12.11" [libraries] diff --git a/src/main/kotlin/de/fraunhofer/iem/spha/cli/transformer/Tool2RawKpiTransformer.kt b/src/main/kotlin/de/fraunhofer/iem/spha/cli/transformer/Tool2RawKpiTransformer.kt index 1ac743c..6f1f407 100644 --- a/src/main/kotlin/de/fraunhofer/iem/spha/cli/transformer/Tool2RawKpiTransformer.kt +++ b/src/main/kotlin/de/fraunhofer/iem/spha/cli/transformer/Tool2RawKpiTransformer.kt @@ -12,9 +12,11 @@ package de.fraunhofer.iem.spha.cli.transformer import de.fraunhofer.iem.spha.adapter.AdapterResult import de.fraunhofer.iem.spha.adapter.tools.osv.OsvAdapter import de.fraunhofer.iem.spha.adapter.tools.trivy.TrivyAdapter +import de.fraunhofer.iem.spha.adapter.tools.trufflehog.TrufflehogAdapter import de.fraunhofer.iem.spha.cli.StrictModeConstraintFailed import de.fraunhofer.iem.spha.model.adapter.osv.OsvScannerDto import de.fraunhofer.iem.spha.model.adapter.trivy.TrivyDto +import de.fraunhofer.iem.spha.model.adapter.trufflehog.TrufflehogReportDto import de.fraunhofer.iem.spha.model.kpi.RawValueKpi import io.github.oshai.kotlinlogging.KotlinLogging import java.io.InputStream @@ -58,6 +60,14 @@ internal class Tool2RawKpiTransformer : RawKpiTransformer, KoinComponent { return@use OsvAdapter.transformDataToKpi(adapterInput) } } + "trufflehog" -> { + getSingleInputStreamFromInputFile(options.inputFiles, strictMode).use { + _logger.info { "Selected supported tool: Trufflehog" } + val adapterInput: List = + TrufflehogAdapter.dtoFromJson(it) + return@use TrufflehogAdapter.transformDataToKpi(adapterInput) + } + } else -> throw ToolNotFoundException("Tool ${options.tool} is not yet supported.") }