Search in sources :

Example 1 with XIssue

use of com.checkmarx.sdk.dto.ScanResults.XIssue in project cx-flow by checkmarx-ltd.

the class SarifIssueTrackerTest method getResults.

private ScanResults getResults() {
    Map<String, String> sourceMap = Maps.newHashMap();
    sourceMap.put("file", "src/main/webapp/vulnerability/DisplayMessage.jsp");
    sourceMap.put("column", "123");
    sourceMap.put("line", "3");
    Map<String, String> sinkMap = Maps.newHashMap();
    sinkMap.put("file", "src/main/webapp/vulnerability/DisplayMessage.jsp");
    Map<String, Object> addDetResMap = Maps.newHashMap();
    addDetResMap.put("sink", sinkMap);
    addDetResMap.put("source", sourceMap);
    Map<String, Object> addDetails = Maps.newHashMap();
    addDetails.put("results", addDetResMap);
    addDetails.put("recommendedFix", "https://ast.dev.checkmarx-ts.com/CxWebClient/ScanQueryDescription.aspx?");
    addDetails.put("categories", "PCI DSS v3.2;PCI DSS (3.2) - 6.5.7 - Cross-site scripting (XSS),OWASP Top 10 2013;A3-Cross-Sit");
    Map<Integer, ScanResults.IssueDetails> issueDetails = Maps.newHashMap();
    issueDetails.put(22, new ScanResults.IssueDetails());
    XIssue i1 = XIssue.builder().vulnerability("Stored_XSS").additionalDetails(addDetails).details(issueDetails).severity("High").cwe("79").description("Method rs=stmt.executeQuery at line 22 of src\\\\main\\\\webapp").link("https://ast.dev.checkmarx-ts.com/CxWebClient/ViewerMain.aspx?scanid=1000194&projec").build();
    XIssue i2 = XIssue.builder().vulnerability("SQL_Injection").additionalDetails(addDetails).details(issueDetails).severity("Medium").cwe("89").description("Method rs=stmt.executeQuery at line 22 of src\\\\main\\\\webapp").link("https://ast.dev.checkmarx-ts.com/CxWebClient/ViewerMain.aspx?scanid=1000194&projec").build();
    List<XIssue> issues = Lists.newArrayList();
    issues.add(i1);
    issues.add(i2);
    ScanResults results = new ScanResults();
    results.setXIssues(issues);
    return results;
}
Also used : XIssue(com.checkmarx.sdk.dto.ScanResults.XIssue) ScanResults(com.checkmarx.sdk.dto.ScanResults)

Aggregations

ScanResults (com.checkmarx.sdk.dto.ScanResults)1 XIssue (com.checkmarx.sdk.dto.ScanResults.XIssue)1