From 756af71d1d6fe267b5e7da7e822ef6789757b2e8 Mon Sep 17 00:00:00 2001 From: Anatolii Stadnichuk Date: Wed, 7 Feb 2024 09:44:39 +0000 Subject: [PATCH] sast no fail for customers without sast module --- gradle.properties | 2 +- .../CheckovScanCommandsService.kt | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index ed7c4fb..44ceadd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ pluginGroup = com.github.bridgecrewio.prismajetbrainsidea pluginName = prismacloud-jetbrains-idea -pluginVersion = 1.0.11 +pluginVersion = 1.0.13 pluginSinceBuild = 203 # Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl # See https://jb.gg/intellij-platform-builds-list for available build versions diff --git a/src/main/kotlin/com/bridgecrew/services/checkovScanCommandsService/CheckovScanCommandsService.kt b/src/main/kotlin/com/bridgecrew/services/checkovScanCommandsService/CheckovScanCommandsService.kt index d342d7a..63598b7 100644 --- a/src/main/kotlin/com/bridgecrew/services/checkovScanCommandsService/CheckovScanCommandsService.kt +++ b/src/main/kotlin/com/bridgecrew/services/checkovScanCommandsService/CheckovScanCommandsService.kt @@ -34,11 +34,21 @@ abstract class CheckovScanCommandsService(val project: Project) { val cmdByFramework = arrayListOf() cmdByFramework.addAll(baseCmds) cmdByFramework.addAll(getCheckovCliArgsForExecCommand(getOutputFilePath(outputFilePath))) + cmdByFramework.addAll(getCheckovNoFailOnCrash(framework)) + cmdByFramework.add("--framework") cmdByFramework.add(framework) return cmdByFramework } + private fun getCheckovNoFailOnCrash(framework: String): ArrayList { + val command = ArrayList() + if (framework === "sast") { + command.add("--no-fail-on-crash") + } + + return command + } private fun getCheckovCliArgsForExecCommand(outputFilePath: String): ArrayList { val apiToken = settings?.getApiKey()