Skip to content

Commit 4b0a6aa

Browse files
committed
Added new data structure for SCA results
1 parent f02bd00 commit 4b0a6aa

File tree

4 files changed

+91
-2
lines changed

4 files changed

+91
-2
lines changed

src/main/java/com/checkmarx/ast/results/result/Data.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ public class Data {
2525
String expectedValue;
2626
String value;
2727
String fileName;
28+
String packageIdentifier;
29+
String recommendedVersion;
2830
int line;
2931
List<Node> nodes;
3032
List<PackageData> packageData;
33+
ScaPackageCollection scanPackageCollection;
3134

3235
public Data(@JsonProperty("queryId") String queryId,
3336
@JsonProperty("queryName") String queryName,
@@ -39,9 +42,12 @@ public Data(@JsonProperty("queryId") String queryId,
3942
@JsonProperty("expectedValue") String expectedValue,
4043
@JsonProperty("value") String value,
4144
@JsonProperty("filename") String fileName,
45+
@JsonProperty("packageIdentifier") String packageIdentifier,
46+
@JsonProperty("recommendedVersion") String recommendedVersion,
4247
@JsonProperty("line") int line,
4348
@JsonProperty("nodes") List<Node> nodes,
44-
@JsonProperty("packageData") List<PackageData> packageData) {
49+
@JsonProperty("packageData") List<PackageData> packageData,
50+
@JsonProperty("scanPackageCollection") ScaPackageCollection scanPackageCollection) {
4551
this.queryId = queryId;
4652
this.queryName = queryName;
4753
this.group = group;
@@ -52,8 +58,11 @@ public Data(@JsonProperty("queryId") String queryId,
5258
this.expectedValue = expectedValue;
5359
this.value = value;
5460
this.fileName = fileName;
61+
this.packageIdentifier = packageIdentifier;
62+
this.recommendedVersion = recommendedVersion;
5563
this.line = line;
5664
this.nodes = nodes;
5765
this.packageData = packageData;
66+
this.scanPackageCollection = scanPackageCollection;
5867
}
5968
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.checkmarx.ast.results.result;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import com.fasterxml.jackson.annotation.JsonInclude;
5+
import com.fasterxml.jackson.annotation.JsonProperty;
6+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
7+
import lombok.Value;
8+
9+
@Value
10+
@JsonDeserialize()
11+
@JsonInclude(JsonInclude.Include.NON_NULL)
12+
@JsonIgnoreProperties(ignoreUnknown = true)
13+
public class DependencyPath {
14+
15+
String Id;
16+
String name;
17+
String version;
18+
boolean isResolved;
19+
boolean isDevelopment;
20+
21+
22+
public DependencyPath(@JsonProperty("Id") String id,
23+
@JsonProperty("name") String name,
24+
@JsonProperty("version") String version,
25+
@JsonProperty("isResolved") boolean isResolved,
26+
@JsonProperty("isDevelopment") boolean isDevelopment) {
27+
28+
Id = id;
29+
this.name = name;
30+
this.version = version;
31+
this.isResolved = isResolved;
32+
this.isDevelopment = isDevelopment;
33+
}
34+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.checkmarx.ast.results.result;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import com.fasterxml.jackson.annotation.JsonInclude;
5+
import com.fasterxml.jackson.annotation.JsonProperty;
6+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
7+
import lombok.Value;
8+
9+
import java.util.List;
10+
11+
@Value
12+
@JsonDeserialize()
13+
@JsonInclude(JsonInclude.Include.NON_NULL)
14+
@JsonIgnoreProperties(ignoreUnknown = true)
15+
public class ScaPackageCollection {
16+
17+
String Id;
18+
List<String> locations;
19+
List<DependencyPath> dependencyPathArray;
20+
boolean outdated;
21+
22+
23+
public ScaPackageCollection(@JsonProperty("Id") String id,
24+
@JsonProperty("locations") List<String> locations,
25+
@JsonProperty("dependencyPathArray") List<DependencyPath> dependencyPathArray,
26+
@JsonProperty("outdated") boolean outdated) {
27+
28+
Id = id;
29+
this.locations = locations;
30+
this.dependencyPathArray = dependencyPathArray;
31+
this.outdated = outdated;
32+
}
33+
}

src/main/java/com/checkmarx/ast/results/result/VulnerabilityCVSS.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,29 @@ public class VulnerabilityCVSS {
1717
String availability;
1818
String confidentiality;
1919
String attackComplexity;
20+
String integrityImpact;
21+
String scope;
22+
String privilegesRequired;
23+
String userInteraction;
24+
2025

2126
public VulnerabilityCVSS(@JsonProperty("version") int version,
2227
@JsonProperty("attackVector") String attackVector,
2328
@JsonProperty("availability") String availability,
2429
@JsonProperty("confidentiality") String confidentiality,
25-
@JsonProperty("attackComplexity") String attackComplexity) {
30+
@JsonProperty("attackComplexity") String attackComplexity,
31+
@JsonProperty("integrityImpact") String integrityImpact,
32+
@JsonProperty("scope") String scope,
33+
@JsonProperty("privilegesRequired") String privilegesRequired,
34+
@JsonProperty("userInteraction") String userInteraction) {
2635
this.version = version;
2736
this.attackVector = attackVector;
2837
this.availability = availability;
2938
this.confidentiality = confidentiality;
3039
this.attackComplexity = attackComplexity;
40+
this.integrityImpact = integrityImpact;
41+
this.scope = scope;
42+
this.privilegesRequired = privilegesRequired;
43+
this.userInteraction = userInteraction;
3144
}
3245
}

0 commit comments

Comments
 (0)