From c5d4c953463120a6ed26b3ba1ec52a3e855d51b3 Mon Sep 17 00:00:00 2001 From: Apoorva Date: Tue, 27 Jun 2023 19:25:00 +0530 Subject: [PATCH] Latest Update with Start time fix. --- ...clude_f60f0ee047131110328ca368436d43ba.xml | 2 +- ...clude_716c87ad471f1110328ca368436d438a.xml | 14 +- ...clude_891d8fed471f1110328ca368436d4334.xml | 2 +- ...clude_ba2b3da69769e510026f72021153af1b.xml | 9 +- ...clude_508f0d54471f1110328ca368436d43f8.xml | 2 +- ...clude_5c0f0d18471f1110328ca368436d4357.xml | 2 +- ...clude_d7f2d2e447131110328ca368436d4321.xml | 2 +- ...clude_ec0e828f47f42110328ca368436d433b.xml | 20 +- ...clude_1980bcb147935110328ca368436d435a.xml | 1143 ++++++++--------- ...clude_afffecb147935110328ca368436d43ea.xml | 28 + 10 files changed, 631 insertions(+), 593 deletions(-) create mode 100644 Scripts/CheckmarxOneUtil_sys_script_include_afffecb147935110328ca368436d43ea.xml diff --git a/Scripts/CheckmarxOneAppListIntegration_sys_script_include_f60f0ee047131110328ca368436d43ba.xml b/Scripts/CheckmarxOneAppListIntegration_sys_script_include_f60f0ee047131110328ca368436d43ba.xml index 11ca578..e05c82f 100644 --- a/Scripts/CheckmarxOneAppListIntegration_sys_script_include_f60f0ee047131110328ca368436d43ba.xml +++ b/Scripts/CheckmarxOneAppListIntegration_sys_script_include_f60f0ee047131110328ca368436d43ba.xml @@ -1,5 +1,5 @@ - + public true diff --git a/Scripts/CheckmarxOneAppListProcessor_sys_script_include_716c87ad471f1110328ca368436d438a.xml b/Scripts/CheckmarxOneAppListProcessor_sys_script_include_716c87ad471f1110328ca368436d438a.xml index ed7ba21..6c29c7d 100644 --- a/Scripts/CheckmarxOneAppListProcessor_sys_script_include_716c87ad471f1110328ca368436d438a.xml +++ b/Scripts/CheckmarxOneAppListProcessor_sys_script_include_716c87ad471f1110328ca368436d438a.xml @@ -1,5 +1,5 @@ - + public true @@ -59,12 +59,13 @@ CheckmarxOneAppListProcessor.prototype = Object.extendsObject(sn_vul.Application } catch (ex) { errorMessage = gs.getMessage("Error in retriving data for app list integration!"); - gs.error(this.MSG + " " + errorMessage + " " + ex.message); - errorProcess += " | " + ex.message; + gs.error(this.MSG + "errorMessage " + ex); + errorProcess += " | " + ex.getMessage(); } } + if (!gs.nil(errorProcess)) - gs.error(this.MSG + " All errors that occurred while processing project lists: " + errorProcess); + gs.error(this.MSG + "All errors that occurred while processing project lists: " + errorProcess); this.completeProcess(this.integrationProcessGr, this.import_counts); }, @@ -74,12 +75,13 @@ CheckmarxOneAppListProcessor.prototype = Object.extendsObject(sn_vul.Application admin 2022-11-21 12:03:00 716c87ad471f1110328ca368436d438a - +48 CheckmarxOneAppListProcessor 3d20e92d47471110328ca368436d436a 3d20e92d47471110328ca368436d436a sys_script_include_716c87ad471f1110328ca368436d438a - +apoorva.singh@checkmarx.com +2023-06-26 17:18:16 diff --git a/Scripts/CheckmarxOneAppVulItemIntegration_sys_script_include_891d8fed471f1110328ca368436d4334.xml b/Scripts/CheckmarxOneAppVulItemIntegration_sys_script_include_891d8fed471f1110328ca368436d4334.xml index ef571c8..2052091 100644 --- a/Scripts/CheckmarxOneAppVulItemIntegration_sys_script_include_891d8fed471f1110328ca368436d4334.xml +++ b/Scripts/CheckmarxOneAppVulItemIntegration_sys_script_include_891d8fed471f1110328ca368436d4334.xml @@ -1,5 +1,5 @@ - + public true diff --git a/Scripts/CheckmarxOneAppVulItemProcessor_sys_script_include_ba2b3da69769e510026f72021153af1b.xml b/Scripts/CheckmarxOneAppVulItemProcessor_sys_script_include_ba2b3da69769e510026f72021153af1b.xml index 509a114..6035102 100644 --- a/Scripts/CheckmarxOneAppVulItemProcessor_sys_script_include_ba2b3da69769e510026f72021153af1b.xml +++ b/Scripts/CheckmarxOneAppVulItemProcessor_sys_script_include_ba2b3da69769e510026f72021153af1b.xml @@ -1,4 +1,5 @@ + public true @@ -143,12 +144,13 @@ CheckmarxOneAppVulItemProcessor.prototype = Object.extendsObject(sn_vul.Applicat errorMessage = gs.getMessage("Error in retriving data for app vulnerability item integration!"); gs.error(this.MSG + " " + errorMessage + " " + ex.message); errorProcess += " | " + ex.message; + } } } if (!gs.nil(errorProcess)) - gs.error(this.MSG + " All errors that occurred while processing Vulnerability lists: " + errorProcess); + gs.error(this.MSG + "All errors that occurred while processing Vulnerability lists: " + errorProcess); this.completeProcess(this.integrationProcessGr, this.import_counts); } else gs.warn(this.MSG + ':process called with no attachment'); @@ -217,12 +219,13 @@ CheckmarxOneAppVulItemProcessor.prototype = Object.extendsObject(sn_vul.Applicat apoorva.singh@checkmarx.com 2023-03-16 05:04:10 ba2b3da69769e510026f72021153af1b - +23 CheckmarxOneAppVulItemProcessor 3d20e92d47471110328ca368436d436a 3d20e92d47471110328ca368436d436a sys_script_include_ba2b3da69769e510026f72021153af1b - +apoorva.singh@checkmarx.com +2023-06-26 16:47:43 diff --git a/Scripts/CheckmarxOneConfigUtilBase_sys_script_include_508f0d54471f1110328ca368436d43f8.xml b/Scripts/CheckmarxOneConfigUtilBase_sys_script_include_508f0d54471f1110328ca368436d43f8.xml index 9022fb9..c0fa33c 100644 --- a/Scripts/CheckmarxOneConfigUtilBase_sys_script_include_508f0d54471f1110328ca368436d43f8.xml +++ b/Scripts/CheckmarxOneConfigUtilBase_sys_script_include_508f0d54471f1110328ca368436d43f8.xml @@ -1,5 +1,5 @@ - + package_private true diff --git a/Scripts/CheckmarxOneConfigUtil_sys_script_include_5c0f0d18471f1110328ca368436d4357.xml b/Scripts/CheckmarxOneConfigUtil_sys_script_include_5c0f0d18471f1110328ca368436d4357.xml index 90ee940..29403fb 100644 --- a/Scripts/CheckmarxOneConfigUtil_sys_script_include_5c0f0d18471f1110328ca368436d4357.xml +++ b/Scripts/CheckmarxOneConfigUtil_sys_script_include_5c0f0d18471f1110328ca368436d4357.xml @@ -1,5 +1,5 @@ - + public true diff --git a/Scripts/CheckmarxOneScanSummaryIntegration_sys_script_include_d7f2d2e447131110328ca368436d4321.xml b/Scripts/CheckmarxOneScanSummaryIntegration_sys_script_include_d7f2d2e447131110328ca368436d4321.xml index 0101428..5dbf23b 100644 --- a/Scripts/CheckmarxOneScanSummaryIntegration_sys_script_include_d7f2d2e447131110328ca368436d4321.xml +++ b/Scripts/CheckmarxOneScanSummaryIntegration_sys_script_include_d7f2d2e447131110328ca368436d4321.xml @@ -1,5 +1,5 @@ - + public true diff --git a/Scripts/CheckmarxOneScanSummaryProcessor_sys_script_include_ec0e828f47f42110328ca368436d433b.xml b/Scripts/CheckmarxOneScanSummaryProcessor_sys_script_include_ec0e828f47f42110328ca368436d433b.xml index 01e7552..def49ca 100644 --- a/Scripts/CheckmarxOneScanSummaryProcessor_sys_script_include_ec0e828f47f42110328ca368436d433b.xml +++ b/Scripts/CheckmarxOneScanSummaryProcessor_sys_script_include_ec0e828f47f42110328ca368436d433b.xml @@ -1,4 +1,5 @@ + public true @@ -46,9 +47,10 @@ CheckmarxOneScanSummaryProcessor.prototype = Object.extendsObject(sn_vul.Applica sastdata['scan_summary_name'] = Sastattributes.app_name + ' ' + sastdata['last_scan_date']; this._upsert(sastdata); } catch (ex) { - errorMessage = gs.getMessage("Error in retriving data for CxOneSast scan list integration!"); - gs.error(this.MSG + " " + errorMessage + " " + ex.message); - errorProcess += " | " + ex.message; + errorMessage = gs.getMessage("Error in retriving data for scan list integration!"); + gs.error(this.MSG + "errorMessage " + ex); + errorProcess += " | " + ex.getMessage(); + //throw ex; } } } @@ -73,14 +75,15 @@ CheckmarxOneScanSummaryProcessor.prototype = Object.extendsObject(sn_vul.Applica data['scan_summary_name'] = attributes.app_name + ' ' + data['last_scan_date']; this._upsert(data); } catch (ex) { - errorMessage = gs.getMessage("Error in retriving data for CxOneSca scan list integration!"); - gs.error(this.MSG + " " + errorMessage + " " + ex.message); - errorProcess += " | " + ex.message; + errorMessage = gs.getMessage("Error in retriving data for scan list integration!"); + gs.error(this.MSG + "errorMessage " + ex); + errorProcess += " | " + ex.getMessage(); + //throw ex; } } } if (!gs.nil(errorProcess)) - gs.error(this.MSG + " All errors that occurred while processing scan summary: " + errorProcess); + gs.error(this.MSG + "All errors that occurred while processing scan summary: " + errorProcess); this.completeProcess(this.integrationProcessGr, this.import_counts); } else @@ -131,10 +134,13 @@ CheckmarxOneScanSummaryProcessor.prototype = Object.extendsObject(sn_vul.Applica admin 2023-02-08 12:56:43 ec0e828f47f42110328ca368436d433b +9 CheckmarxOneScanSummaryProcessor 3d20e92d47471110328ca368436d436a 3d20e92d47471110328ca368436d436a sys_script_include_ec0e828f47f42110328ca368436d433b +apoorva.singh@checkmarx.com +2023-06-26 17:22:27 diff --git a/Scripts/CheckmarxOneUtilBase_sys_script_include_1980bcb147935110328ca368436d435a.xml b/Scripts/CheckmarxOneUtilBase_sys_script_include_1980bcb147935110328ca368436d435a.xml index f3d17aa..a66b8e1 100644 --- a/Scripts/CheckmarxOneUtilBase_sys_script_include_1980bcb147935110328ca368436d435a.xml +++ b/Scripts/CheckmarxOneUtilBase_sys_script_include_1980bcb147935110328ca368436d435a.xml @@ -1,5 +1,5 @@ - + public true @@ -8,603 +8,602 @@ false Wrapper class to assemble the components for Checkmarx One integration calls. CheckmarxOneUtilBase - + var newconfig = { + "client_secret": gr.client_secret.getDecryptedValue(), + "client_id": gr.getValue("client_id"), + "ast_client_id": gr.getValue("ast_client_id"), + "tenant": gr.getValue("tenant"), + "checkmarxone_api_base_url": gr.getValue("checkmarxone_api_base_url"), + "checkmarxone_server_url": gr.getValue("checkmarxone_server_url"), + "include_first_detection_date": gr.getValue("include_first_detection_date") === "1", + "import_sca": gr.getValue("import_dast") === "1", + "import_sast": gr.getValue("import_sast") === "1", + "triaging_in_snow": gr.getValue("triaging_in_snow") === "1", + "vulnerability_threshold_level": gr.getValue("vulnerability_threshold_level"), + }; + new sn_sec_int.Implementation().setConfiguration(instance, newconfig); + return true; + } catch (err) { + gs.error(this.MSG + " :saveInstanceTokens : Error while saving the access tokens to database."); + throw err; + } + }, + //value of sca checkbox + importScaFlaw: function(configId) { + return this._getConfig(configId).import_sca; + }, + //value of sast checkbox + importSastFlaw: function(configId) { + return this._getConfig(configId).import_sast; + }, + + //validate XML + validateXML: function(body, errorNodeName) { + if (!body) return; + var doc = new XMLDocument2(); + doc.parseXML(body); + var err = null; + try { + var root = doc.getFirstNode('/' + doc.getDocumentElement().getNodeName()); + if (errorNodeName && root.getNodeName() == errorNodeName) + err = root.getTextContent(); + else + doc.getNextNode(root); + } catch (e) { + throw 'XML document syntax invalid'; + } + if (err) + throw this.MSG + 'Error: ' + err; + }, + + type: 'CheckmarxOneUtilBase' +};]]> sys_script_include admin 2022-11-21 19:26:28 1980bcb147935110328ca368436d435a -151 +152 CheckmarxOneUtilBase 3d20e92d47471110328ca368436d436a 3d20e92d47471110328ca368436d436a sys_script_include_1980bcb147935110328ca368436d435a apoorva.singh@checkmarx.com -2023-06-26 18:16:03 +2023-06-27 08:25:18 diff --git a/Scripts/CheckmarxOneUtil_sys_script_include_afffecb147935110328ca368436d43ea.xml b/Scripts/CheckmarxOneUtil_sys_script_include_afffecb147935110328ca368436d43ea.xml new file mode 100644 index 0000000..f4249d0 --- /dev/null +++ b/Scripts/CheckmarxOneUtil_sys_script_include_afffecb147935110328ca368436d43ea.xml @@ -0,0 +1,28 @@ + + + +public +true +x_chec3_chexone.CheckmarxOneUtil + +false + +CheckmarxOneUtil + +sys_script_include +admin +2022-11-21 19:19:33 +afffecb147935110328ca368436d43ea +1 +CheckmarxOneUtil +3d20e92d47471110328ca368436d436a + +3d20e92d47471110328ca368436d436a +sys_script_include_afffecb147935110328ca368436d43ea +admin +2022-11-28 05:19:36 + +