Skip to content

Commit 02ad271

Browse files
authored
Merge pull request #30 from checkmarx-ltd/Integration_Branch
CxOne 1.0.23 release items
2 parents 677ca58 + df3e92b commit 02ad271

10 files changed

+13041
-12120
lines changed

Scripts/CheckmarxOneAppListIntegration_sys_script_include_f60f0ee047131110328ca368436d43ba.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<unload unload_date="2024-10-11 12:58:46">
2+
<unload unload_date="2024-12-20 12:24:17">
33
<sys_script_include action="INSERT_OR_UPDATE">
44
<access>public</access>
55
<active>true</active>

Scripts/CheckmarxOneAppListProcessor_sys_script_include_716c87ad471f1110328ca368436d438a.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<unload unload_date="2024-10-11 12:59:01">
2+
<unload unload_date="2024-12-20 12:24:20">
33
<sys_script_include action="INSERT_OR_UPDATE">
44
<access>public</access>
55
<active>true</active>
@@ -110,13 +110,13 @@ CheckmarxOneAppListProcessor.prototype = Object.extendsObject(sn_vul.Application
110110
<sys_created_by>admin</sys_created_by>
111111
<sys_created_on>2022-11-21 12:03:00</sys_created_on>
112112
<sys_id>716c87ad471f1110328ca368436d438a</sys_id>
113-
<sys_mod_count>75</sys_mod_count>
113+
<sys_mod_count>79</sys_mod_count>
114114
<sys_name>CheckmarxOneAppListProcessor</sys_name>
115115
<sys_package display_value="Checkmarx One Vulnerability Integration" source="x_chec3_chexone">3d20e92d47471110328ca368436d436a</sys_package>
116116
<sys_policy/>
117117
<sys_scope display_value="Checkmarx One Vulnerability Integration">3d20e92d47471110328ca368436d436a</sys_scope>
118118
<sys_update_name>sys_script_include_716c87ad471f1110328ca368436d438a</sys_update_name>
119119
<sys_updated_by>admin</sys_updated_by>
120-
<sys_updated_on>2024-05-22 05:08:04</sys_updated_on>
120+
<sys_updated_on>2024-12-02 17:29:36</sys_updated_on>
121121
</sys_script_include>
122122
</unload>

Scripts/CheckmarxOneAppVulItemIntegration_sys_script_include_891d8fed471f1110328ca368436d4334.xml

+165-152
Large diffs are not rendered by default.

Scripts/CheckmarxOneAppVulItemProcessor_sys_script_include_ba2b3da69769e510026f72021153af1b.xml

+138-30
Large diffs are not rendered by default.

Scripts/CheckmarxOneConfigUtilBase_sys_script_include_508f0d54471f1110328ca368436d43f8.xml

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<unload unload_date="2024-10-11 12:59:35">
2+
<unload unload_date="2024-12-20 12:24:35">
33
<sys_script_include action="INSERT_OR_UPDATE">
44
<access>package_private</access>
55
<active>true</active>
@@ -69,15 +69,18 @@ CheckmarxOneConfigUtilBase.prototype = {
6969
"import_sca": gr.getValue("import_sca") === "1",
7070
"import_sast": gr.getValue("import_sast") === "1",
7171
"import_kics": gr.getValue("import_kics") === "1",
72+
"exclude_dev_and_test_dependencies": gr.getValue("exclude_dev_and_test_dependencies") === "1",
7273
"triaging_in_snow": gr.getValue("triaging_in_snow") === "1",
7374
"vulnerability_threshold_level": gr.getValue("vulnerability_threshold_level"),
7475
"scan_synchronization": gr.getValue("scan_synchronization"),
7576
"access_token": gr.access_token.getDecryptedValue(),
7677
"sync_only_primary_branch": gr.getValue("sync_only_primary_branch") === "1",
7778
"list_projects": gr.getValue("list_of_project_id_s"),
7879
"result_states": gr.getValue("result_states"),
80+
"link": gr.getValue("link"),
7981
"project_filter_by_name": gr.getValue("project_filter_by_name"),
8082
"filter_project": gr.getValue("filter_project"),
83+
"severity": gr.getValue("severity"),
8184
"scan_type" : gs.nil(gr.getValue("scan_type")) ? "" : gr.getValue("scan_type"),
8285
};
8386
@@ -93,13 +96,13 @@ CheckmarxOneConfigUtilBase.prototype = {
9396
<sys_created_by>admin</sys_created_by>
9497
<sys_created_on>2022-11-17 05:45:19</sys_created_on>
9598
<sys_id>508f0d54471f1110328ca368436d43f8</sys_id>
96-
<sys_mod_count>61</sys_mod_count>
99+
<sys_mod_count>64</sys_mod_count>
97100
<sys_name>CheckmarxOneConfigUtilBase</sys_name>
98101
<sys_package display_value="Checkmarx One Vulnerability Integration" source="x_chec3_chexone">3d20e92d47471110328ca368436d436a</sys_package>
99102
<sys_policy/>
100103
<sys_scope display_value="Checkmarx One Vulnerability Integration">3d20e92d47471110328ca368436d436a</sys_scope>
101104
<sys_update_name>sys_script_include_508f0d54471f1110328ca368436d43f8</sys_update_name>
102105
<sys_updated_by>admin</sys_updated_by>
103-
<sys_updated_on>2024-10-01 07:32:02</sys_updated_on>
106+
<sys_updated_on>2024-11-05 10:44:52</sys_updated_on>
104107
</sys_script_include>
105108
</unload>

Scripts/CheckmarxOneScanSummaryIntegration_sys_script_include_d7f2d2e447131110328ca368436d4321.xml

+50-20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<unload unload_date="2024-10-11 13:00:13">
2+
<unload unload_date="2024-12-20 12:24:40">
33
<sys_script_include action="INSERT_OR_UPDATE">
44
<access>public</access>
55
<active>true</active>
@@ -73,7 +73,9 @@ CheckmarxOneScanSummaryIntegration.prototype = Object.extendsObject(sn_vul.Appli
7373
primaryBranch = this.UTIL.getProjectById(this.IMPLEMENTATION, appId).mainBranch.toString();
7474
if (null != primaryBranch && '' != primaryBranch) {
7575
responseLastScanSummary = this.UTIL.getScanListFilterByBranch(this.IMPLEMENTATION, appId, this._getCurrentDeltaStartTime(), primaryBranch);
76-
}
76+
branches = this.UTIL.getProjectBranchList(this.IMPLEMENTATION, appId);
77+
} else
78+
responseLastScanSummary = this.UTIL.getScanInfo(this.IMPLEMENTATION, appId, newoffset, this._getCurrentDeltaStartTime());
7779
} else if (scan_synchronization == 'latest scan from each branch') {
7880
branches = this.UTIL.getProjectBranchList(this.IMPLEMENTATION, appId);
7981
if (null != branches && '' != branches) {
@@ -97,10 +99,14 @@ CheckmarxOneScanSummaryIntegration.prototype = Object.extendsObject(sn_vul.Appli
9799
var lastSastDate;
98100
var lastScaDate;
99101
var lastKicsDate;
102+
var prvBranch = '';
103+
var prvSastScanBranch = '';
104+
var prvScaScanBranch = '';
105+
var prvKicsScanBranch = '';
100106
101107
while (scanSummary.hasNext()) {
102108
scanSummary.next();
103-
var prvBranch = '';
109+
104110
var isBranchMatched = 'false';
105111
var tags = scanSummary.getValue('tags');
106112
if (null != tags && '' != tags && 'undefined' != tags) {
@@ -111,51 +117,57 @@ CheckmarxOneScanSummaryIntegration.prototype = Object.extendsObject(sn_vul.Appli
111117
prvBranch = record.substring(8);
112118
}
113119
}
120+
114121
if (null == scan_synchronization || '' == scan_synchronization || 'undefined' == scan_synchronization)
115122
isBranchMatched = 'true';
116-
else if (scan_synchronization == 'latest scan of primary branch' && null != primaryBranch && '' != primaryBranch && primaryBranch == prvBranch)
117-
isBranchMatched = 'true';
118-
else if (scan_synchronization == 'latest scan from each branch' && null != branches && '' != branches && '' != prvBranch && branches.indexOf(prvBranch) != -1)
123+
else if ((scan_synchronization == 'latest scan of primary branch' || scan_synchronization == 'latest scan from each branch') &&
124+
null != branches && '' != branches && '' != prvBranch && branches.indexOf(prvBranch) != -1)
119125
isBranchMatched = 'true';
120126
else if (scan_synchronization == 'latest scan across all branches')
121127
isBranchMatched = 'true';
122128
if (null != scanSummary && null != scanSummary.source_scan_id && '' != scanSummary.source_scan_id && scanSummary.source_scan_id != 'undefined') {
123129
prvScanId = scanSummary.getValue('source_scan_id') + '';
130+
var lastUpdatedDate = scanSummary.getValue('sys_updated_on');
124131
if (prvScanId.indexOf('sast') != -1 && isBranchMatched == 'true') {
125-
if ((null == lastSastDate || '' == lastSastDate || 'undefined' == lastSastDate) || (lastSastDate && lastSastDate < scanSummary.last_scan_date)) {
132+
if ((null == lastSastDate || '' == lastSastDate || 'undefined' == lastSastDate) || (lastSastDate && lastUpdatedDate >= lastSastDate)) {
126133
sastPrvScanId = prvScanId;
127-
lastSastDate = scanSummary.last_scan_date;
134+
prvSastScanBranch = prvBranch;
135+
lastSastDate = lastUpdatedDate;
136+
128137
}
129138
if (null != scan_synchronization && '' != scan_synchronization && 'undefined' != scan_synchronization && scan_synchronization == 'latest scan from each branch') {
130139
if (prvSastScanIdBranch != '')
131140
prvSastScanIdBranch += '|||';
132-
prvSastScanIdBranch += prvBranch + ':::' + prvScanId + ':::' + scanSummary.last_scan_date;
141+
prvSastScanIdBranch += prvBranch + ':::' + prvScanId + ':::' + lastUpdatedDate;
133142
}
134143
}
135144
if (prvScanId.indexOf('sca') != -1 && isBranchMatched == 'true') {
136-
if ((null == lastScaDate || '' == lastScaDate || 'undefined' == lastScaDate) || (lastScaDate && lastScaDate < scanSummary.last_scan_date)) {
145+
if ((null == lastScaDate || '' == lastScaDate || 'undefined' == lastScaDate) || (lastScaDate && lastUpdatedDate >= lastScaDate)) {
137146
scaPrvScanId = prvScanId;
138-
lastScaDate = scanSummary.last_scan_date;
147+
prvScaScanBranch = prvBranch;
148+
lastScaDate = lastUpdatedDate;
139149
}
140150
if (null != scan_synchronization && '' != scan_synchronization && 'undefined' != scan_synchronization && scan_synchronization == 'latest scan from each branch') {
141151
if (prvScaScanIdBranch != '')
142152
prvScaScanIdBranch += '|||';
143-
prvScaScanIdBranch += prvBranch + ':::' + prvScanId + ':::' + scanSummary.last_scan_date;
153+
prvScaScanIdBranch += prvBranch + ':::' + prvScanId + ':::' + lastUpdatedDate;
144154
}
145155
}
146156
if (prvScanId.indexOf('IaC') != -1 && isBranchMatched == 'true') {
147-
if ((null == lastKicsDate || '' == lastKicsDate || 'undefined' == lastKicsDate) || (lastKicsDate && lastKicsDate < scanSummary.last_scan_date)) {
157+
if ((null == lastKicsDate || '' == lastKicsDate || 'undefined' == lastKicsDate) || (lastKicsDate && lastUpdatedDate >= lastKicsDate)) {
148158
kicsPrvScanId = prvScanId;
149-
lastKicsDate = scanSummary.last_scan_date;
159+
prvKicsScanBranch = prvBranch;
160+
lastKicsDate = lastUpdatedDate;
150161
}
151162
if (null != scan_synchronization && '' != scan_synchronization && 'undefined' != scan_synchronization && scan_synchronization == 'latest scan from each branch') {
152163
if (prvKicsScanIdBranch != '')
153164
prvKicsScanIdBranch += '|||';
154-
prvKicsScanIdBranch += prvBranch + ':::' + prvScanId + ':::' + scanSummary.last_scan_date;
165+
prvKicsScanIdBranch += prvBranch + ':::' + prvScanId + ':::' + lastUpdatedDate;
155166
}
156167
}
157168
}
158169
}
170+
159171
var branch = [];
160172
var configScanType = config.scan_type.toString();
161173
for (var item in jsonLastScanSummResp.scans) {
@@ -164,8 +176,13 @@ CheckmarxOneScanSummaryIntegration.prototype = Object.extendsObject(sn_vul.Appli
164176
var scaresponsevul = this.UTIL.getScanSummaryInfo(this.IMPLEMENTATION, jsonLastScanSummResp.scans[item].id);
165177
var scaScanType = "Full Scan";
166178
if (scaresponsevul != -1) {
167-
if (null != scan_synchronization && '' != scan_synchronization && 'undefined' != scan_synchronization && scan_synchronization == 'latest scan from each branch')
179+
if (null != scan_synchronization && '' != scan_synchronization && 'undefined' != scan_synchronization && scan_synchronization == 'latest scan from each branch') {
168180
scaPrvScanId = this._getPrvScanIdForSpecificBranch(prvScaScanIdBranch, jsonLastScanSummResp.scans[item].branch);
181+
if (scaPrvScanId == '')
182+
prvScaScanBranch = '';
183+
else
184+
prvScaScanBranch = '' + jsonLastScanSummResp.scans[item].branch;
185+
}
169186
scaScanSummaryAll += '<scan id="' + 'sca' + jsonLastScanSummResp.scans[item].id + '" app_id="' + appId +
170187
'" last_scan_date="' + this.UTIL.parseDate(jsonLastScanSummResp.scans[item].updatedAt) +
171188
'" total_no_flaws="' + scaresponsevul +
@@ -174,6 +191,7 @@ CheckmarxOneScanSummaryIntegration.prototype = Object.extendsObject(sn_vul.Appli
174191
'" scan_origin="' + jsonLastScanSummResp.scans[item].sourceOrigin +
175192
'" scan_source="' + jsonLastScanSummResp.scans[item].sourceType +
176193
'" scan_type="' + scaScanType +
194+
'" prvBranch="' + prvScaScanBranch +
177195
'" app_name="' + appId + '"/>';
178196
}
179197
}
@@ -193,8 +211,13 @@ CheckmarxOneScanSummaryIntegration.prototype = Object.extendsObject(sn_vul.Appli
193211
}
194212
var sastScanType = jsonLastScanSummResp.scans[item].metadata.configs[0].value.incremental == "false" ? "Full Scan" : "Incremental Scan";
195213
if (sastresponsevul != -1 && ((null == configScanType || '' == configScanType) || (sastScanTypeToCheck != '' && configScanType.indexOf(sastScanTypeToCheck) != -1))) {
196-
if (null != scan_synchronization && '' != scan_synchronization && 'undefined' != scan_synchronization && scan_synchronization == 'latest scan from each branch')
214+
if (null != scan_synchronization && '' != scan_synchronization && 'undefined' != scan_synchronization && scan_synchronization == 'latest scan from each branch') {
197215
sastPrvScanId = this._getPrvScanIdForSpecificBranch(prvSastScanIdBranch, jsonLastScanSummResp.scans[item].branch);
216+
if (sastPrvScanId == '')
217+
prvSastScanBranch = '';
218+
else
219+
prvSastScanBranch = '' + jsonLastScanSummResp.scans[item].branch;
220+
}
198221
var loc = this._getLOCforSAST(jsonLastScanSummResp.scans[item].statusDetails);
199222
sastScanSummaryAll += '<scan id="' + 'sast' + jsonLastScanSummResp.scans[item].id + '" app_id="' + appId +
200223
'" last_scan_date="' + this.UTIL.parseDate(jsonLastScanSummResp.scans[item].updatedAt) +
@@ -205,6 +228,7 @@ CheckmarxOneScanSummaryIntegration.prototype = Object.extendsObject(sn_vul.Appli
205228
'" scan_origin="' + jsonLastScanSummResp.scans[item].sourceOrigin +
206229
'" scan_source="' + jsonLastScanSummResp.scans[item].sourceType +
207230
'" scan_type="' + sastScanType +
231+
'" prvBranch="' + prvSastScanBranch +
208232
'" app_name="' + appId + '"/>';
209233
}
210234
}
@@ -215,8 +239,13 @@ CheckmarxOneScanSummaryIntegration.prototype = Object.extendsObject(sn_vul.Appli
215239
var scanType = "Full Scan";
216240
if (kicsresponsevul != -1) {
217241
218-
if (null != scan_synchronization && '' != scan_synchronization && 'undefined' != scan_synchronization && scan_synchronization == 'latest scan from each branch')
242+
if (null != scan_synchronization && '' != scan_synchronization && 'undefined' != scan_synchronization && scan_synchronization == 'latest scan from each branch') {
219243
kicsPrvScanId = this._getPrvScanIdForSpecificBranch(prvKicsScanIdBranch, jsonLastScanSummResp.scans[item].branch);
244+
if (kicsPrvScanId == '')
245+
prvKicsScanBranch = '';
246+
else
247+
prvKicsScanBranch = '' + jsonLastScanSummResp.scans[item].branch;
248+
}
220249
kicsScanSummaryAll += '<scan id="' + 'IaC' + jsonLastScanSummResp.scans[item].id + '" app_id="' + appId +
221250
'" last_scan_date="' + this.UTIL.parseDate(jsonLastScanSummResp.scans[item].updatedAt) +
222251
'" total_no_flaws="' + kicsresponsevul +
@@ -225,6 +254,7 @@ CheckmarxOneScanSummaryIntegration.prototype = Object.extendsObject(sn_vul.Appli
225254
'" scan_origin="' + jsonLastScanSummResp.scans[item].sourceOrigin +
226255
'" scan_source="' + jsonLastScanSummResp.scans[item].sourceType +
227256
'" scan_type="' + scanType +
257+
'" prvBranch="' + prvKicsScanBranch +
228258
'" app_name="' + appId + '"/>';
229259
}
230260
}
@@ -434,13 +464,13 @@ CheckmarxOneScanSummaryIntegration.prototype = Object.extendsObject(sn_vul.Appli
434464
<sys_created_by>admin</sys_created_by>
435465
<sys_created_on>2022-11-18 05:18:19</sys_created_on>
436466
<sys_id>d7f2d2e447131110328ca368436d4321</sys_id>
437-
<sys_mod_count>229</sys_mod_count>
467+
<sys_mod_count>267</sys_mod_count>
438468
<sys_name>CheckmarxOneScanSummaryIntegration</sys_name>
439469
<sys_package display_value="Checkmarx One Vulnerability Integration" source="x_chec3_chexone">3d20e92d47471110328ca368436d436a</sys_package>
440470
<sys_policy/>
441471
<sys_scope display_value="Checkmarx One Vulnerability Integration">3d20e92d47471110328ca368436d436a</sys_scope>
442472
<sys_update_name>sys_script_include_d7f2d2e447131110328ca368436d4321</sys_update_name>
443473
<sys_updated_by>admin</sys_updated_by>
444-
<sys_updated_on>2024-10-04 06:23:34</sys_updated_on>
474+
<sys_updated_on>2024-12-11 16:31:25</sys_updated_on>
445475
</sys_script_include>
446476
</unload>

0 commit comments

Comments
 (0)