Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
no fail for customers without sast module (#105)
Browse files Browse the repository at this point in the history
* sast no fail for customers without sast module

* sast no fail for customers without sast module
  • Loading branch information
anatolii-paloaltonetworks authored Feb 7, 2024
1 parent adbe819 commit b5db145
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,21 @@ abstract class CheckovScanCommandsService(val project: Project) {
val cmdByFramework = arrayListOf<String>()
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<String> {
val command = ArrayList<String>()
if (framework === "sast") {
command.add("--no-fail-on-crash")
}

return command
}

private fun getCheckovCliArgsForExecCommand(outputFilePath: String): ArrayList<String> {
val apiToken = settings?.getApiKey()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ class CheckovScanService: Disposable {

}

if (scanTaskResult.errorReason.contains("ModuleNotEnabledError")) {
return true // skip module not enabled error
}

if (errorCode != 0 || scanTaskResult.errorReason.isNotEmpty()) {
project.service<CheckovErrorHandlerService>().scanningError(scanTaskResult, scanningSource, Exception("Error while scanning $scanningSource, exit code - $errorCode, error reason - ${scanTaskResult.errorReason}"), scanSourceType)
return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class FullScanStateService(val project: Project) {
return ""
}

return "${invalidFilesSize}} files were detected as invalid.\n"
return "${invalidFilesSize} files were detected as invalid.\n"
}

fun wereAllFrameworksFinished(): Boolean {
Expand Down

0 comments on commit b5db145

Please sign in to comment.