Skip to content

Commit 677ca58

Browse files
authored
Merge pull request #29 from checkmarx-ltd/Integration_Branch
Integration branch
2 parents 90e6cf7 + 197fd92 commit 677ca58

12 files changed

+10510
-8995
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-06-12 10:11:49">
2+
<unload unload_date="2024-10-11 12:58:46">
33
<sys_script_include action="INSERT_OR_UPDATE">
44
<access>public</access>
55
<active>true</active>

Scripts/CheckmarxOneAppListProcessor_sys_script_include_716c87ad471f1110328ca368436d438a.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-06-12 10:11:43">
2+
<unload unload_date="2024-10-11 12:59:01">
33
<sys_script_include action="INSERT_OR_UPDATE">
44
<access>public</access>
55
<active>true</active>

Scripts/CheckmarxOneAppVulItemIntegration_sys_script_include_891d8fed471f1110328ca368436d4334.xml

+375-219
Large diffs are not rendered by default.

Scripts/CheckmarxOneAppVulItemProcessor_sys_script_include_ba2b3da69769e510026f72021153af1b.xml

+54-8
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-06-12 10:11:31">
2+
<unload unload_date="2024-10-11 12:59:25">
33
<sys_script_include action="INSERT_OR_UPDATE">
44
<access>public</access>
55
<active>true</active>
@@ -28,8 +28,11 @@ CheckmarxOneAppVulItemProcessor.prototype = Object.extendsObject(sn_vul.Applicat
2828
if (result_node.toString().includes("Results")) {
2929
var listNode = doc.getNode('/scanResults/Results');
3030
}
31+
if (result_node.toString().includes("fixedSASTData")) {
32+
var fixedSASTNode = doc.getNode('/scanResults/fixedSASTData');
33+
}
3134
if (result_node.toString().includes("fixedSCAData")) {
32-
var fixedNode = doc.getNode('/scanResults/fixedSCAData');
35+
var fixedSCANode = doc.getNode('/scanResults/fixedSCAData');
3336
}
3437
3538
} catch (ex) {
@@ -136,6 +139,7 @@ CheckmarxOneAppVulItemProcessor.prototype = Object.extendsObject(sn_vul.Applicat
136139
queryData['source_entry_id'] = 'Checkmarx One' + "-" + node.getAttribute('id');
137140
resultObj['source_avit_id'] = node.getAttribute('id') + node.getAttribute('package_unique_id');
138141
resultObj['source_references'] = node.getFirstChild().getTextContent().toString();
142+
resultObj['source_notes'] = node.getAttribute('exploitable_method').toString();
139143
140144
}
141145
if (scan_type == 'kics') {
@@ -197,9 +201,9 @@ CheckmarxOneAppVulItemProcessor.prototype = Object.extendsObject(sn_vul.Applicat
197201
198202
}
199203
}
200-
if (fixedNode) {
204+
if (fixedSCANode) {
201205
var fixedData = {};
202-
var sca_iter = fixedNode.getChildNodeIterator();
206+
var sca_iter = fixedSCANode.getChildNodeIterator();
203207
while (sca_iter.hasNext()) {
204208
try {
205209
var sca_node = sca_iter.next();
@@ -220,11 +224,53 @@ CheckmarxOneAppVulItemProcessor.prototype = Object.extendsObject(sn_vul.Applicat
220224
fixedData['source_severity'] = severity;
221225
fixedData['scan_summary_name'] = reportData.scan_summary_name;
222226
fixedData['source_sdlc_status'] = 'Not Applicable';
223-
fixedData['package_unique_id'] = scaattributes.id;
227+
fixedData['package_unique_id'] = 'scaattributes.id';
224228
this._upsertAVIT(fixedData);
225229
226230
} catch (ex) {
227-
errorMessage = gs.getMessage("Error in retriving data for app vulnerability item integration!");
231+
errorMessage = gs.getMessage("Error in processing SCA Fixed Vulnerability!");
232+
gs.error(this.MSG + " " + errorMessage + " " + ex.message);
233+
errorProcess += " | " + ex.message;
234+
235+
}
236+
}
237+
}
238+
239+
if (fixedSASTNode) {
240+
var fixedSASTData = {};
241+
var sast_iter = fixedSASTNode.getChildNodeIterator();
242+
while (sast_iter.hasNext()) {
243+
try {
244+
var sast_node = sast_iter.next();
245+
var sastattributes = sast_node.getAttributes();
246+
247+
var fixedResultHash = '';
248+
var fixedChildIter = sast_node.getChildNodeIterator();
249+
while (fixedChildIter.hasNext) {
250+
var fixedChildNode = fixedChildIter.next();
251+
if (fixedChildNode.getNodeName() == "resultHash") {
252+
fixedResultHash = fixedChildNode.getTextContent();
253+
break;
254+
}
255+
}
256+
var fixedSimilarityId = sastattributes.id;
257+
var fixedSimilarityIdHash = fixedSimilarityId + '_' + fixedResultHash;
258+
259+
var last_scan_date = new GlideDateTime(sastattributes.last_scan_date);
260+
fixedSASTData['source_app_id'] = sastattributes.app_id;
261+
fixedSASTData['source_scan_id'] = sastattributes.scan_id;
262+
fixedSASTData['scan_type'] = 'static';
263+
fixedSASTData['source_avit_id'] = fixedSimilarityIdHash;
264+
fixedSASTData['source_entry_id'] ='Checkmarx One' + " CWE-" + sastattributes.cweId;
265+
fixedSASTData['source_remediation_status'] = 'FIXED';
266+
fixedSASTData['source_severity'] = sastattributes.source_severity;
267+
fixedSASTData['scan_summary_name'] = fixedSASTData.source_scan_id + ' ' + last_scan_date;
268+
fixedSASTData['source_sdlc_status'] = 'Not Applicable';
269+
fixedSASTData['package_unique_id'] = sastattributes.package_unique_id;
270+
this._upsertAVIT(fixedSASTData);
271+
272+
} catch (ex) {
273+
errorMessage = gs.getMessage("Error in processing SAST Fixed Vulnerability!");
228274
gs.error(this.MSG + " " + errorMessage + " " + ex.message);
229275
errorProcess += " | " + ex.message;
230276
@@ -337,13 +383,13 @@ CheckmarxOneAppVulItemProcessor.prototype = Object.extendsObject(sn_vul.Applicat
337383
<sys_created_by>[email protected]</sys_created_by>
338384
<sys_created_on>2023-03-16 05:04:10</sys_created_on>
339385
<sys_id>ba2b3da69769e510026f72021153af1b</sys_id>
340-
<sys_mod_count>61</sys_mod_count>
386+
<sys_mod_count>66</sys_mod_count>
341387
<sys_name>CheckmarxOneAppVulItemProcessor</sys_name>
342388
<sys_package display_value="Checkmarx One Vulnerability Integration" source="x_chec3_chexone">3d20e92d47471110328ca368436d436a</sys_package>
343389
<sys_policy/>
344390
<sys_scope display_value="Checkmarx One Vulnerability Integration">3d20e92d47471110328ca368436d436a</sys_scope>
345391
<sys_update_name>sys_script_include_ba2b3da69769e510026f72021153af1b</sys_update_name>
346392
<sys_updated_by>admin</sys_updated_by>
347-
<sys_updated_on>2024-05-22 13:26:13</sys_updated_on>
393+
<sys_updated_on>2024-09-18 10:33:40</sys_updated_on>
348394
</sys_script_include>
349395
</unload>

Scripts/CheckmarxOneConfigUtilBase_sys_script_include_508f0d54471f1110328ca368436d43f8.xml

+10-4
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-06-12 10:11:26">
2+
<unload unload_date="2024-10-11 12:59:35">
33
<sys_script_include action="INSERT_OR_UPDATE">
44
<access>package_private</access>
55
<active>true</active>
@@ -26,7 +26,10 @@ CheckmarxOneConfigUtilBase.prototype = {
2626
var implConfig = new GlideRecord("sn_sec_int_impl_config");
2727
} catch (ex) {
2828
result = false;
29-
errorMessage = gs.getMessage("Credential validation failed!");
29+
if (null != ex.message && 'undefined' != ex.message && ex.message.indexOf('Credential validation failed due to missing Permissions') != -1)
30+
errorMessage = ex.message;
31+
else
32+
errorMessage = gs.getMessage("Credential validation failed!");
3033
gs.warn("Failed to validate Checkmarx credentials! Reason: {0}", ex);
3134
} finally {
3235
resultObj = {
@@ -68,11 +71,14 @@ CheckmarxOneConfigUtilBase.prototype = {
6871
"import_kics": gr.getValue("import_kics") === "1",
6972
"triaging_in_snow": gr.getValue("triaging_in_snow") === "1",
7073
"vulnerability_threshold_level": gr.getValue("vulnerability_threshold_level"),
74+
"scan_synchronization": gr.getValue("scan_synchronization"),
7175
"access_token": gr.access_token.getDecryptedValue(),
7276
"sync_only_primary_branch": gr.getValue("sync_only_primary_branch") === "1",
7377
"list_projects": gr.getValue("list_of_project_id_s"),
78+
"result_states": gr.getValue("result_states"),
7479
"project_filter_by_name": gr.getValue("project_filter_by_name"),
7580
"filter_project": gr.getValue("filter_project"),
81+
"scan_type" : gs.nil(gr.getValue("scan_type")) ? "" : gr.getValue("scan_type"),
7682
};
7783
7884
new sn_sec_int.Implementation().setConfiguration(instance, newconfig);
@@ -87,13 +93,13 @@ CheckmarxOneConfigUtilBase.prototype = {
8793
<sys_created_by>admin</sys_created_by>
8894
<sys_created_on>2022-11-17 05:45:19</sys_created_on>
8995
<sys_id>508f0d54471f1110328ca368436d43f8</sys_id>
90-
<sys_mod_count>58</sys_mod_count>
96+
<sys_mod_count>61</sys_mod_count>
9197
<sys_name>CheckmarxOneConfigUtilBase</sys_name>
9298
<sys_package display_value="Checkmarx One Vulnerability Integration" source="x_chec3_chexone">3d20e92d47471110328ca368436d436a</sys_package>
9399
<sys_policy/>
94100
<sys_scope display_value="Checkmarx One Vulnerability Integration">3d20e92d47471110328ca368436d436a</sys_scope>
95101
<sys_update_name>sys_script_include_508f0d54471f1110328ca368436d43f8</sys_update_name>
96102
<sys_updated_by>admin</sys_updated_by>
97-
<sys_updated_on>2024-05-22 12:54:21</sys_updated_on>
103+
<sys_updated_on>2024-10-01 07:32:02</sys_updated_on>
98104
</sys_script_include>
99105
</unload>

Scripts/CheckmarxOneDevOpsIntegration_sys_script_include_f171708947e431108a980178c26d434f.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-06-12 10:11:20">
2+
<unload unload_date="2024-10-11 12:59:51">
33
<sys_script_include action="INSERT_OR_UPDATE">
44
<access>package_private</access>
55
<active>true</active>

Scripts/CheckmarxOneScanSummaryDetailsJSONProcessor_sys_script_include_b8934b914768b1108a980178c26d4313.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-06-12 10:11:16">
2+
<unload unload_date="2024-10-11 13:00:02">
33
<sys_script_include action="INSERT_OR_UPDATE">
44
<access>package_private</access>
55
<active>true</active>

0 commit comments

Comments
 (0)