-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb28088
commit 696deaa
Showing
3 changed files
with
23 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
@@ -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; | ||
|
@@ -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); | ||
|
@@ -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!"); | ||
|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
|
@@ -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>'; | ||
} | ||
} | ||
|
@@ -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") { | ||
|
@@ -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> |