use of com.checkmarx.flow.dto.iast.manager.dto.Scan in project cx-flow by checkmarx-ltd.
the class IastService method stopScanAndCreateIssue.
public void stopScanAndCreateIssue(ScanRequest request, String scanTag) throws IOException, JiraClientException {
log.debug("start stopScanAndCreateIssueFromIastSummary with scanTag:" + scanTag);
validateScanTag(scanTag);
checkRequiredParameters();
if (request == null) {
log.error("ScanRequest is null. Something went wrong.");
throw new IastScanRequestMustProvideException("ScanRequest is null. Something went wrong. Please contact with IAST support.");
}
if (request.getBugTracker() == null) {
log.error("BugTracker is not provide. Please provide a bug tracker");
}
Scan scan = finishScan(scanTag);
createIssue(request, scan);
}
use of com.checkmarx.flow.dto.iast.manager.dto.Scan in project cx-flow by checkmarx-ltd.
the class IastService method createIssue.
private void createIssue(ScanRequest request, Scan scan) throws IOException {
try {
final ScanVulnerabilities scanVulnerabilities = iastServiceRequests.apiScanVulnerabilities(scan.getScanId());
List<VulnerabilityInfo> vulnerabilities = scanVulnerabilities.getVulnerabilities();
for (VulnerabilityInfo vulnerability : vulnerabilities) {
if (vulnerability.getNewCount() != 0) {
final List<ResultInfo> scansResultsQuery = iastServiceRequests.apiScanResults(scan.getScanId(), vulnerability.getId());
final List<ResultInfo> scansResultQueryList = scansResultsQuery.stream().filter(scansResultQuery -> scansResultQuery.isNewResult() && filterSeverity(scansResultQuery)).collect(Collectors.toList());
for (ResultInfo scansResultQuery : scansResultQueryList) {
createIssue(scanVulnerabilities, request, scansResultQuery, vulnerability, scan);
}
}
}
thresholdsSeverity(scanVulnerabilities);
} catch (NotImplementedException e) {
throw new NotImplementedException(request.getBugTracker().getType().getType() + ". That bug tracker not implemented.");
} catch (IOException e) {
throw new IOException("Can't send api request", e);
}
}
Aggregations