Skip to content

Commit 931aa33

Browse files
Merge pull request #373 from checkmarx-ltd/pr-CXFLW-967-custom-fields
CXFLW-967 Custom Map Fix
2 parents 14cee15 + 52a6a12 commit 931aa33

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
</parent>
1111
<groupId>com.github.checkmarx-ltd</groupId>
1212
<artifactId>cx-spring-boot-sdk</artifactId>
13+
1314
<version>0.5.70</version>
1415
<name>cx-spring-boot-sdk</name>
1516
<description>Checkmarx Java Spring Boot SDK</description>

src/main/java/com/checkmarx/sdk/config/CxProperties.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ public class CxProperties extends CxPropertiesBase{
6363

6464
private Map<String, String> customStateMap;
6565

66+
@Getter @Setter
67+
private Map<String, String> customStateFalsePositiveMap;
68+
6669
private Map<String, String> sshKeyList;
6770

6871
private Boolean cxBranch = false;
@@ -302,6 +305,14 @@ public String getStateFullName(String key){
302305
return stateFullName;
303306
}
304307

308+
public String checkCustomFalsePositive(String key){
309+
try {
310+
return customStateFalsePositiveMap.get(key);
311+
}catch (Exception e){
312+
return null;
313+
}
314+
}
315+
305316
public Boolean getGroupBySeverity() {
306317
return groupBySeverity;
307318
}

src/main/java/com/checkmarx/sdk/service/CxService.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,10 @@ private ScanResults.XIssue buildIssue(ScanResults.XIssue.XIssueBuilder xIssueBui
995995
if (!resultType.getFalsePositive().equalsIgnoreCase("FALSE")) {
996996
falsePositive = true;
997997
}
998+
if (cxProperties.checkCustomFalsePositive(resultType.getState())!=null) {
999+
log.info("CusumState issue found which is false positive.");
1000+
falsePositive = true;
1001+
}
9981002
/*Map issue details*/
9991003
xIssueBuilder.cwe(result.getCweId());
10001004
xIssueBuilder.language(result.getLanguage());

0 commit comments

Comments
 (0)