Addig code for Git dashboard.
@@ -332,14 +332,14 @@ public class GitLabSecurityDashboard extends ImmutableIssueTracker {
private void getSastResultsDashboardNewVersion(ScanRequest request, ScanResults results) throws MachinaException {
List<com.checkmarx.flow.gitdashboardnewver.Vulnerability> vulns = new ArrayList<>();
- Scanner__1 scanner = Scanner__1.builder().id("Checkmarx-SAST").name("Checkmarx-SAST").build();
+ Scanner__1 scanner = Scanner__1.builder().id("checkmarx-sast").name("checkmarx-sast").build();
for(ScanResults.XIssue issue : results.getXIssues()) {
if(issue.getDetails() != null) {
issue.getDetails().forEach((k, v) -> {
com.checkmarx.flow.gitdashboardnewver.Vulnerability vuln= com.checkmarx.flow.gitdashboardnewver.Vulnerability.builder()
.id(issue.getVulnerability().concat(":").concat(issue.getFilename()).concat(":").concat(k.toString()))
- .category("sast")
+ .category("sast-Checkmarx")
.name(issue.getVulnerability())
.message(String.format(ISSUE_FORMAT, issue.getVulnerability(), issue.getFilename(), k))
.description(issue.getDescription())
@@ -348,7 +348,7 @@ public class GitLabSecurityDashboard extends ImmutableIssueTracker {
.confidence(com.checkmarx.flow.gitdashboardnewver.Vulnerability.Confidence.valueOf(issue.getSeverity()))//Need To add as per Enum
.solution(issue.getLink())
.scanner(scanner)//__1 wala scanner use karenge
- .identifiers(getIdentifiersNewVer(issue))//Identifiers seems correct but need to add Link and Description flags
+ .identifiers(getIdentifiersNewVer(issue,k))//Identifiers seems correct but need to add Link and Description flags
.links(getLinksNewVer(issue))//New Added
//.details(issue.getDetails()) //Yet To Add
.tracking(com.checkmarx.flow.gitdashboardnewver.Tracking.builder()
@@ -492,13 +492,14 @@ public class GitLabSecurityDashboard extends ImmutableIssueTracker {
}
- private List<com.checkmarx.flow.gitdashboardnewver.Identifier> getIdentifiersNewVer(ScanResults.XIssue issue){
+ private List<com.checkmarx.flow.gitdashboardnewver.Identifier> getIdentifiersNewVer(ScanResults.XIssue issue,Integer k){
List<com.checkmarx.flow.gitdashboardnewver.Identifier> identifiers = new ArrayList<>();
+
identifiers.add(
com.checkmarx.flow.gitdashboardnewver.Identifier.builder()
.type("checkmarx_finding")
.name("Checkmarx-".concat(issue.getVulnerability()))
- .value(issue.getVulnerability())
+ .value(issue.getVulnerability().concat(":").concat(issue.getFilename()).concat(":").concat(k.toString()))
.url(URI.create(issue.getLink()))
.build()
);
