Search in sources :

Example 31 with BugTracker

use of com.checkmarx.flow.dto.BugTracker in project cx-flow by checkmarx-ltd.

the class AstRemoteRepoScanSteps method startScan.

public void startScan(List<VulnerabilityScanner> scanners, String branch, String repo, boolean isPublicRepo, String projectName) {
    CxProperties cxProperties = new CxProperties();
    ExternalScriptService scriptService = new ExternalScriptService();
    CxScannerService cxScannerService = new CxScannerService(cxProperties, null, null, null, null);
    HelperService helperService = new HelperService(flowProperties, cxScannerService, jiraProperties, scriptService);
    ProjectNameGenerator projectNameGenerator = new ProjectNameGenerator(helperService, cxScannerService, flowProperties);
    FlowService flowService = new FlowService(new ArrayList<>(), projectNameGenerator, resultsServiceMock);
    ScanRequest scanRequest = getBasicScanRequest(branch, repo, isPublicRepo, projectName);
    scanRequest = configOverrider.overrideScanRequestProperties(new CxConfig(), scanRequest);
    scanRequest.setVulnerabilityScanners(scanners);
    BugTracker bt = BugTracker.builder().type(BugTracker.Type.JIRA).customBean("JIRA").build();
    scanRequest.setBugTracker(bt);
    flowService.initiateAutomation(scanRequest);
}
Also used : ScanRequest(com.checkmarx.flow.dto.ScanRequest) CxProperties(com.checkmarx.sdk.config.CxProperties) CxConfig(com.checkmarx.sdk.dto.sast.CxConfig) BugTracker(com.checkmarx.flow.dto.BugTracker)

Example 32 with BugTracker

use of com.checkmarx.flow.dto.BugTracker in project cx-flow by checkmarx-ltd.

the class AnalyticsSteps method createScanRequest.

private static ScanRequest createScanRequest(String repoUrl) {
    ScanRequest scanRequest = new ScanRequest();
    BugTracker issueTracker = BugTracker.builder().type(BugTracker.Type.GITHUBPULL).build();
    scanRequest.setBugTracker(issueTracker);
    scanRequest.setMergeNoteUri(MERGE_NOTE_URL);
    scanRequest.setProduct(ScanRequest.Product.CX);
    scanRequest.setRepoUrl(repoUrl);
    HashMap<String, String> metadata = new HashMap<>();
    metadata.put("statuses_url", PULL_REQUEST_STATUSES_URL);
    scanRequest.setAdditionalMetadata(metadata);
    return scanRequest;
}
Also used : ScanRequest(com.checkmarx.flow.dto.ScanRequest) BugTracker(com.checkmarx.flow.dto.BugTracker)

Aggregations

BugTracker (com.checkmarx.flow.dto.BugTracker)32 ScanRequest (com.checkmarx.flow.dto.ScanRequest)23 FilterConfiguration (com.checkmarx.sdk.dto.filtering.FilterConfiguration)13 CxConfig (com.checkmarx.sdk.dto.sast.CxConfig)6 MachinaRuntimeException (com.checkmarx.flow.exception.MachinaRuntimeException)5 ScanResults (com.checkmarx.sdk.dto.ScanResults)5 JiraClientException (com.checkmarx.flow.exception.JiraClientException)4 IssueInputBuilder (com.atlassian.jira.rest.client.api.domain.input.IssueInputBuilder)3 ComplexIssueInputFieldValue (com.atlassian.jira.rest.client.api.domain.input.ComplexIssueInputFieldValue)2 FieldInput (com.atlassian.jira.rest.client.api.domain.input.FieldInput)2 ControllerRequest (com.checkmarx.flow.dto.ControllerRequest)2 FlowOverride (com.checkmarx.flow.dto.FlowOverride)2 Repository (com.checkmarx.flow.dto.bitbucket.Repository)2 InvalidTokenException (com.checkmarx.flow.exception.InvalidTokenException)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 IOException (java.io.IOException)2 HttpClientErrorException (org.springframework.web.client.HttpClientErrorException)2 com.atlassian.jira.rest.client.api (com.atlassian.jira.rest.client.api)1 com.atlassian.jira.rest.client.api.domain (com.atlassian.jira.rest.client.api.domain)1 TransitionInput (com.atlassian.jira.rest.client.api.domain.input.TransitionInput)1