JIRA
Description
Section titled “Description”This repository contains scripts and configurations to interact with Jira and manage project vulnerabilities using NightVision SARIF reports.
Preview: Example Results
Section titled “Preview: Example Results”
NightVision explains how the vulnerability was exploited, why it matters, and where to fix it.
Prerequisites
Section titled “Prerequisites”- Python 3.x
- Jira account and API token
- NightVision account
-
Clone the repository:
Terminal window git clone https://github.com/nvsecurity/jira-issue-from-sarif.gitcd jira-issue-from-sarif -
Install required packages:
Terminal window pip install argparse jira -
Set environment variables (or pass these arguments directly to the scripts):
Terminal window export JIRA_URL='your_jira_url'export JIRA_USER_EMAIL='your_jira_user_email@example.com'export JIRA_API_TOKEN='your_jira_api_token' # see Create Jira API Token belowexport JIRA_PROJECT_ID='your_jira_project_id' # see Find Jira Project ID belowexport JIRA_ISSUE_TYPE='your_jira_issue_type' # optional, defaults to 'Task'export JIRA_COMPONENT='your_jira_component' # optional
Create Jira API Token
Section titled “Create Jira API Token”- Go to Jira API tokens.
- Create a new API token and copy it.
Find Jira Project ID
Section titled “Find Jira Project ID”-
Run the following command to get Jira project IDs:
Terminal window python get-jira-project-id.pyUsage:
usage: python get-jira-project-id.py [-h] --url URL --email EMAIL --token TOKENCreate Jira tickets from SARIF report.optional arguments:-h, --help show this help message and exitJira server credentials:--url URL Jira server URL (JIRA_URL environment variable)--email EMAIL Jira user email (JIRA_USER_EMAIL environment variable)--token TOKEN Jira API token (JIRA_API_TOKEN environment variable) -
Select the Jira Project ID you need. Example output:
Projects Available: 21Project ID: 10001Name : NightVisionKey : NV2Project ID: 10004Name : NV SalesKey : NS
Create Tickets from SARIF
Section titled “Create Tickets from SARIF”-
Export NightVision SARIF report for a specific scan:
Terminal window nightvision export sarif -s "your_scan_id" --swagger-file "./your/swagger/file/path.yaml"This should create a
results.sariffile in your current directory. -
Create Jira tickets from the SARIF report:
Terminal window python sarif-to-jira.py -p "your_project_id"Usage:
usage: python sarif-to-jira.py [-h] --url URL --email EMAIL --token TOKEN -p PROJECT-ID -i TYPE -c COMPONENTCreate Jira tickets from SARIF report.optional arguments:-h, --help show this help message and exitJira server credentials:--url URL Jira server URL (JIRA_URL environment variable)--email EMAIL Jira user email (JIRA_USER_EMAIL environment variable)--token TOKEN Jira API token (JIRA_API_TOKEN environment variable)Issue properties:-p PROJECT-ID, --project-id PROJECT-IDJira Project ID (JIRA_PROJECT_ID environment variable)-i TYPE, --issue-type TYPEIssue type - defaults to 'Task' (JIRA_ISSUE_TYPE environment variable)-c COMPONENT, --component COMPONENTIssue component (JIRA_COMPONENT environment variable)