Search in sources :

Example 1 with ScaConfig

use of com.checkmarx.sdk.dto.sca.ScaConfig in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.

the class ScaTest method getScaConfig.

protected ScaConfig getScaConfig(boolean useOnPremiseAuthentication) {
    String accessControlProp, usernameProp, passwordProp;
    if (useOnPremiseAuthentication) {
        // passwordProp = onPremisePass;
        throw new UnsupportedOperationException();
    } else {
        accessControlProp = scaProperties.getAccessControlUrl();
        usernameProp = scaProperties.getUsername();
        passwordProp = scaProperties.getPassword();
    }
    ScaConfig result = new ScaConfig();
    result.setApiUrl(scaProperties.getApiUrl());
    result.setWebAppUrl(scaProperties.getAppUrl());
    result.setTenant(scaProperties.getTenant());
    result.setAccessControlUrl(accessControlProp);
    result.setUsername(usernameProp);
    result.setPassword(passwordProp);
    result.setIncludeSources(false);
    return result;
}
Also used : ScaConfig(com.checkmarx.sdk.dto.sca.ScaConfig)

Example 2 with ScaConfig

use of com.checkmarx.sdk.dto.sca.ScaConfig 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;
}
Also used : ScaConfig(com.checkmarx.sdk.dto.sca.ScaConfig) ScanParams(com.checkmarx.sdk.dto.ast.ScanParams) com.checkmarx.sdk.config(com.checkmarx.sdk.config)

Example 3 with ScaConfig

use of com.checkmarx.sdk.dto.sca.ScaConfig in project cx-flow by checkmarx-ltd.

the class ScaCommonSteps method createRestClientConfig.

protected RestClientConfig createRestClientConfig(ScaProperties scaProperties, String projectName) {
    ScaConfig scaConfig = new ScaConfig();
    scaConfig.setTenant(scaProperties.getTenant());
    scaConfig.setApiUrl(scaProperties.getApiUrl());
    scaConfig.setUsername(scaProperties.getUsername());
    scaConfig.setPassword(scaProperties.getPassword());
    scaConfig.setAccessControlUrl(scaProperties.getAccessControlUrl());
    scaConfig.setRemoteRepositoryInfo(new RemoteRepositoryInfo());
    RestClientConfig restClientConfig = new RestClientConfig();
    restClientConfig.setScaConfig(scaConfig);
    restClientConfig.setProjectName(projectName);
    return restClientConfig;
}
Also used : RemoteRepositoryInfo(com.checkmarx.sdk.dto.RemoteRepositoryInfo) ScaConfig(com.checkmarx.sdk.dto.sca.ScaConfig) RestClientConfig(com.checkmarx.sdk.config.RestClientConfig)

Example 4 with ScaConfig

use of com.checkmarx.sdk.dto.sca.ScaConfig in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.

the class ScaTest method initScaConfig.

protected RestClientConfig initScaConfig(boolean useOnPremAuthentication) {
    RestClientConfig config = new RestClientConfig();
    config.setProjectName("sdkScaProject");
    config.setProgressInterval(5);
    ScaConfig sca = getScaConfig(useOnPremAuthentication);
    config.setScaConfig(sca);
    return config;
}
Also used : ScaConfig(com.checkmarx.sdk.dto.sca.ScaConfig) RestClientConfig(com.checkmarx.sdk.config.RestClientConfig)

Example 5 with ScaConfig

use of com.checkmarx.sdk.dto.sca.ScaConfig in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.

the class ScaScanner method getScaSpecificConfig.

private ScaConfig getScaSpecificConfig(ScanParams scanParams) {
    ScaConfig scaConfig = new ScaConfig();
    com.checkmarx.sdk.config.ScaConfig sdkScaConfig = scanParams.getScaConfig();
    if (sdkScaConfig != null) {
        scaConfig.setWebAppUrl(sdkScaConfig.getAppUrl());
        scaConfig.setApiUrl(sdkScaConfig.getApiUrl());
        scaConfig.setAccessControlUrl(sdkScaConfig.getAccessControlUrl());
        scaConfig.setTenant(sdkScaConfig.getTenant());
        scaConfig.setIncludeSources(sdkScaConfig.isIncludeSources());
        scaConfig.setExcludeFiles(sdkScaConfig.getExcludeFiles());
        scaConfig.setUsername(scaProperties.getUsername());
        scaConfig.setPassword(scaProperties.getPassword());
        scaConfig.setFingerprintsIncludePattern(scaProperties.getFingerprintsIncludePattern());
        scaConfig.setManifestsIncludePattern(scaProperties.getManifestsIncludePattern());
        scaConfig.setTeam(sdkScaConfig.getTeam());
        scaConfig.setScanTimeout(sdkScaConfig.getScanTimeout());
        String zipPath = scanParams.getZipPath();
        if (StringUtils.isNotEmpty(zipPath)) {
            scaConfig.setZipFilePath(zipPath);
        }
    } else {
        log.warn("Unable to map SCA configuration to an internal object.");
    }
    return scaConfig;
}
Also used : ScaConfig(com.checkmarx.sdk.dto.sca.ScaConfig)

Aggregations

ScaConfig (com.checkmarx.sdk.dto.sca.ScaConfig)6 RestClientConfig (com.checkmarx.sdk.config.RestClientConfig)3 com.checkmarx.sdk.config (com.checkmarx.sdk.config)1 RemoteRepositoryInfo (com.checkmarx.sdk.dto.RemoteRepositoryInfo)1 ScanParams (com.checkmarx.sdk.dto.ast.ScanParams)1