Skip to content

Commit

Permalink
Sast private scan changes (#1292)
Browse files Browse the repository at this point in the history
Co-authored-by: PravinGadankush <[email protected]>
  • Loading branch information
itsKedar and PravinGadankush authored Nov 20, 2023
1 parent 1298ae3 commit c00fca4
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 4 deletions.
4 changes: 3 additions & 1 deletion build-11.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ buildscript {
ext {


CxSBSDK = "0.5.65"

CxSBSDK = "0.5.66"

ConfigProviderVersion = "1.0.9"
//cxVersion = "8.90.5"
springBootVersion = '2.7.14'
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
buildscript {
ext {

CxSBSDK = "0.5.65"
CxSBSDK = "0.5.66"

ConfigProviderVersion = "1.0.10"
//cxVersion = "8.90.5"
springBootVersion = '2.7.14'
Expand Down
3 changes: 2 additions & 1 deletion docs/Config-As-Code.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Example Config As Code:
"incremental": "false", // values: "true" or "false"
"forceScan": "true", // values: "true" or "false"
"fileExcludes": "*.pyc, *.test, *.class",
"folderExcludes": "*test, out/, *bin"
"folderExcludes": "*test, out/, *bin",
"publicScan" : "false"
},
"additionalProperties": {
"cxFlow": {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/checkmarx/flow/CxFlowRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.checkmarx.flow.service.*;
import com.checkmarx.flow.utils.ScanUtils;
import com.checkmarx.sdk.config.Constants;
import com.checkmarx.sdk.config.CxProperties;
import com.checkmarx.sdk.config.CxPropertiesBase;
import com.checkmarx.sdk.dto.ScanResults;
import com.checkmarx.sdk.dto.filtering.FilterConfiguration;
Expand Down Expand Up @@ -389,6 +390,7 @@ private void commandLineRunner(ApplicationArguments args) throws ExitThrowable {
.disableBreakbuild(disableBreakbuild)
.sbom(sbom)
.disablePolicyViolation(disablePolicyViolation)
.publicScan(cxProperties.getPublicScan())
.build();

if (projectId != null) {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/checkmarx/flow/dto/ScanRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ public class ScanRequest {
@Getter @Setter
private boolean sbom;

@Getter @Setter
private boolean publicScan=true;

public ScanRequest(ScanRequest other) {
this.namespace = other.namespace;
this.application = other.application;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ public CxScanParams prepareScanParamsObject(ScanRequest request, File cxFile, St
.projectId(projectId)
.withPreserveProjectName(flowProperties.isPreserveProjectName())
.withProjectName(request.getProject())
.withIsPublic(request.isPublicScan())
.withScanPreset(request.getScanPreset())
.withGitUrl(request.getRepoUrlWithAuth())
.withIncremental(request.isIncremental())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ private void overrideMainProperties(Optional<CxConfig> override, ScanRequest req
overrideReport.put("force scan", sf.toString());
});

Optional.ofNullable(s.isPublicScan()).ifPresent(sf -> {
request.setPublicScan(sf);
overrideReport.put("public scan", sf.toString());
});

Optional.ofNullable(s.getPreset()).ifPresent(sp -> {
request.setScanPreset(sp);
request.setScanPresetOverride(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.checkmarx.flow.sastscanning.ScanRequestConverter;
import com.checkmarx.flow.service.*;
import com.checkmarx.flow.utils.ScanUtils;
import com.checkmarx.sdk.ShardManager.ShardSessionTracker;
import com.checkmarx.sdk.config.CxProperties;

import com.checkmarx.sdk.dto.ScanResults;
Expand Down

0 comments on commit c00fca4

Please sign in to comment.