The appscan-issue-gateway-v2
facilitates issue synchronization between AppScan (AppScan on Cloud, AppScan 360°, and AppScan Enterprise) and Jira. This capability enables AppScan users to transfer security issue data to other systems, eliminating the need for custom REST calls and plumbing. This service operates as a REST API, making it suitable for automated scanning workflows where it is invoked for issue processing.
The following prerequisites are required:
- Node.js runtime version 22.14.0 or later
- A relevant AppScan product:
- HCL AppScan Enterprise version 10.x or later
- AppScan on Cloud
- AppScan 360° version 1.3 or later
- A supported Issue Management system: Jira
To install the application, complete the following steps:
-
Download or clone the code from the repository.
-
To install all required npm libraries:
- From the home directory, open the command prompt.
- Run the command:
npm install
-
Edit the
.env
file in the home directory by renaming.env.temp
to.env
and configure the following properties:APPSCAN_URL
: The URL of AppScan Enterprise, AppScan on Cloud, or AppScan 360°keyId
: The AppScan key IDkeySecret
: AppScan key secretAPPSCAN_PROVIDER
: AppScan on Cloud, AppScan 360°, or AppScan EnterpriseAPPSCAN_TIMEZONE
: Your local time zone (for example, by default, keep it 00:00)SECURE_PORT
: The port the gateway application listens toSSL_PFX_CERT_FILE
: The path to the certificate in PFX formaSSL_PFX_CERT_PASSPHRASE
: The certificate passphrase or passwordNODE_TLS_REJECT_UNAUTHORIZED
: Set to 1 if you have valid certificates for AppScan Enterprise or AppScan 360° (see "Notes," item 4)LOCAL_ADMIN_USER
: The only user who can log in to the Issue GatewayADMIN_USER_PASSWORD
: The hashed password of the Issue Gateway user. To hash the password, run the commandnode cryptoService.js --hash <password>
from the root directoryAPP_LOG
: The path and name of the log fileMAXLOGSIZE
: The maximum size of the log fileNUMBER_OF_BACKUPS
: The number of backupsIM_PROVIDER
: The provider name (for example, JIRA)GENERATE_HTML_FILE_JIRA
: Set to 'true' to attach reports in JiraGENERATE_SCAN_HTML_FILE_JIRA
: Set to 'true' to create a separate ticket for scans.IMPORT_ISSUES_TO_IM_SYNC_INTERVAL
: Starts the synchronization thread to push data from AppScan to the Issue Management System. A value of1
means the synchronizer runs every day to push issues identified the previous day. A value of2
means that the synchronizer runs once every two days to push issues identified in the last two days.IM_TO_APPSCAN_STATUS_SYNC_INTERVAL
: A bidirectional feature to update the issue status in AppScan from Jira. The synchronization interval can be in minutes, hours, or days (for example,1d
for daily,10m
for every 10 minutes,1h
for hourly).APPSCAN_TO_IM_STATUS_SYNC_INTERVAL
: A feature to update issue status in Jira from AppScan. The synchronization interval can be in minutes, hours, or days (for example,1d
for daily,10m
for every 10 minutes,1h
for hourly). (see "Notes," item 1)
-
Rename
config/JIRA.json.temp
toconfig/JIRA.json
and configure the following properties:maxissues
: The maximum number of issues to process in this jobimSummary
: The summary of the Jira ticket. You can also include AppScan's issue response attribute—for example, "Security issue found in %ApplicationName%",". Here, %ApplicationName% will be picked dynamically.issuestates
: The specific issue states to focus onissueseverities
: The specific issue severities to focus onimurl
: URL of your Jira instanceimUserName
: The Jira username for running the jobimPassword
: The password for the corresponding Jira userimissuetype
: The Jira issue type (for example, task, bug, epic)severityPriorityMap
: A map AppScan severity to Jira ticket priority. (see "Notes," item 2)
-
attributeMappings
: Use this mapping to create Jira tickets with attributes mapped from AppScan attributes.-
"imAttrId": "<This is an attribute id from the IM>", "imAttrName:"<The name of the attribute from the IM>" "defaultAttrValue": "<If you want to have a hardcoded value for an IM attribute then you use this field>", "appScanAttr": "<This is an attribute name from AppScan>", "type": "<Type of Jira attribute. Currently we support following types: String, Array, Dropdown, DateTime>"}
-
-
jiraToAppScanStatusMapping
: Use this mapping to update the issue status in AppScan when an issue in Jira changes to a specific status. For example:"Closed": "Fixed"
: This will update the issue status in AppScan to Fixed when the corresponding ticket in Jira changes to Closed.
-
appScanToJiraStatusMapping
: Use this mapping to update the issue status in Jira when an issue in AppScan changes to a specific status. For example:"Noise":"False Positive"
: This will update the issue status in Jira to False Positive when the corresponding ticket in AppScan changes to Noise. (See "Notes," item 3.)
-
jiraStatusIdMapping
: Map Jira status names to their corresponding status IDs.
- Rename
config/projectKey.json.temp
toconfig/projectKey.json
and map the AppScan application ID to the Jira project key as required. - Rename
config/projectScanKey.json.temp
toconfig/projectScanKey.json
and map the AppScan application ID to the Jira project key as required. - To start the gateway application locally, run the command
npm start
from the root directory. To install it as a service, see the next step. - To install or uninstall the application as a Windows Service, run the following commands from the root directory:
node service.js --install
node service.js --uninstall
- Access the API's Swagger page using the URL
https://<hostname>:<port>/api/swagger
. This URL can be found in the console or log. - Use the API to provide Issue Management details and start the synchronizer, or edit the file in the config directory.
- If installing the service fails following step 8, complete the following steps:
- Download the NSSM utility from NSSM
- Launch
nssm.exe
from thewin64
folder by running the commandnssm.exe install "HCL Issue Gateway"
AppScan Issue Gateway has the following limitations:
- Bidirectional functionality is currently not available for personal scans.
- The synchronization of issues imported through external scanners in AppScan Enterprise is currently not supported.
- Issues will always be created in the default state (To Do) and then transit to the target state based on
appScanToJiraStatusMapping
in the nextAPPSCAN_TO_IM_STATUS_SYNC_INTERVAL
job run. For example, if an issue during the import was Noise in AppScan, then the issue will be created in Jira as Open, and then based on the mapping configured inappScanToJiraStatusMapping
, the issue status will transition to the target state in the next job run. - If no mapping is present in the
Jira.Json
file for the keyseverityPriorityMap
, then the priority of the ticket created will beMedium
by default. - A cyclic dependency means that a status in AppScan maps to a status in Jira, and that status in Jira maps back to the original status in AppScan, or vice versa. In
appScanToJiraStatusMapping
andjiraToAppScanStatusMapping
, you can configure the status to synchronize between AppScan and Jira. However, you cannot specify the same status in both the mappings; doing so will cause a validation error. - If you get certificate-related errors, verify that you have valid certificates.
All files in this project are licensed under the Apache License 2.0.