Skip to content

Commit f5f8c6f

Browse files
authored
CM-42037 - Add AI remediations for IaC and SAST (#81)
1 parent a4d7848 commit f5f8c6f

File tree

38 files changed

+383
-368
lines changed

38 files changed

+383
-368
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
## [Unreleased]
66

7+
## [2.2.0] - 2024-12-11
8+
9+
- Add AI remediations for IaC and SAST
10+
- Fix "Path to executable" field applying in the settings
11+
712
## [2.1.0] - 2024-10-07
813

914
- Add sync flow for Secrets and IaC
@@ -125,6 +130,8 @@
125130

126131
The first public release of the plugin.
127132

133+
[2.2.0]: https://github.com/cycodehq/intellij-platform-plugin/releases/tag/v2.2.0
134+
128135
[2.1.0]: https://github.com/cycodehq/intellij-platform-plugin/releases/tag/v2.1.0
129136

130137
[2.0.1]: https://github.com/cycodehq/intellij-platform-plugin/releases/tag/v2.0.1
@@ -175,4 +182,4 @@ The first public release of the plugin.
175182

176183
[1.0.0]: https://github.com/cycodehq/intellij-platform-plugin/releases/tag/v1.0.0
177184

178-
[Unreleased]: https://github.com/cycodehq/intellij-platform-plugin/compare/v2.1.0...HEAD
185+
[Unreleased]: https://github.com/cycodehq/intellij-platform-plugin/compare/v2.2.0...HEAD

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pluginGroup = com.cycode.plugin
44
pluginName = Cycode
55
pluginRepositoryUrl = https://github.com/cycodehq/intellij-platform-plugin
66
# SemVer format -> https://semver.org
7-
pluginVersion = 2.1.0
7+
pluginVersion = 2.2.0
88

99
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1010
pluginSinceBuild = 231

src/main/kotlin/com/cycode/plugin/Consts.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Consts {
2727
companion object {
2828
val PLUGIN_PATH = PathManager.getPluginsPath() + "/cycode-intellij-platform-plugin"
2929
val DEFAULT_CLI_PATH = getDefaultCliPath()
30-
const val REQUIRED_CLI_VERSION = "1.11.0"
30+
const val REQUIRED_CLI_VERSION = "2.1.0"
3131

3232
const val CYCODE_DOMAIN = "cycode.com"
3333

src/main/kotlin/com/cycode/plugin/cli/CliWrapper.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class CliOSProcessHandler(commandLine: GeneralCommandLine) : OSProcessHandler(co
2727
}
2828

2929

30-
class CliWrapper(val executablePath: String, val workDirectory: String? = null) {
30+
class CliWrapper(val workDirectory: String? = null) {
3131
val pluginSettings = pluginSettings()
3232

3333
var mapper: ObjectMapper = jacksonObjectMapper()
@@ -42,7 +42,7 @@ class CliWrapper(val executablePath: String, val workDirectory: String? = null)
4242
): CliResult<T> {
4343
val commandLine = GeneralCommandLine()
4444
commandLine.charset = Charset.forName("UTF-8")
45-
commandLine.exePath = executablePath
45+
commandLine.exePath = pluginSettings.cliPath
4646

4747
if (workDirectory != null) {
4848
commandLine.workDirectory = File(workDirectory)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.cycode.plugin.cli.models
2+
3+
data class AiRemediationResult(
4+
val result: Boolean,
5+
val message: String,
6+
val data: AiRemediationResultData? = null,
7+
)
8+
9+
data class AiRemediationResultData(
10+
val remediation: String,
11+
val isFixAvailable: Boolean,
12+
)

src/main/kotlin/com/cycode/plugin/cli/models/AuthCheckResult.kt

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.cycode.plugin.cli.models
2+
3+
data class SupportedModulesStatus(
4+
// TODO(MarshalX): respect enabled/disabled scanning modules
5+
val secretScanning: Boolean,
6+
val scaScanning: Boolean,
7+
val iacScanning: Boolean,
8+
val sastScanning: Boolean,
9+
val aiLargeLanguageModel: Boolean,
10+
)
11+
12+
data class StatusResult(
13+
val program: String,
14+
val version: String,
15+
val isAuthenticated: Boolean,
16+
val userId: String?,
17+
val tenantId: String?,
18+
val supportedModules: SupportedModulesStatus,
19+
)

src/main/kotlin/com/cycode/plugin/cli/models/VersionResult.kt

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/main/kotlin/com/cycode/plugin/cli/models/scanResult/DetectionBase.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.cycode.plugin.cli.models.scanResult
22

33
interface DetectionBase {
4+
val id: String
45
val severity: String
56
val detectionDetails: ScanDetectionDetailsBase
67

src/main/kotlin/com/cycode/plugin/cli/models/scanResult/iac/IacDetection.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import com.cycode.plugin.CycodeBundle
44
import com.cycode.plugin.cli.models.scanResult.DetectionBase
55

66
data class IacDetection(
7-
val message: String,
8-
override val detectionDetails: IacDetectionDetails,
7+
override val id: String,
98
override val severity: String,
9+
override val detectionDetails: IacDetectionDetails,
10+
val message: String,
1011
val type: String,
1112
val detectionRuleId: String, // UUID
1213
val detectionTypeId: String, // UUID

0 commit comments

Comments
 (0)