Skip to content

Commit

Permalink
October integration (#129)
Browse files Browse the repository at this point in the history
* fixed sca vulnerability

* added feature for parallel scan

* support to perform parallel scan

* CxclientCommonLatestVersion

* version change

---------

Co-authored-by: Swati Awate <[email protected]>
Co-authored-by: swatipersistent <[email protected]>
  • Loading branch information
3 people authored Nov 9, 2023
1 parent 0dfe31a commit e50e6c4
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 9 deletions.
47 changes: 42 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.cx.plugin</groupId>
<artifactId>CxConsolePlugin</artifactId>
<version>1.1.26</version>
<version>1.1.27</version>
<packaging>jar</packaging>

<repositories>
Expand Down Expand Up @@ -134,7 +134,7 @@
<dependency>
<groupId>com.checkmarx</groupId>
<artifactId>cx-client-common</artifactId>
<version>2023.2.5</version>
<version>2023.4.1</version>
<!-- Remove these excludes once latest FSA is used -->
<exclusions>
<exclusion>
Expand Down Expand Up @@ -204,18 +204,26 @@
<groupId>org.tmatesoft.sqljet</groupId>
<artifactId>sqljet</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
</exclusion>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- excluded dependencies from cx-client-common -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230227</version>
<version>20231013</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.1-jre</version>
<version>32.0.0-android</version>
</dependency>


Expand All @@ -238,7 +246,7 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
<version>4.1.77.Final</version>
<version>4.1.100.Final</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down Expand Up @@ -305,6 +313,26 @@
<artifactId>sqljet</artifactId>
<version>1.1.15</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.8.0</version>
<exclusions>
<exclusion>
<artifactId>commons-compress</artifactId>
<groupId>org.apache.commons</groupId>
</exclusion>
<exclusion>
<artifactId>plexus-utils</artifactId>
<groupId>org.codehaus.plexus</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.70</version>
</dependency>
<!-- end of excluded dependencies -->
<dependency>
<groupId>commons-cli</groupId>
Expand Down Expand Up @@ -353,6 +381,10 @@
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down Expand Up @@ -382,6 +414,11 @@
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.17.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>6.6.1.202309021850-r</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/com/cx/plugin/cli/configascode/SastConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class SastConfig {
private int medium;
@Optional
private int high;
@Optional
private boolean avoidDuplicateProjectScans;
@Optional
private boolean isOverrideProjectSetting;
@Optional
Expand Down Expand Up @@ -102,11 +104,19 @@ public boolean isPrivateScan() {
public void setPrivateScan(boolean privateScan) {
this.privateScan = privateScan;
}

public boolean isAvoidDuplicateProjectScans() {
return avoidDuplicateProjectScans;
}

public void setAvoidDuplicateProjectScans(boolean avoidDuplicateProjectScans) {
this.avoidDuplicateProjectScans = avoidDuplicateProjectScans;
}

public boolean isOverrideProjectSetting() {
return isOverrideProjectSetting;
}

public void setOverrideProjectSetting(boolean isOverrideProjectSetting) {
this.isOverrideProjectSetting = isOverrideProjectSetting;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,5 @@ private ArgDescriptions() {

static final String PERIODIC_FULL_SCAN = "Run a full scan after X incremental scans . Scans all files, (-Incremental should be enable). Optional.";

static final String AVOID_DUPLICATE_PROJECT_SCANS = "Avoid duplicate project scans in queue";
}
3 changes: 2 additions & 1 deletion src/main/java/com/cx/plugin/cli/constants/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ public static Options getOptions() {
options.addOption(POST_SCAN_ACTION, true, ArgDescriptions.POST_SCAN_ACTION);

options.addOption(PERIODIC_FULL_SCAN, true, ArgDescriptions.PERIODIC_FULL_SCAN);

options.addOption(AVOID_DUPLICATE_PROJECT_SCANS, false, ArgDescriptions.AVOID_DUPLICATE_PROJECT_SCANS);

return options;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/cx/plugin/cli/constants/Parameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,5 @@ private Parameters() {
public static final String POST_SCAN_ACTION = "postscanaction";

public static final String PERIODIC_FULL_SCAN = "periodicfullscan";

public static final String AVOID_DUPLICATE_PROJECT_SCANS = "avoidduplicateprojectscans";
}
7 changes: 6 additions & 1 deletion src/main/java/com/cx/plugin/cli/utils/CxConfigHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public CxScanConfig resolveConfiguration(Command command, CommandLine cmd) throw
scanConfig.setIncremental(isIncremental);
}
}
scanConfig.setAvoidDuplicateProjectScans(cmd.hasOption(AVOID_DUPLICATE_PROJECT_SCANS));
setSASTThresholds(scanConfig);

String dsLocationPath = getSharedDependencyScanOption(scanConfig, OSA_LOCATION_PATH, SCA_LOCATION_PATH);
Expand Down Expand Up @@ -512,6 +512,11 @@ private void mapSastConfiguration(Optional<SastConfig> sast, CxScanConfig scanCo
overridesResults.put("Master Branch Project Name", String.valueOf(pValue));
});

sast.map(SastConfig::isAvoidDuplicateProjectScans)
.ifPresent(pValue -> {
scanConfig.setAvoidDuplicateProjectScans(pValue);
overridesResults.put("Avoid Duplicate Project Scans", String.valueOf(pValue));
});
}

private void mapProjectConfiguration(Optional<ProjectConfig> project, CxScanConfig scanConfig, Map<String, String> overridesResults) throws CLIParsingException {
Expand Down

0 comments on commit e50e6c4

Please sign in to comment.