Skip to content

Commit 90d2e6c

Browse files
authored
feat(tenable-vuln-management): migrate connector to the catalog (#5215)
1 parent e14eb05 commit 90d2e6c

18 files changed

Lines changed: 684 additions & 274 deletions
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Connector Configurations
2+
3+
Below is an exhaustive enumeration of all configurable parameters available, each accompanied by detailed explanations of their purposes, default behaviors, and usage guidelines to help you understand and utilize them effectively.
4+
5+
### Type: `object`
6+
7+
| Property | Type | Required | Possible values | Deprecated | Default | Description |
8+
| -------- | ---- | -------- | --------------- | ---------- | ------- | ----------- |
9+
| OPENCTI_URL | `string` || Format: [`uri`](https://json-schema.org/understanding-json-schema/reference/string#built-in-formats) | | | The base URL of the OpenCTI instance. |
10+
| OPENCTI_TOKEN | `string` || string | | | The API token to connect to OpenCTI. |
11+
| TENABLE_VULN_MANAGEMENT_API_ACCESS_KEY | `string` || Format: [`password`](https://json-schema.org/understanding-json-schema/reference/string#built-in-formats) | | | Tenable API access key. |
12+
| TENABLE_VULN_MANAGEMENT_API_SECRET_KEY | `string` || Format: [`password`](https://json-schema.org/understanding-json-schema/reference/string#built-in-formats) | | | Tenable API secret key. |
13+
| CONNECTOR_NAME | `string` | | string | | `"TenableVulnManagement"` | The name of the connector. |
14+
| CONNECTOR_SCOPE | `array` | | string | | `[]` | The scope of the connector. |
15+
| CONNECTOR_LOG_LEVEL | `string` | | `debug` `info` `warn` `warning` `error` | | `"error"` | The minimum level of logs to display. |
16+
| CONNECTOR_TYPE | `const` | | `EXTERNAL_IMPORT` | | `"EXTERNAL_IMPORT"` | |
17+
| CONNECTOR_DURATION_PERIOD | `string` | | Format: [`duration`](https://json-schema.org/understanding-json-schema/reference/string#built-in-formats) | | `"PT1H"` | The period of time to await between two runs of the connector. |
18+
| TENABLE_VULN_MANAGEMENT_API_BASE_URL | `string` | | string | | `"https://cloud.tenable.com"` | Base URL for the Tenable API. |
19+
| TENABLE_VULN_MANAGEMENT_API_TIMEOUT | `integer` | | integer | | `30` | Timeout for API requests in seconds. |
20+
| TENABLE_VULN_MANAGEMENT_API_BACKOFF | `integer` | | integer | | `1` | Time (in seconds) to wait before retrying after receiving a 429 response from the API. |
21+
| TENABLE_VULN_MANAGEMENT_API_RETRIES | `integer` | | integer | | `5` | Number of retries in case of failure. |
22+
| TENABLE_VULN_MANAGEMENT_EXPORT_SINCE | `string` | | string | | `"1970-01-01T00:00:00+00"` | Date from which to start pulling vulnerability data. |
23+
| TENABLE_VULN_MANAGEMENT_MIN_SEVERITY | `string` | | string | | `"low"` | The minimum severity level of vulnerabilities to import (`low`, `medium`, `high`, `critical`). |
24+
| TENABLE_VULN_MANAGEMENT_MARKING_DEFINITION | `string` | | string | | `"TLP:CLEAR"` | Default marking definition for imported data (e.g., `TLP:AMBER`, `TLP:GREEN`, `TLP:CLEAR`). |
25+
| TENABLE_VULN_MANAGEMENT_NUM_THREADS | `integer` | | integer | | `1` | Number of threads to use for the connector. |
26+
| TIO_API_BASE_URL | `string` | | string | ⛔️ | `"https://cloud.tenable.com"` | Use TENABLE_VULN_MANAGEMENT_API_BASE_URL instead. |
27+
| TIO_API_ACCESS_KEY | `string` | | Format: [`password`](https://json-schema.org/understanding-json-schema/reference/string#built-in-formats) | ⛔️ | | Use TENABLE_VULN_MANAGEMENT_API_ACCESS_KEY instead. |
28+
| TIO_API_SECRET_KEY | `string` | | Format: [`password`](https://json-schema.org/understanding-json-schema/reference/string#built-in-formats) | ⛔️ | | Use TENABLE_VULN_MANAGEMENT_API_SECRET_KEY instead. |
29+
| TIO_API_TIMEOUT | `integer` | | integer | ⛔️ | `30` | Use TENABLE_VULN_MANAGEMENT_API_TIMEOUT instead. |
30+
| TIO_API_BACKOFF | `integer` | | integer | ⛔️ | `1` | Use TENABLE_VULN_MANAGEMENT_API_BACKOFF instead. |
31+
| TIO_API_RETRIES | `integer` | | integer | ⛔️ | `5` | Use TENABLE_VULN_MANAGEMENT_API_RETRIES instead. |
32+
| TIO_EXPORT_SINCE | `string` | | string | ⛔️ | `"1970-01-01T00:00:00+00"` | Use TENABLE_VULN_MANAGEMENT_EXPORT_SINCE instead. |
33+
| TIO_MIN_SEVERITY | `string` | | string | ⛔️ | `"low"` | Use TENABLE_VULN_MANAGEMENT_MIN_SEVERITY instead. |
34+
| TIO_MARKING_DEFINITION | `string` | | string | ⛔️ | `"TLP:CLEAR"` | Use TENABLE_VULN_MANAGEMENT_MARKING_DEFINITION instead. |
35+
| TIO_NUM_THREADS | `integer` | | integer | ⛔️ | `1` | Use TENABLE_VULN_MANAGEMENT_NUM_THREADS instead. |
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://www.filigran.io/connectors/tenable-vuln-management_config.schema.json",
4+
"type": "object",
5+
"properties": {
6+
"OPENCTI_URL": {
7+
"description": "The base URL of the OpenCTI instance.",
8+
"format": "uri",
9+
"maxLength": 2083,
10+
"minLength": 1,
11+
"type": "string"
12+
},
13+
"OPENCTI_TOKEN": {
14+
"description": "The API token to connect to OpenCTI.",
15+
"type": "string"
16+
},
17+
"CONNECTOR_NAME": {
18+
"default": "TenableVulnManagement",
19+
"description": "The name of the connector.",
20+
"type": "string"
21+
},
22+
"CONNECTOR_SCOPE": {
23+
"default": [],
24+
"description": "The scope of the connector.",
25+
"items": {
26+
"type": "string"
27+
},
28+
"type": "array"
29+
},
30+
"CONNECTOR_LOG_LEVEL": {
31+
"default": "error",
32+
"description": "The minimum level of logs to display.",
33+
"enum": [
34+
"debug",
35+
"info",
36+
"warn",
37+
"warning",
38+
"error"
39+
],
40+
"type": "string"
41+
},
42+
"CONNECTOR_TYPE": {
43+
"const": "EXTERNAL_IMPORT",
44+
"default": "EXTERNAL_IMPORT",
45+
"type": "string"
46+
},
47+
"CONNECTOR_DURATION_PERIOD": {
48+
"default": "PT1H",
49+
"description": "The period of time to await between two runs of the connector.",
50+
"format": "duration",
51+
"type": "string"
52+
},
53+
"TENABLE_VULN_MANAGEMENT_API_BASE_URL": {
54+
"default": "https://cloud.tenable.com",
55+
"description": "Base URL for the Tenable API.",
56+
"type": "string"
57+
},
58+
"TENABLE_VULN_MANAGEMENT_API_ACCESS_KEY": {
59+
"description": "Tenable API access key.",
60+
"format": "password",
61+
"type": "string",
62+
"writeOnly": true
63+
},
64+
"TENABLE_VULN_MANAGEMENT_API_SECRET_KEY": {
65+
"description": "Tenable API secret key.",
66+
"format": "password",
67+
"type": "string",
68+
"writeOnly": true
69+
},
70+
"TENABLE_VULN_MANAGEMENT_API_TIMEOUT": {
71+
"default": 30,
72+
"description": "Timeout for API requests in seconds.",
73+
"type": "integer"
74+
},
75+
"TENABLE_VULN_MANAGEMENT_API_BACKOFF": {
76+
"default": 1,
77+
"description": "Time (in seconds) to wait before retrying after receiving a 429 response from the API.",
78+
"type": "integer"
79+
},
80+
"TENABLE_VULN_MANAGEMENT_API_RETRIES": {
81+
"default": 5,
82+
"description": "Number of retries in case of failure.",
83+
"type": "integer"
84+
},
85+
"TENABLE_VULN_MANAGEMENT_EXPORT_SINCE": {
86+
"default": "1970-01-01T00:00:00+00",
87+
"description": "Date from which to start pulling vulnerability data.",
88+
"type": "string"
89+
},
90+
"TENABLE_VULN_MANAGEMENT_MIN_SEVERITY": {
91+
"default": "low",
92+
"description": "The minimum severity level of vulnerabilities to import (`low`, `medium`, `high`, `critical`).",
93+
"type": "string"
94+
},
95+
"TENABLE_VULN_MANAGEMENT_MARKING_DEFINITION": {
96+
"default": "TLP:CLEAR",
97+
"description": "Default marking definition for imported data (e.g., `TLP:AMBER`, `TLP:GREEN`, `TLP:CLEAR`).",
98+
"type": "string"
99+
},
100+
"TENABLE_VULN_MANAGEMENT_NUM_THREADS": {
101+
"default": 1,
102+
"description": "Number of threads to use for the connector.",
103+
"type": "integer"
104+
},
105+
"TIO_API_BASE_URL": {
106+
"default": "https://cloud.tenable.com",
107+
"description": "Use TENABLE_VULN_MANAGEMENT_API_BASE_URL instead.",
108+
"type": "string",
109+
"deprecated": true
110+
},
111+
"TIO_API_ACCESS_KEY": {
112+
"description": "Use TENABLE_VULN_MANAGEMENT_API_ACCESS_KEY instead.",
113+
"format": "password",
114+
"type": "string",
115+
"writeOnly": true,
116+
"deprecated": true
117+
},
118+
"TIO_API_SECRET_KEY": {
119+
"description": "Use TENABLE_VULN_MANAGEMENT_API_SECRET_KEY instead.",
120+
"format": "password",
121+
"type": "string",
122+
"writeOnly": true,
123+
"deprecated": true
124+
},
125+
"TIO_API_TIMEOUT": {
126+
"default": 30,
127+
"description": "Use TENABLE_VULN_MANAGEMENT_API_TIMEOUT instead.",
128+
"type": "integer",
129+
"deprecated": true
130+
},
131+
"TIO_API_BACKOFF": {
132+
"default": 1,
133+
"description": "Use TENABLE_VULN_MANAGEMENT_API_BACKOFF instead.",
134+
"type": "integer",
135+
"deprecated": true
136+
},
137+
"TIO_API_RETRIES": {
138+
"default": 5,
139+
"description": "Use TENABLE_VULN_MANAGEMENT_API_RETRIES instead.",
140+
"type": "integer",
141+
"deprecated": true
142+
},
143+
"TIO_EXPORT_SINCE": {
144+
"default": "1970-01-01T00:00:00+00",
145+
"description": "Use TENABLE_VULN_MANAGEMENT_EXPORT_SINCE instead.",
146+
"type": "string",
147+
"deprecated": true
148+
},
149+
"TIO_MIN_SEVERITY": {
150+
"default": "low",
151+
"description": "Use TENABLE_VULN_MANAGEMENT_MIN_SEVERITY instead.",
152+
"type": "string",
153+
"deprecated": true
154+
},
155+
"TIO_MARKING_DEFINITION": {
156+
"default": "TLP:CLEAR",
157+
"description": "Use TENABLE_VULN_MANAGEMENT_MARKING_DEFINITION instead.",
158+
"type": "string",
159+
"deprecated": true
160+
},
161+
"TIO_NUM_THREADS": {
162+
"default": 1,
163+
"description": "Use TENABLE_VULN_MANAGEMENT_NUM_THREADS instead.",
164+
"type": "integer",
165+
"deprecated": true
166+
}
167+
},
168+
"required": [
169+
"OPENCTI_URL",
170+
"OPENCTI_TOKEN",
171+
"TENABLE_VULN_MANAGEMENT_API_ACCESS_KEY",
172+
"TENABLE_VULN_MANAGEMENT_API_SECRET_KEY"
173+
],
174+
"additionalProperties": true
175+
}

external-import/tenable-vuln-management/__metadata__/connector_manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"support_version": ">= 6.5.1",
1515
"subscription_link": "",
1616
"source_code": "https://github.com/OpenCTI-Platform/connectors/tree/master/external-import/tenable-vuln-management",
17-
"manager_supported": false,
17+
"manager_supported": true,
1818
"container_version": "rolling",
1919
"container_image": "opencti/connector-tenable-vuln-management",
2020
"container_type": "EXTERNAL_IMPORT"

external-import/tenable-vuln-management/docker-compose.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ services:
2323
# - CONNECTOR_SEND_TO_DIRECTORY_RETENTION=7 # Default 7, in days
2424

2525
# Connector's custom execution parameters
26-
- TIO_NUM_THREADS=2
27-
- TIO_API_BASE_URL=ChangeMe
28-
- TIO_API_ACCESS_KEY=ChangeMe
29-
- TIO_API_SECRET_KEY=ChangeMe
30-
- TIO_API_TIMEOUT=30
31-
- TIO_API_BACKOFF=1
32-
- TIO_API_RETRIES=5
33-
- TIO_EXPORT_SINCE=ChangeMe # ISO8601 format in String
34-
- TIO_MIN_SEVERITY=low # minimal severity level to export from Tenable.io, should be in (info, low, medium, high, critical)
35-
- "TIO_MARKING_DEFINITION=TLP:CLEAR" # default TLP marking to apply to exported objects
26+
- TENABLE_VULN_MANAGEMENT_NUM_THREADS=2
27+
- TENABLE_VULN_MANAGEMENT_API_BASE_URL=ChangeMe
28+
- TENABLE_VULN_MANAGEMENT_API_ACCESS_KEY=ChangeMe
29+
- TENABLE_VULN_MANAGEMENT_API_SECRET_KEY=ChangeMe
30+
- TENABLE_VULN_MANAGEMENT_API_TIMEOUT=30
31+
- TENABLE_VULN_MANAGEMENT_API_BACKOFF=1
32+
- TENABLE_VULN_MANAGEMENT_API_RETRIES=5
33+
- TENABLE_VULN_MANAGEMENT_EXPORT_SINCE=ChangeMe # ISO8601 format in String
34+
- TENABLE_VULN_MANAGEMENT_MIN_SEVERITY=low # minimal severity level to export from Tenable.io, should be in (info, low, medium, high, critical)
35+
- "TENABLE_VULN_MANAGEMENT_MARKING_DEFINITION=TLP:CLEAR" # default TLP marking to apply to exported objects
3636
restart: always

external-import/tenable-vuln-management/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ python-dateutil==2.9.0.post0
33
pycti==7.260706.0
44
validators==0.35.0
55
pydantic>=2.8.2, <3.0.0
6-
stix2~=3.0.1
6+
stix2~=3.0.1
7+
connectors-sdk @ git+https://github.com/OpenCTI-Platform/connectors.git@master#subdirectory=connectors-sdk

external-import/tenable-vuln-management/src/config.yml.sample

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ connector:
1212
#============================================#
1313
# Optional connector's definition parameters #
1414
#============================================#
15-
#queue_threshold: 500
16-
#run_and_terminate: 'False'
17-
#send_to_queue: 'True'
18-
#send_to_directory: 'False'
19-
#send_to_directory_path: 'ChangeMe'
20-
#send_to_directory_retention: 7
15+
queue_threshold: 500
16+
run_and_terminate: 'False'
17+
send_to_queue: 'True'
18+
send_to_directory: 'False'
19+
send_to_directory_path: 'ChangeMe'
20+
send_to_directory_retention: 7
2121

2222
tenable_vuln_management:
23-
num_thread: 2
23+
num_threads: 2
2424
api_base_url: 'ChangeMe'
2525
api_access_key: 'ChangeMe'
2626
api_secret_key: 'ChangeMe'

external-import/tenable-vuln-management/src/main.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import traceback
22

3-
from tenable_vuln_management import Connector
3+
from pycti import OpenCTIConnectorHelper
4+
from tenable_vuln_management import Connector, ConnectorSettings
45

56
if __name__ == "__main__":
67
"""
@@ -13,7 +14,10 @@
1314
It signals to the operating system and any calling processes that the program did not complete successfully.
1415
"""
1516
try:
16-
connector = Connector()
17+
settings = ConnectorSettings()
18+
helper = OpenCTIConnectorHelper(config=settings.to_helper_config())
19+
20+
connector = Connector(config=settings, helper=helper)
1721
connector.run()
1822
except Exception:
1923
traceback.print_exc()
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
from .connector import Connector
1+
from tenable_vuln_management.connector import Connector
2+
from tenable_vuln_management.settings import ConnectorSettings
23

3-
__all__ = ["Connector"]
4+
__all__ = ["Connector", "ConnectorSettings"]

0 commit comments

Comments
 (0)