tenable / integration-jira-cloud

69 stars 51 forks source link

Integration does not upload vulns to Jira #38

Closed Eonandia closed 4 years ago

Eonandia commented 4 years ago

Hi Steve,

I'm trying to integrate Jira Cloud with Tenable.sc in my lab using this library, but it doesn't fill Jira with tickets about vulnerabilities, it only creates the fields, issues, etc. The problem seems to be right there since i tried obtaining the vulnerabilities through the analysis endpoint using pyTenable and i am able to do so.

I created a vuln query using vulnerability detail list for this task, do i have to create any specific one or use any specific filter to make it work?

In my config file i used username and password for tenable.sc and all the other default options.

Here's the troubleshoot log :

tenable_debug.log

Thank you in advance.

SteveMcGrath commented 4 years ago

Can you please run with the --troubleshoot flag and paste what returns?

Eonandia commented 4 years ago
> 2020-04-24 17:24:25,873 root INFO Tenable2JiraCloud Version 1.1.5
> 2020-04-24 17:24:26,061 root INFO Using configuration file config.yaml
> 2020-04-24 17:24:26,062 root INFO Running on Python 3.8.1 Windows/AMD64
> 2020-04-24 17:24:26,064 tenable.sc.TenableSC DEBUG {"method": "GET", "url": "https://my-tenable-ip:443/rest/system", "params": {}, "body": {}}
> 2020-04-24 17:24:26,079 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): my-tenable-ip:443
> 2020-04-24 17:24:26,783 urllib3.connectionpool DEBUG https://my-tenable-ip:443 "GET /rest/system HTTP/1.1" 200 None
> 2020-04-24 17:24:26,826 tenable.sc.TenableSC DEBUG {"method": "POST", "url": "https://my-tenable-ip:443/rest/token", "params": "REDACTED", "body": "REDACTED"}
> 2020-04-24 17:24:27,794 urllib3.connectionpool DEBUG https://my-tenable-ip:443 "POST /rest/token HTTP/1.1" 200 282
> 2020-04-24 17:24:27,813 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): my-jira-cloud-ip:443
> 2020-04-24 17:24:28,233 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "GET /rest/api/3/project/VULN HTTP/1.1" 404 None
> 2020-04-24 17:24:28,260 restfly.errors.NotFoundError ERROR [404: GET] https://my-jira-cloud-ip/rest/api/3/project/VULN body=b'{"errorMessages":["No se encuentra un proyecto con el identificador \'VULN\'."],"errors":{}}'
> 2020-04-24 17:24:28,260 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/project", "params": {}, "body": {"key": "VULN", "name": "Vulnerability Management", "projectTypeKey": "business", "projectTemplateKey": "com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking", "description": "Managing vulnerabilities discovered from Tenable products.", "url": "https://tenable.com", "assigneeType": "UNASSIGNED", "leadAccountId": "5ddbc083752c1b0d114e74ed"}}
> 2020-04-24 17:24:29,041 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/project HTTP/1.1" 201 None
> 2020-04-24 17:24:29,407 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "GET /rest/api/3/field HTTP/1.1" 200 None
> 2020-04-24 17:24:29,432 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Tenable Platform", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:29,741 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:29,746 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "CVEs", "type": "com.atlassian.jira.plugin.system.customfieldtypes:labels", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher", "description": ""}}
> 2020-04-24 17:24:29,890 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:29,895 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "CVSSv2 Base Score", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:30,024 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:30,025 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "CVSSv2 Temporal Score", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:30,165 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:30,196 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "CVSSv3 Base Score", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:30,352 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:30,356 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "CVSSv3 Temporal Score", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:30,471 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:30,474 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Tenable Plugin ID", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:30,615 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:30,620 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Tenable Plugin Family", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:30,750 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:30,753 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Tenable Plugin Name", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:30,898 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:30,902 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability Severity", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:31,050 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:31,054 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Tenable Asset UUID", "type": "com.atlassian.jira.plugin.system.customfieldtypes:labels", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher", "description": ""}}
> 2020-04-24 17:24:31,193 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:31,198 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Device MAC Addresses", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:31,339 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:31,341 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Device IPv4 Addresses", "type": "com.atlassian.jira.plugin.system.customfieldtypes:labels", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher", "description": ""}}
> 2020-04-24 17:24:31,474 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:31,477 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Device IPv6 Addresses", "type": "com.atlassian.jira.plugin.system.customfieldtypes:labels", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher", "description": ""}}
> 2020-04-24 17:24:31,605 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:31,610 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Device Hostname", "type": "com.atlassian.jira.plugin.system.customfieldtypes:labels", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher", "description": ""}}
> 2020-04-24 17:24:31,746 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:31,750 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Device NetBIOS Name", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:31,882 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:31,885 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Device DNS Name", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:32,033 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:32,036 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Device Network ID", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:32,169 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:32,170 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability First Seen", "type": "com.atlassian.jira.plugin.system.customfieldtypes:datetime", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:datetimerange", "description": ""}}
> 2020-04-24 17:24:32,305 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:32,307 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability Last Seen", "type": "com.atlassian.jira.plugin.system.customfieldtypes:datetime", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:datetimerange", "description": ""}}
> 2020-04-24 17:24:32,504 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:32,505 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability Last Fixed", "type": "com.atlassian.jira.plugin.system.customfieldtypes:datetime", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:datetimerange", "description": ""}}
> 2020-04-24 17:24:32,646 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:32,649 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability State", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:32,801 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:32,803 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability Port", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:32,919 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:32,922 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability Protocol", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:33,064 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:33,071 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability Repository ID", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:33,209 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:33,210 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability Repository Name", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:33,359 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:33,365 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/field", "params": {}, "body": {"name": "Tenable VPR Score", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
> 2020-04-24 17:24:33,494 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/field HTTP/1.1" 201 None
> 2020-04-24 17:24:33,595 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "GET /rest/api/3/issuetype HTTP/1.1" 200 None
> 2020-04-24 17:24:33,598 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/issuetype", "params": {}, "body": {"name": "Task", "description": "", "type": "standard"}}
> 2020-04-24 17:24:33,701 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/issuetype HTTP/1.1" 409 None
> 2020-04-24 17:24:33,702 restfly.errors.RequestConflictError ERROR [409: POST] https://my-jira-cloud-ip/rest/api/3/issuetype body=b'{"errorMessages":[],"errors":{"name":"Ya existe un tipo de incidencia con este nombre."}}'
SteveMcGrath commented 4 years ago

There should be a lot more data than that.

Eonandia commented 4 years ago

Hmh, i'll try reinstalling the library, maybe something went wrong, because that's all i have in the troubleshoot log.

SteveMcGrath commented 4 years ago

it doesn't output the config, and issuetype listings, etc?

Eonandia commented 4 years ago

After reinstalling and rerunning the script with the same config file i got even less data, which i guess is logical since it has already create issue fields:

> 2020-04-24 17:52:15,094 root INFO Tenable2JiraCloud Version 1.1.5
> 2020-04-24 17:52:15,095 root INFO Using configuration file config.yaml
> 2020-04-24 17:52:15,095 root INFO Running on Python 3.8.1 Windows/AMD64
> 2020-04-24 17:52:15,095 tenable.sc.TenableSC DEBUG {"method": "GET", "url": "https://my-tenable-ip:443/rest/system", "params": {}, "body": {}}
> 2020-04-24 17:52:15,099 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): my-tenable-ip:443
> 2020-04-24 17:52:15,678 urllib3.connectionpool DEBUG https://my-tenable-ip:443 "GET /rest/system HTTP/1.1" 200 None
> 2020-04-24 17:52:15,722 tenable.sc.TenableSC DEBUG {"method": "POST", "url": "https://my-tenable-ip:443/rest/token", "params": "REDACTED", "body": "REDACTED"}
> 2020-04-24 17:52:16,595 urllib3.connectionpool DEBUG https://my-tenable-ip:443 "POST /rest/token HTTP/1.1" 200 282
> 2020-04-24 17:52:16,597 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): my-jira-cloud-ip:443
> 2020-04-24 17:52:17,010 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "GET /rest/api/3/project/VULN HTTP/1.1" 200 None
> 2020-04-24 17:52:17,145 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "GET /rest/api/3/field HTTP/1.1" 200 None
> 2020-04-24 17:52:17,239 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "GET /rest/api/3/issuetype HTTP/1.1" 200 None
> 2020-04-24 17:52:17,240 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://my-jira-cloud-ip/rest/api/3/issuetype", "params": {}, "body": {"name": "Task", "description": "", "type": "standard"}}
> 2020-04-24 17:52:17,344 urllib3.connectionpool DEBUG https://my-jira-cloud-ip:443 "POST /rest/api/3/issuetype HTTP/1.1" 409 None
> 2020-04-24 17:52:17,350 restfly.errors.RequestConflictError ERROR [409: POST] https://my-jira-cloud-ip/rest/api/3/issuetype body=b'{"errorMessages":[],"errors":{"name":"Ya existe un tipo de incidencia con este nombre."}}'

Any idea why the troubleshoot log has less data than expected?

SteveMcGrath commented 4 years ago

There should be an issue_debug.md file written. Post that. it has a lot of additional info that may help

Eonandia commented 4 years ago

It doesn't seem to be any issue_debug file anywhere. I'm guessing it should appear wherever i call the script from but there's nothing there apart from the tenable_debug.log that i already posted.

SteveMcGrath commented 4 years ago

What is outputted to the console when you run the script? There should be a traceback. As it sits right now, I don't know whats wrong.

Eonandia commented 4 years ago

This is the console output running the script with the troubleshoot flag and the same config.yaml:


> Traceback (most recent call last):
>   File "C:\Users\eonandia\AppData\Local\Programs\Python\Python38-32\Scripts\tenable-jira-script.py", line 11, in <module>
>     load_entry_point('tenable-jira-cloud==1.1.5', 'console_scripts', 'tenable-jira')()
>   File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 829, in __call__
>     return self.main(*args, **kwargs)
>   File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 782, in main
>     rv = self.invoke(ctx)
>   File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 1066, in invoke
>     return ctx.invoke(self.callback, **ctx.params)
>   File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\click\core.py", line 610, in invoke
>     return callback(*args, **kwargs)
>   File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\cli.py", line 124, in cli
>     ingest = Tio2Jira(source, jira, config)
>   File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\transform.py", line 22, in __init __
>     self._issue_types = self._jira.issue_types.upsert(config['issue_types'])
>   File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\jira\issuetypes.py", line 26, in
> upsert
>     newtype = self.create(
>   File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\jira\issuetypes.py", line 11, in
> create
>     return self._api.post('issuetype', json=kwargs).json()
>   File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\restfly\session.py", line 500, in post
>     return self._request('POST', path, **kwargs)
>   File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\restfly\session.py", line 447, in _request
>     raise err(resp, retries=retries, func=self._error_func)
> restfly.errors.RequestConflictError: [409: POST] https://my_jira_cloud_ip/rest/api/3/issuetype body=b'{"errorMessages":[],
> "errors":{"name":"Ya existe un tipo de incidencia con este nombre."}}'
SteveMcGrath commented 4 years ago

can you please define the issuetype IDs within your config?

https://github.com/tenable/integration-jira-cloud/issues/23#issuecomment-604502293

Eonandia commented 4 years ago

Ok, that seems to have worked, at least to get the issue_debug.md file; here it is:

Configuration File:

issue_types:
- jira_id: 3
  name: Task
  search:
  - Tenable Plugin ID
  type: standard
- jira_id: 10000
  name: Sub-task
  search:
  - Tenable Plugin ID
  - Tenable Asset UUID
  - Device IPv4
  - Device IPv6
  - Vulnerability Port
  - Vulnerability Protocol
  type: subtask
jira:
  address: <REDACTED>
  api_token: <REDACTED>
  api_username: <REDACTED>
project:
  leadAccountId: <REDACTED>
tenable:
  access_key: <REDACTED>
  address: <REDACTED>
  platform: tenable.sc
  query_id: 815
  secret_key: <REDACTED>

Debug Logs

2020-04-28 17:53:17,092 root INFO Tenable2JiraCloud Version 1.1.5
2020-04-28 17:53:17,092 root INFO Using configuration file config.yaml
2020-04-28 17:53:17,092 root INFO Running on Python 3.8.1 Windows/AMD64
2020-04-28 17:53:17,093 tenable.sc.TenableSC DEBUG {"method": "GET", "url": "https://<TENABLE_SC_HOST>:443/rest/system", "params": {}, "body": {}}
2020-04-28 17:53:17,096 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): <TENABLE_SC_HOST>:443
2020-04-28 17:53:17,921 urllib3.connectionpool DEBUG https://<TENABLE_SC_HOST>:443 "GET /rest/system HTTP/1.1" 200 None
2020-04-28 17:53:17,965 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): <JIRA_CLOUD_HOST>:443
2020-04-28 17:53:18,233 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/project/VULN HTTP/1.1" 200 None
2020-04-28 17:53:18,369 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/field HTTP/1.1" 200 None
2020-04-28 17:53:18,475 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/issuetype HTTP/1.1" 200 None
2020-04-28 17:53:18,476 tenable_jira.jira.Jira DEBUG {"method": "GET", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/screens", "params": {"startAt": 0, "maxResults": 100}, "body": {}}
2020-04-28 17:53:18,558 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens?startAt=0&maxResults=100 HTTP/1.1" 200 None
2020-04-28 17:53:18,560 tenable_jira.transform.Tio2Jira INFO Using JIRA Screens []
2020-04-28 17:53:18,561 tenable.sc.TenableSC DEBUG {"method": "GET", "url": "https://<TENABLE_SC_HOST>:443/rest/query/815?fields=filters", "params": {}, "body": {}}
2020-04-28 17:53:19,280 urllib3.connectionpool DEBUG https://<TENABLE_SC_HOST>:443 "GET /rest/query/815?fields=filters HTTP/1.1" 200 180
2020-04-28 17:53:19,283 tenable.sc.TenableSC DEBUG {"method": "POST", "url": "https://<TENABLE_SC_HOST>:443/rest/analysis", "params": {}, "body": {"type": "vuln", "sourceType": "cumulative", "query": {"tool": "vulndetails", "type": "vuln", "filters": [{"filterName": "lastSeen", "operator": "=", "value": "0-1588089198"}], "startOffset": 0, "endOffset": 1000}}}
2020-04-28 17:53:34,125 urllib3.connectionpool DEBUG https://<TENABLE_SC_HOST>:443 "POST /rest/analysis HTTP/1.1" 200 None
2020-04-28 17:53:35,498 tenable_jira.transform.Tio2Jira DEBUG Label Detected.  Config={'jira_field': 'Device IPv4 Addresses', 'type': 'labels', 'searcher': 'labelsearcher', 'issue_type': ['Sub-task'], 'tio_field': 'asset.ipv4', 'tsc_field': 'ip', 'jira_id': 'customfield_10067'} value=192.168.100.1
2020-04-28 17:53:35,498 tenable_jira.transform.Tio2Jira DEBUG Label Detected.  Config={'jira_field': 'Device Hostname', 'type': 'labels', 'searcher': 'labelsearcher', 'issue_type': ['Sub-task'], 'tio_field': 'asset.hostname', 'tsc_field': 'dnsName', 'jira_id': 'customfield_10069'} value=gateway
2020-04-28 17:53:35,511 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/search", "params": {}, "body": {"jql": "project = \"VULN\" and issuetype = \"Task\" and status not in (Closed, Done, Resolved) and \"Tenable Plugin ID\" ~ \"10180\""}}
2020-04-28 17:53:35,652 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/search HTTP/1.1" 200 None
2020-04-28 17:53:35,655 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/issue", "params": {"update_history": false}, "body": {"fields": {"project": {"key": "VULN"}, "issuetype": {"id": 3}, "customfield_10061": "10180", "customfield_10062": "Port scanners", "customfield_10063": "Ping the remote host", "customfield_10064": "Info", "summary": "[10180] Ping the remote host", "description": {"version": 1, "type": "doc", "content": [{"type": "heading", "attrs": {"level": 1}, "content": [{"type": "text", "text": "Description"}]}, {"type": "paragraph", "content": [{"type": "text", "text": "Nessus was able to determine if the remote host is alive using one or more of the following ping types :\n\n  - An ARP ping, provided the host is on the local subnet     and Nessus is running over Ethernet.\n\n  - An ICMP ping.\n\n  - A TCP ping, in which the plugin sends to the remote host     a packet with the flag SYN, and the host will reply with     a RST or a SYN/ACK.\n\n  - A UDP ping (e.g., DNS, RPC, and NTP)."}]}, {"type": "heading", "attrs": {"level": 1}, "content": [{"type": "text", "text": "Solution"}]}, {"type": "paragraph", "content": [{"type": "text", "text": ""}]}]}}}}
2020-04-28 17:53:35,786 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/issue?update_history=False HTTP/1.1" 400 None
2020-04-28 17:53:35,789 restfly.errors.BadRequestError ERROR [400: POST] https://<JIRA_CLOUD_HOST>/rest/api/3/issue?update_history=False body=b'{"errorMessages":[],"errors":{"issuetype":"valid issue type is required"}}'
2020-04-28 17:53:35,789 root ERROR Caught the following Exception
Traceback (most recent call last):
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\cli.py", line 132, in cli
    ingest.ingest(observed_since)
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\transform.py", line 483, in ingest
    self.create_issues(vulns)
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\transform.py", line 416, in create_issues
    self._process_open_vuln(v, fid)
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\transform.py", line 342, in _process_open_vuln
    i = self._jira.issues.upsert(fields=issue, jql=' and '.join(jql))
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\jira\issues.py", line 48, in upsert
    issue = self.create(**kwargs)
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\jira\issues.py", line 18, in create
    return self._api.post('issue',
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\restfly\session.py", line 500, in post
    return self._request('POST', path, **kwargs)
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\restfly\session.py", line 447, in _request
    raise err(resp, retries=retries, func=self._error_func)
restfly.errors.BadRequestError: [400: POST] https://<JIRA_CLOUD_HOST>/rest/api/3/issue?update_history=False body=b'{"errorMessages":[],"errors":{"issuetype":"valid issue type is required"}}'

Available IssueTypes

By the way, i was having some problems with line 183 of cli.py (os.remove('tenable_log.log')), giving this error:

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'tenable_debug.log'

For the sake of this issue, i made that line a comment and it worked.

SteveMcGrath commented 4 years ago

You're going to need to figure out what Issuetypes you need. I'm willing to bet that this is a language issue, as I can assume the Task and Sub-Task issuetype selector isn't working based on your empty "available issuetypes" section.

Take a look at the following debug code to help you:

https://github.com/tenable/integration-jira-cloud/issues/18#issuecomment-594759198

Eonandia commented 4 years ago

So, this is the output of the script on the comment you posted:

Issuetypes Selected are:
     10002: Task
     10003: Subtask
Available Issue Types are:
     10001: Historia
     10002: Tarea
     10004: Error
     10003: Subtarea
     10000: Epic

It is showed in spanish but when I use those names in the config and run the script the response is that those issutypes don't exist, so the language is not the problem, at least here.

So i've decided to clean everything up and retry from 0 and here is the log:

Configuration File:

issue_types:
- jira_id: 10002
  name: Task
  search:
  - Tenable Plugin ID
  type: standard
- jira_id: 10003
  name: Subtask
  search:
  - Tenable Plugin ID
  - Tenable Asset UUID
  - Device IPv4
  - Device IPv6
  - Vulnerability Port
  - Vulnerability Protocol
  type: subtask
jira:
  address: <REDACTED>
  api_token: <REDACTED>
  api_username: <REDACTED>
project:
  leadAccountId: <REDACTED>
tenable:
  access_key: <REDACTED>
  address: <REDACTED>
  platform: tenable.sc
  query_id: 815
  secret_key: <REDACTED>

Debug Logs

2020-04-30 13:22:00,501 root INFO Tenable2JiraCloud Version 1.1.5
2020-04-30 13:22:00,505 root INFO Using configuration file config.yaml
2020-04-30 13:22:00,505 root INFO Running on Python 3.8.1 Windows/AMD64
2020-04-30 13:22:00,506 tenable.sc.TenableSC DEBUG {"method": "GET", "url": "https://<TENABLE_SC_HOST>:443/rest/system", "params": {}, "body": {}}
2020-04-30 13:22:00,511 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): <TENABLE_SC_HOST>:443
2020-04-30 13:22:01,349 urllib3.connectionpool DEBUG https://<TENABLE_SC_HOST>:443 "GET /rest/system HTTP/1.1" 200 None
2020-04-30 13:22:01,387 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): <JIRA_CLOUD_HOST>:443
2020-04-30 13:22:01,896 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/project/VULN HTTP/1.1" 404 None
2020-04-30 13:22:01,900 restfly.errors.NotFoundError ERROR [404: GET] https://<JIRA_CLOUD_HOST>/rest/api/3/project/VULN body=b'{"errorMessages":["No se encuentra un proyecto con el identificador \'VULN\'."],"errors":{}}'
2020-04-30 13:22:01,901 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/project", "params": {}, "body": {"key": "VULN", "name": "Vulnerability Management", "projectTypeKey": "business", "projectTemplateKey": "com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking", "description": "Managing vulnerabilities discovered from Tenable products.", "url": "https://tenable.com", "assigneeType": "UNASSIGNED", "leadAccountId": "5ddbc083752c1b0d114e74ed"}}
2020-04-30 13:22:03,006 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/project HTTP/1.1" 201 None
2020-04-30 13:22:03,703 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/field HTTP/1.1" 200 None
2020-04-30 13:22:03,705 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Tenable Platform", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:03,867 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:03,868 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "CVEs", "type": "com.atlassian.jira.plugin.system.customfieldtypes:labels", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher", "description": ""}}
2020-04-30 13:22:04,138 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:04,142 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "CVSSv2 Base Score", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:04,309 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:04,309 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "CVSSv2 Temporal Score", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:04,591 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:04,596 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "CVSSv3 Base Score", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:04,738 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:04,740 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "CVSSv3 Temporal Score", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:05,136 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:05,139 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Tenable Plugin ID", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:05,268 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:05,271 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Tenable Plugin Family", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:05,474 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:05,478 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Tenable Plugin Name", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:05,630 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:05,633 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability Severity", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:05,857 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:05,858 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Tenable Asset UUID", "type": "com.atlassian.jira.plugin.system.customfieldtypes:labels", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher", "description": ""}}
2020-04-30 13:22:06,042 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:06,045 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Device MAC Addresses", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:06,262 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:06,264 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Device IPv4 Addresses", "type": "com.atlassian.jira.plugin.system.customfieldtypes:labels", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher", "description": ""}}
2020-04-30 13:22:06,423 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:06,426 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Device IPv6 Addresses", "type": "com.atlassian.jira.plugin.system.customfieldtypes:labels", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher", "description": ""}}
2020-04-30 13:22:06,545 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:06,547 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Device Hostname", "type": "com.atlassian.jira.plugin.system.customfieldtypes:labels", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher", "description": ""}}
2020-04-30 13:22:06,899 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:06,901 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Device NetBIOS Name", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:07,057 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:07,058 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Device DNS Name", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:07,198 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:07,203 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Device Network ID", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:07,387 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:07,392 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability First Seen", "type": "com.atlassian.jira.plugin.system.customfieldtypes:datetime", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:datetimerange", "description": ""}}
2020-04-30 13:22:07,519 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:07,523 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability Last Seen", "type": "com.atlassian.jira.plugin.system.customfieldtypes:datetime", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:datetimerange", "description": ""}}
2020-04-30 13:22:07,646 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:07,646 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability Last Fixed", "type": "com.atlassian.jira.plugin.system.customfieldtypes:datetime", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:datetimerange", "description": ""}}
2020-04-30 13:22:07,812 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:07,816 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability State", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:08,102 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:08,105 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability Port", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:08,309 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:08,310 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability Protocol", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:08,757 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:08,759 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability Repository ID", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:09,031 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:09,032 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Vulnerability Repository Name", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:09,171 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:09,174 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/field", "params": {}, "body": {"name": "Tenable VPR Score", "type": "com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield", "searcherKey": "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", "description": ""}}
2020-04-30 13:22:09,330 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/field HTTP/1.1" 201 None
2020-04-30 13:22:09,430 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/issuetype HTTP/1.1" 200 None
2020-04-30 13:22:09,434 tenable_jira.jira.Jira DEBUG {"method": "GET", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/screens", "params": {"startAt": 0, "maxResults": 100}, "body": {}}
2020-04-30 13:22:09,520 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens?startAt=0&maxResults=100 HTTP/1.1" 200 None
2020-04-30 13:22:09,523 tenable_jira.transform.Tio2Jira INFO Using JIRA Screens []
2020-04-30 13:22:09,524 tenable.sc.TenableSC DEBUG {"method": "GET", "url": "https://<TENABLE_SC_HOST>:443/rest/query/815?fields=filters", "params": {}, "body": {}}
2020-04-30 13:22:10,612 urllib3.connectionpool DEBUG https://<TENABLE_SC_HOST>:443 "GET /rest/query/815?fields=filters HTTP/1.1" 200 180
2020-04-30 13:22:10,614 tenable.sc.TenableSC DEBUG {"method": "POST", "url": "https://<TENABLE_SC_HOST>:443/rest/analysis", "params": {}, "body": {"type": "vuln", "sourceType": "cumulative", "query": {"tool": "vulndetails", "type": "vuln", "filters": [{"filterName": "lastSeen", "operator": "=", "value": "0-1588245729"}], "startOffset": 0, "endOffset": 1000}}}
2020-04-30 13:22:25,090 urllib3.connectionpool DEBUG https://<TENABLE_SC_HOST>:443 "POST /rest/analysis HTTP/1.1" 200 None
2020-04-30 13:22:26,945 tenable_jira.transform.Tio2Jira DEBUG Label Detected.  Config={'jira_field': 'Device IPv4 Addresses', 'type': 'labels', 'searcher': 'labelsearcher', 'issue_type': ['Sub-task'], 'tio_field': 'asset.ipv4', 'tsc_field': 'ip', 'jira_id': 'customfield_10094'} value=192.168.100.1
2020-04-30 13:22:26,945 tenable_jira.transform.Tio2Jira DEBUG Label Detected.  Config={'jira_field': 'Device Hostname', 'type': 'labels', 'searcher': 'labelsearcher', 'issue_type': ['Sub-task'], 'tio_field': 'asset.hostname', 'tsc_field': 'dnsName', 'jira_id': 'customfield_10096'} value=gateway
2020-04-30 13:22:26,965 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/search", "params": {}, "body": {"jql": "project = \"VULN\" and issuetype = \"Task\" and status not in (Closed, Done, Resolved) and \"Tenable Plugin ID\" ~ \"10180\""}}
2020-04-30 13:22:27,200 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/search HTTP/1.1" 200 None
2020-04-30 13:22:27,204 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/issue", "params": {"update_history": false}, "body": {"fields": {"project": {"key": "VULN"}, "issuetype": {"id": 10002}, "customfield_10088": "10180", "customfield_10089": "Port scanners", "customfield_10090": "Ping the remote host", "customfield_10091": "Info", "summary": "[10180] Ping the remote host", "description": {"version": 1, "type": "doc", "content": [{"type": "heading", "attrs": {"level": 1}, "content": [{"type": "text", "text": "Description"}]}, {"type": "paragraph", "content": [{"type": "text", "text": "Nessus was able to determine if the remote host is alive using one or more of the following ping types :\n\n  - An ARP ping, provided the host is on the local subnet     and Nessus is running over Ethernet.\n\n  - An ICMP ping.\n\n  - A TCP ping, in which the plugin sends to the remote host     a packet with the flag SYN, and the host will reply with     a RST or a SYN/ACK.\n\n  - A UDP ping (e.g., DNS, RPC, and NTP)."}]}, {"type": "heading", "attrs": {"level": 1}, "content": [{"type": "text", "text": "Solution"}]}, {"type": "paragraph", "content": [{"type": "text", "text": ""}]}]}}}}
2020-04-30 13:22:27,385 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/issue?update_history=False HTTP/1.1" 400 None
2020-04-30 13:22:27,388 restfly.errors.BadRequestError ERROR [400: POST] https://<JIRA_CLOUD_HOST>/rest/api/3/issue?update_history=False body=b'{"errorMessages":[],"errors":{"customfield_10090":"Field \'customfield_10090\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_10091":"Field \'customfield_10091\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_10088":"Field \'customfield_10088\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_10089":"Field \'customfield_10089\' cannot be set. It is not on the appropriate screen, or unknown."}}'
2020-04-30 13:22:27,388 root ERROR Caught the following Exception
Traceback (most recent call last):
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\cli.py", line 132, in cli
    ingest.ingest(observed_since)
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\transform.py", line 483, in ingest
    self.create_issues(vulns)
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\transform.py", line 416, in create_issues
    self._process_open_vuln(v, fid)
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\transform.py", line 342, in _process_open_vuln
    i = self._jira.issues.upsert(fields=issue, jql=' and '.join(jql))
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\jira\issues.py", line 48, in upsert
    issue = self.create(**kwargs)
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\jira\issues.py", line 18, in create
    return self._api.post('issue',
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\restfly\session.py", line 500, in post
    return self._request('POST', path, **kwargs)
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\restfly\session.py", line 447, in _request
    raise err(resp, retries=retries, func=self._error_func)
restfly.errors.BadRequestError: [400: POST] https://<JIRA_CLOUD_HOST>/rest/api/3/issue?update_history=False body=b'{"errorMessages":[],"errors":{"customfield_10090":"Field \'customfield_10090\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_10091":"Field \'customfield_10091\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_10088":"Field \'customfield_10088\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_10089":"Field \'customfield_10089\' cannot be set. It is not on the appropriate screen, or unknown."}}'

Available IssueTypes

SteveMcGrath commented 4 years ago

Looks like the next issue is the screen IDs aren't being auto-selected. Refer to this issue comment for details on how to correct.

https://github.com/tenable/integration-jira-cloud/issues/23#issuecomment-604631753

Eonandia commented 4 years ago

Okay... so now this is the debug file:

2020-04-30 16:15:09,094 urllib3.connectionpool DEBUG Resetting dropped connection: <JIRA_CLOUD_HOST>
2020-04-30 16:15:09,313 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/issuetype HTTP/1.1" 200 None
2020-04-30 16:15:43,977 root INFO Tenable2JiraCloud Version 1.1.5
2020-04-30 16:15:43,977 root INFO Using configuration file config.yaml
2020-04-30 16:15:43,978 root INFO Running on Python 3.8.1 Windows/AMD64
2020-04-30 16:15:43,978 tenable.sc.TenableSC DEBUG {"method": "GET", "url": "https://<TENABLE_SC_HOST>:443/rest/system", "params": {}, "body": {}}
2020-04-30 16:15:43,982 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): <TENABLE_SC_HOST>:443
2020-04-30 16:15:44,562 urllib3.connectionpool DEBUG https://<TENABLE_SC_HOST>:443 "GET /rest/system HTTP/1.1" 200 None
2020-04-30 16:15:44,600 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): <JIRA_CLOUD_HOST>:443
2020-04-30 16:15:44,826 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/project/VULN HTTP/1.1" 200 None
2020-04-30 16:15:45,014 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/field HTTP/1.1" 200 None
2020-04-30 16:15:45,182 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/issuetype HTTP/1.1" 200 None
2020-04-30 16:15:45,183 tenable_jira.transform.Tio2Jira INFO Using JIRA Screens [10053, 10054]
2020-04-30 16:15:45,283 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens/10053/tabs HTTP/1.1" 200 None
2020-04-30 16:15:45,393 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens/10053/tabs/10066/fields HTTP/1.1" 200 None
2020-04-30 16:15:45,396 tenable_jira.transform.Tio2Jira INFO CVEs already exists in 10053:10066
2020-04-30 16:15:45,396 tenable_jira.transform.Tio2Jira INFO Tenable VPR Score already exists in 10053:10066
2020-04-30 16:15:45,396 tenable_jira.transform.Tio2Jira INFO CVSSv2 Base Score already exists in 10053:10066
2020-04-30 16:15:45,397 tenable_jira.transform.Tio2Jira INFO CVSSv2 Temporal Score already exists in 10053:10066
2020-04-30 16:15:45,397 tenable_jira.transform.Tio2Jira INFO CVSSv3 Base Score already exists in 10053:10066
2020-04-30 16:15:45,397 tenable_jira.transform.Tio2Jira INFO CVSSv3 Temporal Score already exists in 10053:10066
2020-04-30 16:15:45,397 tenable_jira.transform.Tio2Jira INFO Tenable Plugin ID already exists in 10053:10066
2020-04-30 16:15:45,397 tenable_jira.transform.Tio2Jira INFO Tenable Plugin Family already exists in 10053:10066
2020-04-30 16:15:45,397 tenable_jira.transform.Tio2Jira INFO Tenable Plugin Name already exists in 10053:10066
2020-04-30 16:15:45,397 tenable_jira.transform.Tio2Jira INFO Vulnerability Severity already exists in 10053:10066
2020-04-30 16:15:45,397 tenable_jira.transform.Tio2Jira INFO Vulnerability First Seen already exists in 10053:10066
2020-04-30 16:15:45,397 tenable_jira.transform.Tio2Jira INFO Vulnerability Last Seen already exists in 10053:10066
2020-04-30 16:15:45,398 tenable_jira.transform.Tio2Jira INFO Vulnerability Last Fixed already exists in 10053:10066
2020-04-30 16:15:45,398 tenable_jira.transform.Tio2Jira INFO Vulnerability State already exists in 10053:10066
2020-04-30 16:15:45,398 tenable_jira.transform.Tio2Jira INFO Vulnerability Port already exists in 10053:10066
2020-04-30 16:15:45,398 tenable_jira.transform.Tio2Jira INFO Vulnerability Protocol already exists in 10053:10066
2020-04-30 16:15:45,500 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens/10053/tabs/10067/fields HTTP/1.1" 200 None
2020-04-30 16:15:45,501 tenable_jira.transform.Tio2Jira INFO Tenable Asset UUID already exists in 10053:10067
2020-04-30 16:15:45,501 tenable_jira.transform.Tio2Jira INFO Tenable Platform already exists in 10053:10067
2020-04-30 16:15:45,501 tenable_jira.transform.Tio2Jira INFO Device Hostname already exists in 10053:10067
2020-04-30 16:15:45,501 tenable_jira.transform.Tio2Jira INFO Device NetBIOS Name already exists in 10053:10067
2020-04-30 16:15:45,501 tenable_jira.transform.Tio2Jira INFO Device DNS Name already exists in 10053:10067
2020-04-30 16:15:45,501 tenable_jira.transform.Tio2Jira INFO Device IPv4 Addresses already exists in 10053:10067
2020-04-30 16:15:45,501 tenable_jira.transform.Tio2Jira INFO Device IPv6 Addresses already exists in 10053:10067
2020-04-30 16:15:45,501 tenable_jira.transform.Tio2Jira INFO Device MAC Addresses already exists in 10053:10067
2020-04-30 16:15:45,502 tenable_jira.transform.Tio2Jira INFO Device Network ID already exists in 10053:10067
2020-04-30 16:15:45,502 tenable_jira.transform.Tio2Jira INFO Vulnerability Repository ID already exists in 10053:10067
2020-04-30 16:15:45,502 tenable_jira.transform.Tio2Jira INFO Vulnerability Repository Name already exists in 10053:10067
2020-04-30 16:15:45,590 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens/10054/tabs HTTP/1.1" 200 None
2020-04-30 16:15:45,673 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens/10054/tabs/10068/fields HTTP/1.1" 200 None
2020-04-30 16:15:45,675 tenable_jira.transform.Tio2Jira INFO CVEs already exists in 10054:10068
2020-04-30 16:15:45,675 tenable_jira.transform.Tio2Jira INFO Tenable VPR Score already exists in 10054:10068
2020-04-30 16:15:45,675 tenable_jira.transform.Tio2Jira INFO CVSSv2 Base Score already exists in 10054:10068
2020-04-30 16:15:45,675 tenable_jira.transform.Tio2Jira INFO CVSSv2 Temporal Score already exists in 10054:10068
2020-04-30 16:15:45,675 tenable_jira.transform.Tio2Jira INFO CVSSv3 Base Score already exists in 10054:10068
2020-04-30 16:15:45,676 tenable_jira.transform.Tio2Jira INFO CVSSv3 Temporal Score already exists in 10054:10068
2020-04-30 16:15:45,676 tenable_jira.transform.Tio2Jira INFO Tenable Plugin ID already exists in 10054:10068
2020-04-30 16:15:45,676 tenable_jira.transform.Tio2Jira INFO Tenable Plugin Family already exists in 10054:10068
2020-04-30 16:15:45,676 tenable_jira.transform.Tio2Jira INFO Tenable Plugin Name already exists in 10054:10068
2020-04-30 16:15:45,676 tenable_jira.transform.Tio2Jira INFO Vulnerability Severity already exists in 10054:10068
2020-04-30 16:15:45,676 tenable_jira.transform.Tio2Jira INFO Vulnerability First Seen already exists in 10054:10068
2020-04-30 16:15:45,676 tenable_jira.transform.Tio2Jira INFO Vulnerability Last Seen already exists in 10054:10068
2020-04-30 16:15:45,676 tenable_jira.transform.Tio2Jira INFO Vulnerability Last Fixed already exists in 10054:10068
2020-04-30 16:15:45,676 tenable_jira.transform.Tio2Jira INFO Vulnerability State already exists in 10054:10068
2020-04-30 16:15:45,676 tenable_jira.transform.Tio2Jira INFO Vulnerability Port already exists in 10054:10068
2020-04-30 16:15:45,677 tenable_jira.transform.Tio2Jira INFO Vulnerability Protocol already exists in 10054:10068
2020-04-30 16:15:45,774 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens/10054/tabs/10069/fields HTTP/1.1" 200 None
2020-04-30 16:15:45,777 tenable_jira.transform.Tio2Jira INFO Tenable Asset UUID already exists in 10054:10069
2020-04-30 16:15:45,778 tenable_jira.transform.Tio2Jira INFO Tenable Platform already exists in 10054:10069
2020-04-30 16:15:45,778 tenable_jira.transform.Tio2Jira INFO Device Hostname already exists in 10054:10069
2020-04-30 16:15:45,778 tenable_jira.transform.Tio2Jira INFO Device NetBIOS Name already exists in 10054:10069
2020-04-30 16:15:45,779 tenable_jira.transform.Tio2Jira INFO Device DNS Name already exists in 10054:10069
2020-04-30 16:15:45,779 tenable_jira.transform.Tio2Jira INFO Device IPv4 Addresses already exists in 10054:10069
2020-04-30 16:15:45,779 tenable_jira.transform.Tio2Jira INFO Device IPv6 Addresses already exists in 10054:10069
2020-04-30 16:15:45,780 tenable_jira.transform.Tio2Jira INFO Device MAC Addresses already exists in 10054:10069
2020-04-30 16:15:45,780 tenable_jira.transform.Tio2Jira INFO Device Network ID already exists in 10054:10069
2020-04-30 16:15:45,780 tenable_jira.transform.Tio2Jira INFO Vulnerability Repository ID already exists in 10054:10069
2020-04-30 16:15:45,780 tenable_jira.transform.Tio2Jira INFO Vulnerability Repository Name already exists in 10054:10069
2020-04-30 16:15:45,781 tenable.sc.TenableSC DEBUG {"method": "GET", "url": "https://<TENABLE_SC_HOST>:443/rest/query/815?fields=filters", "params": {}, "body": {}}
2020-04-30 16:15:46,525 urllib3.connectionpool DEBUG https://<TENABLE_SC_HOST>:443 "GET /rest/query/815?fields=filters HTTP/1.1" 200 180
2020-04-30 16:15:46,528 tenable.sc.TenableSC DEBUG {"method": "POST", "url": "https://<TENABLE_SC_HOST>:443/rest/analysis", "params": {}, "body": {"type": "vuln", "sourceType": "cumulative", "query": {"tool": "vulndetails", "type": "vuln", "filters": [{"filterName": "lastSeen", "operator": "=", "value": "0-1588256145"}], "startOffset": 0, "endOffset": 1000}}}
2020-04-30 16:16:00,594 urllib3.connectionpool DEBUG https://<TENABLE_SC_HOST>:443 "POST /rest/analysis HTTP/1.1" 200 None
2020-04-30 16:16:01,988 tenable_jira.transform.Tio2Jira DEBUG Label Detected.  Config={'jira_field': 'Device IPv4 Addresses', 'type': 'labels', 'searcher': 'labelsearcher', 'issue_type': ['Sub-task'], 'tio_field': 'asset.ipv4', 'tsc_field': 'ip', 'jira_id': 'customfield_10094'} value=192.168.100.1
2020-04-30 16:16:01,988 tenable_jira.transform.Tio2Jira DEBUG Label Detected.  Config={'jira_field': 'Device Hostname', 'type': 'labels', 'searcher': 'labelsearcher', 'issue_type': ['Sub-task'], 'tio_field': 'asset.hostname', 'tsc_field': 'dnsName', 'jira_id': 'customfield_10096'} value=gateway
2020-04-30 16:16:02,007 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/search", "params": {}, "body": {"jql": "project = \"VULN\" and issuetype = \"Task\" and status not in (Closed, Done, Resolved) and \"Tenable Plugin ID\" ~ \"10180\""}}
2020-04-30 16:16:02,157 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/search HTTP/1.1" 200 None
2020-04-30 16:16:02,161 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/issue", "params": {"update_history": false}, "body": {"fields": {"project": {"key": "VULN"}, "issuetype": {"id": 10002}, "customfield_10088": "10180", "customfield_10089": "Port scanners", "customfield_10090": "Ping the remote host", "customfield_10091": "Info", "summary": "[10180] Ping the remote host", "description": {"version": 1, "type": "doc", "content": [{"type": "heading", "attrs": {"level": 1}, "content": [{"type": "text", "text": "Description"}]}, {"type": "paragraph", "content": [{"type": "text", "text": "Nessus was able to determine if the remote host is alive using one or more of the following ping types :\n\n  - An ARP ping, provided the host is on the local subnet     and Nessus is running over Ethernet.\n\n  - An ICMP ping.\n\n  - A TCP ping, in which the plugin sends to the remote host     a packet with the flag SYN, and the host will reply with     a RST or a SYN/ACK.\n\n  - A UDP ping (e.g., DNS, RPC, and NTP)."}]}, {"type": "heading", "attrs": {"level": 1}, "content": [{"type": "text", "text": "Solution"}]}, {"type": "paragraph", "content": [{"type": "text", "text": ""}]}]}}}}
2020-04-30 16:16:02,406 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/issue?update_history=False HTTP/1.1" 400 None
2020-04-30 16:16:02,409 restfly.errors.BadRequestError ERROR [400: POST] https://<JIRA_CLOUD_HOST>/rest/api/3/issue?update_history=False body=b'{"errorMessages":["No podemos crear esta incidencia ahora; tal vez introdujiste contenido no compatible en uno o varios campos de la incidencia. Si la situaci\xc3\xb3n persiste, comun\xc3\xadcate con tu administrador, quien podr\xc3\xa1 acceder a informaci\xc3\xb3n m\xc3\xa1s espec\xc3\xadfica en el archivo de registro."],"errors":{}}'
2020-04-30 16:16:02,409 root ERROR Caught the following Exception
Traceback (most recent call last):
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\cli.py", line 132, in cli
    ingest.ingest(observed_since)
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\transform.py", line 483, in ingest
    self.create_issues(vulns)
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\transform.py", line 416, in create_issues
    self._process_open_vuln(v, fid)
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\transform.py", line 342, in _process_open_vuln
    i = self._jira.issues.upsert(fields=issue, jql=' and '.join(jql))
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\jira\issues.py", line 48, in upsert
    issue = self.create(**kwargs)
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\tenable_jira\jira\issues.py", line 18, in create
    return self._api.post('issue',
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\restfly\session.py", line 500, in post
    return self._request('POST', path, **kwargs)
  File "c:\users\eonandia\appdata\local\programs\python\python38-32\lib\site-packages\restfly\session.py", line 447, in _request
    raise err(resp, retries=retries, func=self._error_func)
restfly.errors.BadRequestError: [400: POST] https://<JIRA_CLOUD_HOST>/rest/api/3/issue?update_history=False body=b'{"errorMessages":["No podemos crear esta incidencia ahora; tal vez introdujiste contenido no compatible en uno o varios campos de la incidencia. Si la situaci\xc3\xb3n persiste, comun\xc3\xadcate con tu administrador, quien podr\xc3\xa1 acceder a informaci\xc3\xb3n m\xc3\xa1s espec\xc3\xadfica en el archivo de registro."],"errors":{}}'

Which means:

We can't create this issue for you right now, it could be due to unsupported content you've entered into one or more of the issue fields. If this situation persists, contact your administrator as they'll be able to access more specific information in the log file.

May it have something to do with my jira being Core Free?

SteveMcGrath commented 4 years ago

Possibly. I never tested against Jira Core Free.