use of com.checkmarx.sdk.dto.ast.ScanParams in project cx-flow by checkmarx-ltd.
the class AbstractASTScanner method toSdkScanParams.
private ScanParams toSdkScanParams(ScanRequest scanRequest, String pathToScan) {
ScanParams scanParams = ScanParams.builder().projectName(scanRequest.getProject()).sourceDir(pathToScan).scaConfig(scanRequest.getScaConfig()).filterConfiguration(scanRequest.getFilter()).disableCertificateValidation(scanRequest.isDisableCertificateValidation()).build();
setScannerSpecificProperties(scanRequest, scanParams);
return scanParams;
}
use of com.checkmarx.sdk.dto.ast.ScanParams in project cx-flow by checkmarx-ltd.
the class SCAScanner method cxParseResults.
@Override
protected void cxParseResults(ScanRequest scanRequest, File file) throws ExitThrowable {
RestClientConfig restClientConfig;
IScanClientHelper iScanClientHelper;
try {
ScanParams sdkScanParams = ScanParams.builder().projectName(scanRequest.getProject()).scaConfig(scanRequest.getScaConfig()).filterConfiguration(scanRequest.getFilter()).build();
restClientConfig = scaScannerClient.getScanConfig(sdkScanParams);
iScanClientHelper = new ScaClientHelper(restClientConfig, log, scaProperties);
ScanResults results = iScanClientHelper.getReportContent(file, scanRequest.getFilter());
resultsService.processResults(scanRequest, results, scanDetails);
if (flowProperties.isBreakBuild() && results != null && results.getXIssues() != null && !results.getXIssues().isEmpty()) {
log.error(ERROR_BREAK_MSG);
exit(ExitCode.BUILD_INTERRUPTED);
}
} catch (MachinaException | CheckmarxException e) {
log.error("Error occurred while processing results file", e);
exit(3);
}
}
use of com.checkmarx.sdk.dto.ast.ScanParams in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.
the class ScaTest method getLatestResults.
private AstScaResults getLatestResults(RestClientConfig config) {
ScaScanner client = getScanner();
Assert.assertNotNull(client);
ScanParams params = getScanParams(config);
return client.getLatestScanResults(params);
}
use of com.checkmarx.sdk.dto.ast.ScanParams in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.
the class ScaTest method getScanParams.
private ScanParams getScanParams(RestClientConfig config) {
com.checkmarx.sdk.config.ScaConfig scaConfig = new com.checkmarx.sdk.config.ScaConfig();
scaConfig.setAccessControlUrl(scaProperties.getAccessControlUrl());
scaConfig.setApiUrl(scaProperties.getApiUrl());
scaConfig.setAppUrl(scaProperties.getAppUrl());
scaConfig.setTenant(scaProperties.getTenant());
scaConfig.setThresholdsScore(scaProperties.getThresholdsScore());
scaConfig.setThresholdsSeverity(new HashMap<>());
scaConfig.setThresholdsSeverityDirectly(new HashMap<>());
ScanParams scanParams = ScanParams.builder().projectName(config.getProjectName()).remoteRepoUrl(getRepoUrl()).scaConfig(scaConfig).build();
return scanParams;
}
use of com.checkmarx.sdk.dto.ast.ScanParams in project cx-flow by checkmarx-ltd.
the class AbstractASTScanner method toSdkScanParams.
private ScanParams toSdkScanParams(ScanRequest scanRequest) {
URL parsedUrl = getRepoUrl(scanRequest);
ScanParams scanParams = ScanParams.builder().branch(scanRequest.getBranch()).projectName(scanRequest.getProject()).remoteRepoUrl(parsedUrl).scaConfig(scanRequest.getScaConfig()).filterConfiguration(scanRequest.getFilter()).build();
setScannerSpecificProperties(scanRequest, scanParams);
return scanParams;
}
Aggregations