Skip to content

Commit

Permalink
1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
apoorvasingh5 committed Jun 15, 2023
1 parent bb28088 commit 696deaa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
18 changes: 8 additions & 10 deletions Scripts/sys_script_include_716c87ad471f1110328ca368436d438a.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<unload unload_date="2023-06-02 11:13:08">
<unload unload_date="2023-06-15 06:21:38">
<sys_script_include action="INSERT_OR_UPDATE">
<access>public</access>
<active>true</active>
Expand All @@ -15,7 +15,7 @@ CheckmarxOneAppListProcessor.prototype = Object.extendsObject(sn_vul.Application
* passed individually to the VR AppVul API
*/
MSG: 'CheckmarxOne AppListProcessor:',
process: function(attachment) {
process: function (attachment) {
if (!attachment) {
gs.warn(gs.getMessage('CheckmarxOneAppListProcessor: Called with no attachment'));
return;
Expand All @@ -26,17 +26,16 @@ CheckmarxOneAppListProcessor.prototype = Object.extendsObject(sn_vul.Application
appDoc.parseXML(new GlideSysAttachment().getContent(attachment));
var listNode = appDoc.getNode("/appInfoList/xml/projects");
var iter = listNode.getChildNodeIterator();
if (iter.hasNext())
iter.next();
while (iter.hasNext()) {
var appNode = iter.next();
var attributes = appNode.getAttributes();
//map attributes from Checkmarx into the servicenow expected format'
var appObj = {
source_app_id: attributes.id,
app_name: attributes.name,
app_name: attributes.id,
source_assigned_teams: attributes.groups,
description: attributes.description,
description: appNode.getLastChild().getTextContent().toString(),
};
//Updating the project information in ServiceNow table
var result = this.AVR_API.createOrUpdateApp(appObj);
Expand All @@ -48,8 +47,7 @@ CheckmarxOneAppListProcessor.prototype = Object.extendsObject(sn_vul.Application
else if (result.unchanged)
this.import_counts.unchanged++;
}
if (iter.hasNext())
iter.next();
}
} catch (ex) {
errorMessage = gs.getMessage("Error in retriving data for app list integration!");
Expand All @@ -67,13 +65,13 @@ CheckmarxOneAppListProcessor.prototype = Object.extendsObject(sn_vul.Application
<sys_created_by>admin</sys_created_by>
<sys_created_on>2022-11-21 12:03:00</sys_created_on>
<sys_id>716c87ad471f1110328ca368436d438a</sys_id>
<sys_mod_count>44</sys_mod_count>
<sys_mod_count>46</sys_mod_count>
<sys_name>CheckmarxOneAppListProcessor</sys_name>
<sys_package display_value="Checkmarx One Vulnerability Integration" source="x_chec3_chexone">3d20e92d47471110328ca368436d436a</sys_package>
<sys_policy/>
<sys_scope display_value="Checkmarx One Vulnerability Integration">3d20e92d47471110328ca368436d436a</sys_scope>
<sys_update_name>sys_script_include_716c87ad471f1110328ca368436d438a</sys_update_name>
<sys_updated_by>[email protected]</sys_updated_by>
<sys_updated_on>2023-03-16 10:55:08</sys_updated_on>
<sys_updated_on>2023-06-06 06:23:26</sys_updated_on>
</sys_script_include>
</unload>
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ CheckmarxOneAppVulItemProcessor.prototype = Object.extendsObject(sn_vul.Applicat
var reportData = {};
if (listNode) {
var iter = listNode.getChildNodeIterator();
if (iter.hasNext())
iter.next();
while (iter.hasNext()) {
var node = iter.next();
reportData['source_app_id'] = node.getAttribute('app_id');
Expand Down
21 changes: 15 additions & 6 deletions Scripts/sys_script_include_f60f0ee047131110328ca368436d43ba.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<unload unload_date="2023-06-02 11:12:30">
<unload unload_date="2023-06-15 06:21:19">
<sys_script_include action="INSERT_OR_UPDATE">
<access>public</access>
<active>true</active>
Expand Down Expand Up @@ -58,9 +58,18 @@ CheckmarxOneAppListIntegration.prototype = Object.extendsObject(sn_vul.Applicati
for (var item in response.projects) {
groups = +response.projects[item].groups.toString();
if (groups == 0) {
appListAll += ' <project id="' + response.projects[item].id + '" name="' + response.projects[item].id + '" description="' + response.projects[item].name + ' createdAt:' + response.projects[item].createdAt + '" groups="' + groupval + '"/>';
appListAll += '<project id="' + response.projects[item].id +
'" name="' + response.projects[item].id +
' createdAt:' + response.projects[item].createdAt +
'" groups="' + groupval + '">' +
'<description><' + '![CDATA[' + response.projects[item].name + ']]' + '></description></project>';
} else {
appListAll += ' <project id="' + response.projects[item].id + '" name="' + response.projects[item].id + '" description="' + response.projects[item].name + ' createdAt:' + response.projects[item].createdAt + '" groups="' + response.projects[item].groups.toString() + '"/>';
appListAll += '<project id="' + response.projects[item].id +
'" name="' + response.projects[item].id +
' createdAt:' + response.projects[item].createdAt +
'" groups="' + response.projects[item].groups.toString() + '">' +
'<description><' + '![CDATA[' + response.projects[item].name + ']]' + '></description></project>';
}
}
Expand Down Expand Up @@ -88,7 +97,7 @@ CheckmarxOneAppListIntegration.prototype = Object.extendsObject(sn_vul.Applicati
this.LATEST = latest;
}
} else {
this.LATEST = new GlideDateTime(this.DELTA_START_TIME || '1970-01-01T10:16:06.17544Z');
this.LATEST = new GlideDateTime();
var projectJSON = this.UTIL.getNewProjectList(this.IMPLEMENTATION);
var filteredCount = projectJSON.filteredTotalCount;
if (filteredCount !== "undefined") {
Expand Down Expand Up @@ -174,13 +183,13 @@ CheckmarxOneAppListIntegration.prototype = Object.extendsObject(sn_vul.Applicati
<sys_created_by>admin</sys_created_by>
<sys_created_on>2022-11-18 05:11:38</sys_created_on>
<sys_id>f60f0ee047131110328ca368436d43ba</sys_id>
<sys_mod_count>129</sys_mod_count>
<sys_mod_count>131</sys_mod_count>
<sys_name>CheckmarxOneAppListIntegration</sys_name>
<sys_package display_value="Checkmarx One Vulnerability Integration" source="x_chec3_chexone">3d20e92d47471110328ca368436d436a</sys_package>
<sys_policy/>
<sys_scope display_value="Checkmarx One Vulnerability Integration">3d20e92d47471110328ca368436d436a</sys_scope>
<sys_update_name>sys_script_include_f60f0ee047131110328ca368436d43ba</sys_update_name>
<sys_updated_by>[email protected]</sys_updated_by>
<sys_updated_on>2023-05-23 14:50:01</sys_updated_on>
<sys_updated_on>2023-06-06 17:18:33</sys_updated_on>
</sys_script_include>
</unload>

0 comments on commit 696deaa

Please sign in to comment.