tenable / integration-jira-cloud

67 stars 52 forks source link

Custom Field Cannot be set. #37

Closed MichaelTay0 closed 4 years ago

MichaelTay0 commented 4 years ago

I have successfully gotten the integration to create a new board for me... When I run the script with the generated-config.yaml I get the following error (multiple times) "customfield_11627":"Field 'customfield_11627' cannot be set. It is not on the appropriate screen, or unknown."

Do you know the best way to troubleshoot this?

SteveMcGrath commented 4 years ago

Can you please ensure that you are on the latest version (1.1.5) and then run the integration using the --troubleshoot parameter and paste the results?

MichaelTay0 commented 4 years ago

here is what i ran: tenable-jira --troubleshoot OUTPUT:

Traceback (most recent call last): File "./tenable-jira", line 5, in from tenable_jira.cli import cli File "/Users/XXXXXXXX/Library/Python/2.7/lib/python/site-packages/tenable_jira/cli.py", line 182 print(output, file=reportfile) ^ SyntaxError: invalid syntax

SteveMcGrath commented 4 years ago

Please note that, as mentioned in the readme, Python 2 is not supported. Py2 is depricated an no longer supported by the community either.

https://www.python.org/dev/peps/pep-0373/

Please update to a supported version of python (3.6 or later). May I suggest using something like homebrew to install python 3.

https://docs.brew.sh/Homebrew-and-Python

MichaelTay0 commented 4 years ago

Configuration File:

jira:
  address: <REDACTED>
  api_token: <REDACTED>
  api_username: <REDACTED>
project:
  key: TENB
  leadAccountId: <REDACTED>
tenable:
  access_key: <REDACTED>
  secret_key: <REDACTED>

Debug Logs

2020-04-23 11:52:39,739 root INFO Tenable2JiraCloud Version 1.1.5
2020-04-23 11:52:39,739 root INFO Using configuration file config.yaml
2020-04-23 11:52:39,747 root INFO Running on Python 3.7.7 Darwin/x86_64
2020-04-23 11:52:39,753 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): <JIRA_CLOUD_HOST>:443
2020-04-23 11:52:40,339 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/project/TENB HTTP/1.1" 200 None
2020-04-23 11:52:40,808 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/field HTTP/1.1" 200 None
2020-04-23 11:52:41,125 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/issuetype HTTP/1.1" 200 None
2020-04-23 11:52:41,127 tenable_jira.jira.Jira DEBUG {"method": "GET", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/screens", "params": {"startAt": 0, "maxResults": 100}, "body": {}}
2020-04-23 11:52:41,314 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens?startAt=0&maxResults=100 HTTP/1.1" 200 None
2020-04-23 11:52:41,318 tenable_jira.jira.Jira DEBUG {"method": "GET", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/screens", "params": {"startAt": 100, "maxResults": 100}, "body": {}}
2020-04-23 11:52:41,510 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens?startAt=100&maxResults=100 HTTP/1.1" 200 None
2020-04-23 11:52:41,511 tenable_jira.jira.Jira DEBUG {"method": "GET", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/screens", "params": {"startAt": 200, "maxResults": 100}, "body": {}}
2020-04-23 11:52:41,709 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens?startAt=200&maxResults=100 HTTP/1.1" 200 None
2020-04-23 11:52:41,710 tenable_jira.transform.Tio2Jira INFO Using JIRA Screens [11828, 11829]
2020-04-23 11:52:41,887 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens/11828/tabs HTTP/1.1" 200 None
2020-04-23 11:52:42,170 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens/11828/tabs/11932/fields HTTP/1.1" 200 None
2020-04-23 11:52:42,172 tenable_jira.transform.Tio2Jira INFO CVEs already exists in 11828:11932
2020-04-23 11:52:42,172 tenable_jira.transform.Tio2Jira INFO Tenable VPR Score already exists in 11828:11932
2020-04-23 11:52:42,172 tenable_jira.transform.Tio2Jira INFO CVSSv2 Base Score already exists in 11828:11932
2020-04-23 11:52:42,172 tenable_jira.transform.Tio2Jira INFO CVSSv2 Temporal Score already exists in 11828:11932
2020-04-23 11:52:42,172 tenable_jira.transform.Tio2Jira INFO CVSSv3 Base Score already exists in 11828:11932
2020-04-23 11:52:42,172 tenable_jira.transform.Tio2Jira INFO CVSSv3 Temporal Score already exists in 11828:11932
2020-04-23 11:52:42,173 tenable_jira.transform.Tio2Jira INFO Tenable Plugin ID already exists in 11828:11932
2020-04-23 11:52:42,173 tenable_jira.transform.Tio2Jira INFO Tenable Plugin Family already exists in 11828:11932
2020-04-23 11:52:42,173 tenable_jira.transform.Tio2Jira INFO Tenable Plugin Name already exists in 11828:11932
2020-04-23 11:52:42,173 tenable_jira.transform.Tio2Jira INFO Vulnerability Severity already exists in 11828:11932
2020-04-23 11:52:42,173 tenable_jira.transform.Tio2Jira INFO Vulnerability First Seen already exists in 11828:11932
2020-04-23 11:52:42,173 tenable_jira.transform.Tio2Jira INFO Vulnerability Last Seen already exists in 11828:11932
2020-04-23 11:52:42,173 tenable_jira.transform.Tio2Jira INFO Vulnerability Last Fixed already exists in 11828:11932
2020-04-23 11:52:42,173 tenable_jira.transform.Tio2Jira INFO Vulnerability State already exists in 11828:11932
2020-04-23 11:52:42,173 tenable_jira.transform.Tio2Jira INFO Vulnerability Port already exists in 11828:11932
2020-04-23 11:52:42,173 tenable_jira.transform.Tio2Jira INFO Vulnerability Protocol already exists in 11828:11932
2020-04-23 11:52:42,458 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens/11828/tabs/11933/fields HTTP/1.1" 200 None
2020-04-23 11:52:42,459 tenable_jira.transform.Tio2Jira INFO Tenable Asset UUID already exists in 11828:11933
2020-04-23 11:52:42,459 tenable_jira.transform.Tio2Jira INFO Tenable Platform already exists in 11828:11933
2020-04-23 11:52:42,460 tenable_jira.transform.Tio2Jira INFO Device Hostname already exists in 11828:11933
2020-04-23 11:52:42,460 tenable_jira.transform.Tio2Jira INFO Device NetBIOS Name already exists in 11828:11933
2020-04-23 11:52:42,460 tenable_jira.transform.Tio2Jira INFO Device DNS Name already exists in 11828:11933
2020-04-23 11:52:42,460 tenable_jira.transform.Tio2Jira INFO Device IPv4 Addresses already exists in 11828:11933
2020-04-23 11:52:42,460 tenable_jira.transform.Tio2Jira INFO Device IPv6 Addresses already exists in 11828:11933
2020-04-23 11:52:42,460 tenable_jira.transform.Tio2Jira INFO Device MAC Addresses already exists in 11828:11933
2020-04-23 11:52:42,460 tenable_jira.transform.Tio2Jira INFO Device Network ID already exists in 11828:11933
2020-04-23 11:52:42,460 tenable_jira.transform.Tio2Jira INFO Vulnerability Repository ID already exists in 11828:11933
2020-04-23 11:52:42,460 tenable_jira.transform.Tio2Jira INFO Vulnerability Repository Name already exists in 11828:11933
2020-04-23 11:52:42,615 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens/11829/tabs HTTP/1.1" 200 None
2020-04-23 11:52:42,894 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens/11829/tabs/11934/fields HTTP/1.1" 200 None
2020-04-23 11:52:42,895 tenable_jira.transform.Tio2Jira INFO CVEs already exists in 11829:11934
2020-04-23 11:52:42,895 tenable_jira.transform.Tio2Jira INFO Tenable VPR Score already exists in 11829:11934
2020-04-23 11:52:42,895 tenable_jira.transform.Tio2Jira INFO CVSSv2 Base Score already exists in 11829:11934
2020-04-23 11:52:42,896 tenable_jira.transform.Tio2Jira INFO CVSSv2 Temporal Score already exists in 11829:11934
2020-04-23 11:52:42,896 tenable_jira.transform.Tio2Jira INFO CVSSv3 Base Score already exists in 11829:11934
2020-04-23 11:52:42,896 tenable_jira.transform.Tio2Jira INFO CVSSv3 Temporal Score already exists in 11829:11934
2020-04-23 11:52:42,896 tenable_jira.transform.Tio2Jira INFO Tenable Plugin ID already exists in 11829:11934
2020-04-23 11:52:42,896 tenable_jira.transform.Tio2Jira INFO Tenable Plugin Family already exists in 11829:11934
2020-04-23 11:52:42,896 tenable_jira.transform.Tio2Jira INFO Tenable Plugin Name already exists in 11829:11934
2020-04-23 11:52:42,896 tenable_jira.transform.Tio2Jira INFO Vulnerability Severity already exists in 11829:11934
2020-04-23 11:52:42,896 tenable_jira.transform.Tio2Jira INFO Vulnerability First Seen already exists in 11829:11934
2020-04-23 11:52:42,896 tenable_jira.transform.Tio2Jira INFO Vulnerability Last Seen already exists in 11829:11934
2020-04-23 11:52:42,896 tenable_jira.transform.Tio2Jira INFO Vulnerability Last Fixed already exists in 11829:11934
2020-04-23 11:52:42,897 tenable_jira.transform.Tio2Jira INFO Vulnerability State already exists in 11829:11934
2020-04-23 11:52:42,897 tenable_jira.transform.Tio2Jira INFO Vulnerability Port already exists in 11829:11934
2020-04-23 11:52:42,897 tenable_jira.transform.Tio2Jira INFO Vulnerability Protocol already exists in 11829:11934
2020-04-23 11:52:43,175 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/screens/11829/tabs/11935/fields HTTP/1.1" 200 None
2020-04-23 11:52:43,178 tenable_jira.transform.Tio2Jira INFO Tenable Asset UUID already exists in 11829:11935
2020-04-23 11:52:43,178 tenable_jira.transform.Tio2Jira INFO Tenable Platform already exists in 11829:11935
2020-04-23 11:52:43,178 tenable_jira.transform.Tio2Jira INFO Device Hostname already exists in 11829:11935
2020-04-23 11:52:43,179 tenable_jira.transform.Tio2Jira INFO Device NetBIOS Name already exists in 11829:11935
2020-04-23 11:52:43,179 tenable_jira.transform.Tio2Jira INFO Device DNS Name already exists in 11829:11935
2020-04-23 11:52:43,179 tenable_jira.transform.Tio2Jira INFO Device IPv4 Addresses already exists in 11829:11935
2020-04-23 11:52:43,179 tenable_jira.transform.Tio2Jira INFO Device IPv6 Addresses already exists in 11829:11935
2020-04-23 11:52:43,179 tenable_jira.transform.Tio2Jira INFO Device MAC Addresses already exists in 11829:11935
2020-04-23 11:52:43,179 tenable_jira.transform.Tio2Jira INFO Device Network ID already exists in 11829:11935
2020-04-23 11:52:43,179 tenable_jira.transform.Tio2Jira INFO Vulnerability Repository ID already exists in 11829:11935
2020-04-23 11:52:43,179 tenable_jira.transform.Tio2Jira INFO Vulnerability Repository Name already exists in 11829:11935
2020-04-23 11:52:43,180 tenable.io.TenableIO DEBUG {"method": "POST", "url": "https://cloud.tenable.com/vulns/export", "params": {}, "body": {"filters": {"severity": ["high", "critical"]}, "num_assets": "1000"}}
2020-04-23 11:52:43,182 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): cloud.tenable.com:443
2020-04-23 11:52:43,465 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "POST /vulns/export HTTP/1.1" 200 None
2020-04-23 11:52:43,467 tenable.io.TenableIO DEBUG Request-UUID bb2232e2193a62075d54a0b788e741c6 for https://cloud.tenable.com/vulns/export
2020-04-23 11:52:43,467 tenable.io.TenableIO DEBUG Initiated vuln export 429689b9-7c49-45df-9aae-ce0ba3512bd7
2020-04-23 11:52:43,467 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/vulns/export/429689b9-7c49-45df-9aae-ce0ba3512bd7/status", "params": {}, "body": {}}
2020-04-23 11:52:43,590 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /vulns/export/429689b9-7c49-45df-9aae-ce0ba3512bd7/status HTTP/1.1" 200 None
2020-04-23 11:52:43,591 tenable.io.TenableIO DEBUG Request-UUID 391b2ecfcee13a39765c00dcd297d5c5 for https://cloud.tenable.com/vulns/export/429689b9-7c49-45df-9aae-ce0ba3512bd7/status
2020-04-23 11:52:45,597 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/vulns/export/429689b9-7c49-45df-9aae-ce0ba3512bd7/status", "params": {}, "body": {}}
2020-04-23 11:52:45,697 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /vulns/export/429689b9-7c49-45df-9aae-ce0ba3512bd7/status HTTP/1.1" 200 None
2020-04-23 11:52:45,698 tenable.io.TenableIO DEBUG Request-UUID e600eda62f36233e7fb6b63a31855878 for https://cloud.tenable.com/vulns/export/429689b9-7c49-45df-9aae-ce0ba3512bd7/status
2020-04-23 11:52:45,699 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/vulns/export/429689b9-7c49-45df-9aae-ce0ba3512bd7/chunks/1", "params": {}, "body": {}}
2020-04-23 11:52:46,007 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /vulns/export/429689b9-7c49-45df-9aae-ce0ba3512bd7/chunks/1 HTTP/1.1" 200 465078
2020-04-23 11:52:46,307 tenable.io.TenableIO DEBUG Request-UUID 6b48d332d490564e1be52f2af296e82a for https://cloud.tenable.com/vulns/export/429689b9-7c49-45df-9aae-ce0ba3512bd7/chunks/1
2020-04-23 11:52:46,312 tenable_jira.transform.Tio2Jira DEBUG Label Detected.  Config={'jira_field': 'CVEs', 'type': 'labels', 'searcher': 'labelsearcher', 'issue_type': ['Task'], 'tio_field': 'plugin.cve', 'tsc_field': 'cve', 'jira_id': 'customfield_11622'} value=['CVE-2018-1160']
2020-04-23 11:52:46,312 tenable_jira.transform.Tio2Jira DEBUG Label Detected.  Config={'jira_field': 'Tenable Asset UUID', 'type': 'labels', 'searcher': 'labelsearcher', 'issue_type': ['Sub-task'], 'tio_field': 'asset.uuid', 'jira_id': 'customfield_11631'} value=9247b030-442f-4d7c-a535-7d441fb7c487
2020-04-23 11:52:46,312 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_11633'} value=172.22.56.70
2020-04-23 11:52:46,312 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_11635'} value=172.22.56.70
2020-04-23 11:52:46,314 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/search", "params": {}, "body": {"jql": "project = \"TENB\" and issuetype = \"Task\" and status not in (Closed, Done, Resolved) and \"Tenable Plugin ID\" ~ \"119780\""}}
2020-04-23 11:52:46,727 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/search HTTP/1.1" 200 None
2020-04-23 11:52:46,729 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/issue", "params": {"update_history": false}, "body": {"fields": {"project": {"key": "TENB"}, "issuetype": {"id": "10002"}, "customfield_11622": ["CVE-2018-1160"], "customfield_11623": "10.0", "customfield_11624": "7.8", "customfield_11625": "9.8", "customfield_11626": "8.8", "customfield_11627": "119780", "customfield_11628": "Gain a shell remotely", "customfield_11629": "Netatalk OpenSession Remote Code Execution", "customfield_11630": "Critical", "summary": "[119780] Netatalk OpenSession Remote Code Execution", "description": {"version": 1, "type": "doc", "content": [{"type": "heading", "attrs": {"level": 1}, "content": [{"type": "text", "text": "Description"}]}, {"type": "paragraph", "content": [{"type": "text", "text": "The Apple Filing Protocol (AFP) server running on the remote host is\naffected by a remote code execution vulnerability due to a buffer\noverflow condition when handling an OpenSession request. An\nunauthenticated, remote attacker can exploit this issue, via a\nspecially crafted message, to execute arbitrary code."}]}, {"type": "heading", "attrs": {"level": 1}, "content": [{"type": "text", "text": "Solution"}]}, {"type": "paragraph", "content": [{"type": "text", "text": "Upgrade to Netatalk 3.1.12 or later."}]}]}}}}
2020-04-23 11:52:47,180 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/issue?update_history=False HTTP/1.1" 400 None
2020-04-23 11:52:47,181 restfly.errors.BadRequestError ERROR [400: POST] https://<JIRA_CLOUD_HOST>/rest/api/3/issue?update_history=False body=b'{"errorMessages":[],"errors":{"customfield_11623":"Field \'customfield_11623\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11622":"Field \'customfield_11622\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11625":"Field \'customfield_11625\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11624":"Field \'customfield_11624\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11627":"Field \'customfield_11627\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11626":"Field \'customfield_11626\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11629":"Field \'customfield_11629\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11628":"Field \'customfield_11628\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11630":"Field \'customfield_11630\' cannot be set. It is not on the appropriate screen, or unknown."}}'
2020-04-23 11:52:47,181 root ERROR Caught the following Exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/tenable_jira/cli.py", line 132, in cli
    ingest.ingest(observed_since)
  File "/usr/local/lib/python3.7/site-packages/tenable_jira/transform.py", line 460, in ingest
    self.create_issues(vulns)
  File "/usr/local/lib/python3.7/site-packages/tenable_jira/transform.py", line 416, in create_issues
    self._process_open_vuln(v, fid)
  File "/usr/local/lib/python3.7/site-packages/tenable_jira/transform.py", line 342, in _process_open_vuln
    i = self._jira.issues.upsert(fields=issue, jql=' and '.join(jql))
  File "/usr/local/lib/python3.7/site-packages/tenable_jira/jira/issues.py", line 48, in upsert
    issue = self.create(**kwargs)
  File "/usr/local/lib/python3.7/site-packages/tenable_jira/jira/issues.py", line 20, in create
    json=kwargs
  File "/usr/local/lib/python3.7/site-packages/restfly/session.py", line 500, in post
    return self._request('POST', path, **kwargs)
  File "/usr/local/lib/python3.7/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_11623":"Field \'customfield_11623\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11622":"Field \'customfield_11622\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11625":"Field \'customfield_11625\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11624":"Field \'customfield_11624\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11627":"Field \'customfield_11627\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11626":"Field \'customfield_11626\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11629":"Field \'customfield_11629\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11628":"Field \'customfield_11628\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11630":"Field \'customfield_11630\' cannot be set. It is not on the appropriate screen, or unknown."}}'

Available IssueTypes

10002: Task
10003: Sub-task
10605: Task
10675: Task
10596: Task
10602: Task
10515: Task
10526: Task
10926: Task
10761: Task
10588: Task
10562: Task
10593: Task
10620: Task
10732: Task
10729: Subtask
10797: Task
10677: Subtask
10678: Task
10680: Subtask
10723: Task
10837: Task
10642: Task
10645: Subtask
10688: Subtask
10695: Task
10651: Task
10653: Subtask
10656: Task
10659: Subtask
10686: Task
10691: Subtask
10692: Task
10694: Subtask
10670: Task
10673: Subtask
10697: Subtask
10726: Subtask
10718: Subtask
10734: Subtask
10727: Task
10763: Subtask
10923: Task
10928: Subtask
10743: Task
10710: Subtask
10746: Subtask
10754: Subtask
10781: Subtask
10511: Task
10773: Subtask
10774: Task
10776: Subtask
10809: Subtask
10799: Subtask
10689: Task
10817: Task
10819: Subtask
10786: Subtask
10790: Subtask
10793: Subtask
10796: Subtask
10791: Task
10815: Subtask
10788: Task
10877: Task
10925: Subtask
10825: Task
10827: Subtask
10828: Task
10830: Subtask
10840: Subtask
10858: Task
10856: Subtask
10862: Task
10864: Subtask
10861: Subtask
10833: Task
10835: Subtask
10854: Task
10879: Subtask
10883: Task
10885: Subtask
10590: Task
10716: Task
10914: Task
10902: Task
10904: Subtask
10905: Task
10907: Subtask
10910: Subtask
10916: Subtask
10911: Task
10913: Subtask
10908: Task
10917: Task
10919: Subtask
10931: Subtask
10565: Task
10764: Task
10766: Subtask
10959: Task
10943: Task
10945: Subtask
10978: Task
10972: Subtask
10962: Subtask
10964: Task
10967: Subtask
10969: Task
10974: Task
10977: Subtask
10946: Task
10948: Subtask
10980: Subtask
10982: Task
10985: Subtask
10987: Task
10990: Subtask
10992: Task
10995: Subtask
10999: Task
11001: Subtask
11013: Subtask
11011: Task
11014: Task
11016: Subtask
/-------------------------------NOTICE-----------------------------------\ The output above is helpful for us to troubleshoot exactly what is happening within the code and offer a diagnosis for how to correct. Please note that while some basic redaction has already been performed that we ask you to review the information you're about to send and ensure that nothing deemed sensitive is transmitted.
-- Copy of output saved to "issue_debug.md"

------------------------------------------------------------------------/

MichaelTay0 commented 4 years ago

when I run --troubleshoot with generated_config.yaml argument

Debug Logs

2020-04-23 12:00:09,297 root INFO Tenable2JiraCloud Version 1.1.5
2020-04-23 12:00:09,297 root INFO Using configuration file generated_config.yaml
2020-04-23 12:00:09,306 root INFO Running on Python 3.7.7 Darwin/x86_64
2020-04-23 12:00:09,312 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): <JIRA_CLOUD_HOST>:443
2020-04-23 12:00:09,860 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/project/TENB HTTP/1.1" 200 None
2020-04-23 12:00:10,884 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/field HTTP/1.1" 200 None
2020-04-23 12:00:11,245 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "GET /rest/api/3/issuetype HTTP/1.1" 200 None
2020-04-23 12:00:11,321 tenable.io.TenableIO DEBUG {"method": "POST", "url": "https://cloud.tenable.com/vulns/export", "params": {}, "body": {"filters": {"severity": ["high", "critical"]}, "num_assets": "1000"}}
2020-04-23 12:00:11,324 urllib3.connectionpool DEBUG Starting new HTTPS connection (1): cloud.tenable.com:443
2020-04-23 12:00:12,233 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "POST /vulns/export HTTP/1.1" 200 None
2020-04-23 12:00:12,235 tenable.io.TenableIO DEBUG Request-UUID d4a964581d732bdd3ab0b4c79a02bb23 for https://cloud.tenable.com/vulns/export
2020-04-23 12:00:12,235 tenable.io.TenableIO DEBUG Initiated vuln export cef3042d-3598-4d02-9660-ca9e3034c09e
2020-04-23 12:00:12,235 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status", "params": {}, "body": {}}
2020-04-23 12:00:12,484 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status HTTP/1.1" 200 None
2020-04-23 12:00:12,485 tenable.io.TenableIO DEBUG Request-UUID 84a91e533782f2dd4482dbbba4248dbb for https://cloud.tenable.com/vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status
2020-04-23 12:00:14,490 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status", "params": {}, "body": {}}
2020-04-23 12:00:14,612 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status HTTP/1.1" 200 None
2020-04-23 12:00:14,614 tenable.io.TenableIO DEBUG Request-UUID 34edc6e474376726559fa8e8022b5986 for https://cloud.tenable.com/vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status
2020-04-23 12:00:17,614 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status", "params": {}, "body": {}}
2020-04-23 12:00:17,769 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status HTTP/1.1" 200 None
2020-04-23 12:00:17,771 tenable.io.TenableIO DEBUG Request-UUID 6efbb38cdd86602a4a825853f0dea997 for https://cloud.tenable.com/vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status
2020-04-23 12:00:21,776 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status", "params": {}, "body": {}}
2020-04-23 12:00:21,890 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status HTTP/1.1" 200 None
2020-04-23 12:00:21,891 tenable.io.TenableIO DEBUG Request-UUID bf235c7db37951910adc0a523950b72e for https://cloud.tenable.com/vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status
2020-04-23 12:00:26,892 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status", "params": {}, "body": {}}
2020-04-23 12:00:27,232 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status HTTP/1.1" 200 None
2020-04-23 12:00:27,233 tenable.io.TenableIO DEBUG Request-UUID 2d7647877b739f5e4c00f237b9b5569f for https://cloud.tenable.com/vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status
2020-04-23 12:00:33,234 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status", "params": {}, "body": {}}
2020-04-23 12:00:33,348 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status HTTP/1.1" 200 None
2020-04-23 12:00:33,349 tenable.io.TenableIO DEBUG Request-UUID 7077043a0946db5d51109442d422e9a9 for https://cloud.tenable.com/vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/status
2020-04-23 12:00:33,349 tenable.io.TenableIO DEBUG {"method": "GET", "url": "https://cloud.tenable.com/vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/chunks/2", "params": {}, "body": {}}
2020-04-23 12:00:33,604 urllib3.connectionpool DEBUG https://cloud.tenable.com:443 "GET /vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/chunks/2 HTTP/1.1" 200 117984
2020-04-23 12:00:33,901 tenable.io.TenableIO DEBUG Request-UUID fdd77e45beba8f067c8b69366f3c640b for https://cloud.tenable.com/vulns/export/cef3042d-3598-4d02-9660-ca9e3034c09e/chunks/2
2020-04-23 12:00:33,903 tenable_jira.transform.Tio2Jira DEBUG Label Detected.  Config={'issue_type': ['Sub-task'], 'jira_field': 'Tenable Asset UUID', 'jira_id': 'customfield_11631', 'searcher': 'labelsearcher', 'tio_field': 'asset.uuid', 'type': 'labels'} value=f01ca840-9580-466d-a9e2-27cabbd00eba
2020-04-23 12:00:33,904 tenable_jira.transform.Tio2Jira DEBUG Label Detected.  Config={'issue_type': ['Sub-task'], 'jira_field': 'Device IPv4 Addresses', 'jira_id': 'customfield_11633', 'searcher': 'labelsearcher', 'tio_field': 'asset.ipv4', 'tsc_field': 'ip', 'type': 'labels'} value=172.22.18.32
2020-04-23 12:00:33,904 tenable_jira.transform.Tio2Jira DEBUG Label Detected.  Config={'issue_type': ['Sub-task'], 'jira_field': 'Device Hostname', 'jira_id': 'customfield_11635', 'searcher': 'labelsearcher', 'tio_field': 'asset.hostname', 'tsc_field': 'dnsName', 'type': 'labels'} value=172.22.18.32
2020-04-23 12:00:33,908 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/search", "params": {}, "body": {"jql": "project = \"TENB\" and issuetype = \"Task\" and status not in (Closed, Done, Resolved) and \"Tenable Plugin ID\" ~ \"58987\""}}
2020-04-23 12:00:34,466 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/search HTTP/1.1" 200 None
2020-04-23 12:00:34,467 tenable_jira.jira.Jira DEBUG {"method": "POST", "url": "https://<JIRA_CLOUD_HOST>/rest/api/3/issue", "params": {"update_history": false}, "body": {"fields": {"project": {"key": "TENB"}, "issuetype": {"id": "10002"}, "customfield_11623": "10.0", "customfield_11625": "10.0", "customfield_11627": "58987", "customfield_11628": "CGI abuses", "customfield_11629": "PHP Unsupported Version Detection", "customfield_11630": "Critical", "summary": "[58987] PHP Unsupported Version Detection", "description": {"version": 1, "type": "doc", "content": [{"type": "heading", "attrs": {"level": 1}, "content": [{"type": "text", "text": "Description"}]}, {"type": "paragraph", "content": [{"type": "text", "text": "According to its version, the installation of PHP on the remote host\nis no longer supported.\n\nLack of support implies that no new security patches for the product\nwill be released by the vendor. As a result, it is likely to contain\nsecurity vulnerabilities."}]}, {"type": "heading", "attrs": {"level": 1}, "content": [{"type": "text", "text": "Solution"}]}, {"type": "paragraph", "content": [{"type": "text", "text": "Upgrade to a version of PHP that is currently supported."}]}]}}}}
2020-04-23 12:00:34,927 urllib3.connectionpool DEBUG https://<JIRA_CLOUD_HOST>:443 "POST /rest/api/3/issue?update_history=False HTTP/1.1" 400 None
2020-04-23 12:00:34,932 restfly.errors.BadRequestError ERROR [400: POST] https://<JIRA_CLOUD_HOST>/rest/api/3/issue?update_history=False body=b'{"errorMessages":[],"errors":{"customfield_11623":"Field \'customfield_11623\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11625":"Field \'customfield_11625\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11627":"Field \'customfield_11627\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11629":"Field \'customfield_11629\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11628":"Field \'customfield_11628\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11630":"Field \'customfield_11630\' cannot be set. It is not on the appropriate screen, or unknown."}}'
2020-04-23 12:00:34,932 root ERROR Caught the following Exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/tenable_jira/cli.py", line 132, in cli
    ingest.ingest(observed_since)
  File "/usr/local/lib/python3.7/site-packages/tenable_jira/transform.py", line 460, in ingest
    self.create_issues(vulns)
  File "/usr/local/lib/python3.7/site-packages/tenable_jira/transform.py", line 416, in create_issues
    self._process_open_vuln(v, fid)
  File "/usr/local/lib/python3.7/site-packages/tenable_jira/transform.py", line 342, in _process_open_vuln
    i = self._jira.issues.upsert(fields=issue, jql=' and '.join(jql))
  File "/usr/local/lib/python3.7/site-packages/tenable_jira/jira/issues.py", line 48, in upsert
    issue = self.create(**kwargs)
  File "/usr/local/lib/python3.7/site-packages/tenable_jira/jira/issues.py", line 20, in create
    json=kwargs
  File "/usr/local/lib/python3.7/site-packages/restfly/session.py", line 500, in post
    return self._request('POST', path, **kwargs)
  File "/usr/local/lib/python3.7/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_11623":"Field \'customfield_11623\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11625":"Field \'customfield_11625\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11627":"Field \'customfield_11627\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11629":"Field \'customfield_11629\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11628":"Field \'customfield_11628\' cannot be set. It is not on the appropriate screen, or unknown.","customfield_11630":"Field \'customfield_11630\' cannot be set. It is not on the appropriate screen, or unknown."}}'
SteveMcGrath commented 4 years ago

Well this looks like a classic issue of too many issuetypes of the same name. The integration doesn't know which one is the right one, and just selects the first one available. It's supposed to use the built-in issuetypes. Annoyingly, however there isn't any rhyme or reason to the ordering of the IDs.

You're going to have to experiment with the Task and Sub-Task issuetype IDs.

All I can tell you is that on my mostly pristine Jira cloud instance, the Ids are 10101 && 10102 and forcing them would look like below. You're defaulting to what I would assume to be the correct IDs (10002 & 10003), however clearly that isn't the case here.

issue_types:
- jira_id: 10101
  name: Task
  search:
  - Tenable Plugin ID
  type: standard
- jira_id: 10102
  name: Sub-task
  search:
  - Tenable Plugin ID
  - Tenable Asset UUID
  - Device IPv4
  - Device IPv6
  - Vulnerability Port
  - Vulnerability Protocol
  type: subtask
MichaelTay0 commented 4 years ago

Thank you for your help. Got it working. I noticed on the first run that accepted rules are being populated. is there a way to skip those that have been accepted on import?

SteveMcGrath commented 4 years ago

It will only populate if they need to be. It checks to see that the needed fields exist, are mapped to the screens, etc.

MichaelTay0 commented 4 years ago

confused on "if they need to be".

Example: our org has gone through the risk acceptance process for a number of findings and created multiple recast rules to "ACCEPT" certain plugins for certain "TARGETS" within the tenable.io platform. These are no longer being reported

But with this integration, it looks like those that have been "Accepted" still generate tasks/subtasks

SteveMcGrath commented 4 years ago

My apologies, I misread. To ignore accepted risks, you will want to take a look at the following:

https://github.com/tenable/integration-jira-cloud/issues/8

Please note that you may need to manually close the issues that are being ignored, as they technically haven't changed state, and therefore wouldn't show up as a fixed state.

MichaelTay0 commented 4 years ago

Thank you for this. I know that I am swaying away from the original issue, which you resolved. but how can I get the board to pull the most recent data?

Also when I rerun the integration with the updated config, will the old tasks still be present?

SteveMcGrath commented 4 years ago

They will, as they are now in a limbo state. The integration would have to be updated to accommodate changing the state of a recasted risk within Jira automatically. If you would like to have automated closing of accepted risks, please file that under a new issue so it can be properly tracked.