Skip to content

Commit 3c5d181

Browse files
[urlscan-enrichment]: set to manager supported (#5434)
Co-authored-by: Romain GUIGNARD <romain.guignard@filigran.io>
1 parent d62e1b8 commit 3c5d181

File tree

8 files changed

+32
-36
lines changed

8 files changed

+32
-36
lines changed

internal-enrichment/urlscan-enrichment/__metadata__/CONNECTOR_CONFIG_DOC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ Below is an exhaustive enumeration of all configurable parameters available, eac
88
| -------- | ---- | -------- | --------------- | ------- | ----------- |
99
| OPENCTI_URL | `string` || Format: [`uri`](https://json-schema.org/understanding-json-schema/reference/string#built-in-formats) | | The base URL of the OpenCTI instance. |
1010
| OPENCTI_TOKEN | `string` || string | | The API token to connect to OpenCTI. |
11+
| URLSCAN_ENRICHMENT_API_KEY | `string` || Format: [`password`](https://json-schema.org/understanding-json-schema/reference/string#built-in-formats) | | URLScan API Key |
1112
| CONNECTOR_NAME | `string` | | string | `"Urlscan Enrichment"` | The name of the connector. |
1213
| CONNECTOR_SCOPE | `array` | | string | `["url", "ipv4-addr", "ipv6-addr"]` | The scope of the connector. Availables: `url or hostname or domain-name` (scope-submission), `ipv4-addr` and `ipv6-addr` (scope-search) |
1314
| CONNECTOR_LOG_LEVEL | `string` | | `debug` `info` `warn` `warning` `error` | `"error"` | The minimum level of logs to display. |
1415
| CONNECTOR_TYPE | `const` | | `INTERNAL_ENRICHMENT` | `"INTERNAL_ENRICHMENT"` | |
1516
| CONNECTOR_AUTO | `boolean` | | boolean | `false` | Whether the connector should run automatically when an entity is created or updated. |
16-
| URLSCAN_ENRICHMENT_API_KEY | `string` | | Format: [`password`](https://json-schema.org/understanding-json-schema/reference/string#built-in-formats) | `null` | URLScan API Key |
1717
| URLSCAN_ENRICHMENT_IMPORT_SCREENSHOT | `boolean` | | boolean | `true` | Allows or not the import of the screenshot of the scan submitted in URLScan to OpenCTI. |
1818
| URLSCAN_ENRICHMENT_VISIBILITY | `string` | | `public` `unlisted` `private` | `"public"` | URLScan offers several levels of visibility for submitted scans: `public`, `unlisted`, `private` |
1919
| URLSCAN_ENRICHMENT_SEARCH_FILTERED_BY_DATE | `string` | | string | `">now-1y"` | Allows you to filter by date available: `>now-1h`, `>now-1d`, `>now-1y`, `[2022 TO 2023]`, `[2022/01/01 TO 2023/12/01]` |

internal-enrichment/urlscan-enrichment/__metadata__/connector_config_schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
"type": "boolean"
5555
},
5656
"URLSCAN_ENRICHMENT_API_KEY": {
57-
"default": null,
5857
"description": "URLScan API Key",
5958
"format": "password",
6059
"type": "string",
@@ -101,7 +100,8 @@
101100
},
102101
"required": [
103102
"OPENCTI_URL",
104-
"OPENCTI_TOKEN"
103+
"OPENCTI_TOKEN",
104+
"URLSCAN_ENRICHMENT_API_KEY"
105105
],
106106
"additionalProperties": true
107107
}

internal-enrichment/urlscan-enrichment/__metadata__/connector_manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "URLScan Enrichment",
33
"slug": "urlscan-enrichment",
4-
"description": "FIRST's Exploit Prediction Scoring System (EPSS) is an open model designed to predict the likelihood of a vulnerability being exploited in the wild. By providing a score for each vulnerability, EPSS helps organizations prioritize vulnerability management efforts based on the potential risk and impact. \n\nThe integration of FIRST EPSS with OpenCTI enables the automatic enrichment of vulnerabilities with EPSS information provided by FIRST (the global Forum of Incident Response and Security Teams). The integration enriches vulnerabilities with EPSS score and percentile.",
4+
"description": "URLScan is an online service that allows you to scan URLs to analyze and detect potential security threats. It provides a platform where users can submit links to be scanned to obtain information about the page's content, loaded external resources, potential threats, and other relevant security details.\n\nThe integration of URLScan with OpenCTI enables the automatic enrichment and analysis of IP addresses and URLs.",
55
"short_description": "URLScan is an online service that allows you to scan URLs to analyze and detect potential security threats. It provides a platform where users can submit links to be scanned to obtain information about the page's content, loaded external resources, potential threats, and other relevant security details.\n\nThe integration of URLScan with OpenCTI enables the automatic enrichment and analysis of IP addresses and URLs.",
66
"logo": "internal-enrichment/urlscan-enrichment/__metadata__/logo.png",
77
"use_cases": [
@@ -14,7 +14,7 @@
1414
"support_version": ">= 6.0.7",
1515
"subscription_link": "https://urlscan.io",
1616
"source_code": "https://github.com/OpenCTI-Platform/connectors/tree/oob/connector_manager/internal-enrichment/urlscan-enrichment",
17-
"manager_supported": false,
17+
"manager_supported": true,
1818
"container_version": "rolling",
1919
"container_image": "opencti/connector-urlscan-enrichment",
2020
"container_type": "INTERNAL_ENRICHMENT"
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
version: '3'
21
services:
32
connector-urlscan-enrichment:
43
image: opencti/connector-urlscan-enrichment:latest
54
environment:
65
- OPENCTI_URL=http://localhost
76
- OPENCTI_TOKEN=ChangeMe
8-
- CONNECTOR_ID=496df155-c2f0-43b3-ab46-4352e68989d8 # Optional (default: '496df155-c2f0-43b3-ab46-4352e68989d8')
9-
- CONNECTOR_NAME=UrlScan # Optional (default: 'Urlscan Enrichment')
10-
- CONNECTOR_SCOPE=url,ipv4-addr,ipv6-addr # Optional (default: 'url,ipv4-addr,ipv6-addr')
11-
- CONNECTOR_AUTO=false # Optional (default: false)
12-
- CONNECTOR_LOG_LEVEL=error # Optional (default: 'error')
13-
- URLSCAN_ENRICHMENT_API_KEY= # Optional (default: empty)
14-
- URLSCAN_ENRICHMENT_IMPORT_SCREENSHOT=false # Optional (default: true)
15-
- URLSCAN_ENRICHMENT_VISIBILITY=public # Optional (default: 'public')
16-
- URLSCAN_ENRICHMENT_SEARCH_FILTERED_BY_DATE=>now-2d # Optional (default: '>now-1d')
17-
- URLSCAN_ENRICHMENT_MAX_TLP=TLP:AMBER # Optional (default: 'TLP:AMBER')
18-
- URLSCAN_ENRICHMENT_CREATE_INDICATOR=true # Optional (default: true)
7+
#- CONNECTOR_ID=496df155-c2f0-43b3-ab46-4352e68989d8 # Optional (default: '496df155-c2f0-43b3-ab46-4352e68989d8')
8+
#- CONNECTOR_NAME=UrlScan # Optional (default: 'Urlscan Enrichment')
9+
#- CONNECTOR_SCOPE=url,ipv4-addr,ipv6-addr # Optional (default: 'url,ipv4-addr,ipv6-addr')
10+
#- CONNECTOR_AUTO=false # Optional (default: false)
11+
#- CONNECTOR_LOG_LEVEL=error # Optional (default: 'error')
12+
#- URLSCAN_ENRICHMENT_API_KEY= # Optional (default: empty)
13+
#- URLSCAN_ENRICHMENT_IMPORT_SCREENSHOT=false # Optional (default: true)
14+
#- URLSCAN_ENRICHMENT_VISIBILITY=public # Optional (default: 'public')
15+
#- URLSCAN_ENRICHMENT_SEARCH_FILTERED_BY_DATE=>now-2d # Optional (default: '>now-1d')
16+
#- URLSCAN_ENRICHMENT_MAX_TLP=TLP:AMBER # Optional (default: 'TLP:AMBER')
17+
#- URLSCAN_ENRICHMENT_CREATE_INDICATOR=true # Optional (default: true)
1918
restart: always

internal-enrichment/urlscan-enrichment/src/config.yml.sample

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ opencti:
33
token: "ChangeMe"
44

55
connector:
6-
id: "496df155-c2f0-43b3-ab46-4352e68989d8" # Optional (default: '496df155-c2f0-43b3-ab46-4352e68989d8')
7-
name: "UrlScan" # Optional (default: 'Urlscan Enrichment')
8-
scope: "url,ipv4-addr,ipv6-addr" # Optional (default: 'url,ipv4-addr,ipv6-addr')
9-
auto: false # Optional (default: false)
10-
log_level: "error" # Optional (default: 'error')
6+
#id: "496df155-c2f0-43b3-ab46-4352e68989d8" # Optional (default: '496df155-c2f0-43b3-ab46-4352e68989d8')
7+
#name: "UrlScan" # Optional (default: 'Urlscan Enrichment')
8+
#scope: "url,ipv4-addr,ipv6-addr" # Optional (default: 'url,ipv4-addr,ipv6-addr')
9+
#auto: false # Optional (default: false)
10+
#log_level: "error" # Optional (default: 'error')
1111

1212
urlscan_enrichment:
13-
api_key: null # Optional (default: null)
14-
import_screenshot: false # Optional (default: true)
15-
visibility: "public" # Optional (default: 'public')
16-
search_filtered_by_date: ">now-2d" # Optional (default: '>now-1d')
17-
max_tlp: "TLP:AMBER" # Optional (default: 'TLP:AMBER')
18-
create_indicator: true # Optional (default: true)
13+
#api_key: null # Optional (default: null)
14+
#import_screenshot: false # Optional (default: true)
15+
#visibility: "public" # Optional (default: 'public')
16+
#search_filtered_by_date: ">now-2d" # Optional (default: '>now-1d')
17+
#max_tlp: "TLP:AMBER" # Optional (default: 'TLP:AMBER')
18+
#create_indicator: true # Optional (default: true)

internal-enrichment/urlscan-enrichment/src/urlscan_enrichment_services/connector.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ def __init__(self, config: ConnectorSettings, helper: OpenCTIConnectorHelper):
1919

2020
self.client = UrlscanClient(
2121
self.helper,
22-
api_key=(
23-
self.config.urlscan_enrichment.api_key.get_secret_value()
24-
if self.config.urlscan_enrichment.api_key
25-
else None
26-
),
22+
api_key=self.config.urlscan_enrichment.api_key.get_secret_value(),
2723
default_scan_visibility=self.config.urlscan_enrichment.visibility,
2824
)
2925
self.converter = UrlscanConverter(

internal-enrichment/urlscan-enrichment/src/urlscan_enrichment_services/settings.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ class UrlscanEnrichmentConfig(BaseConfigModel):
3535
Define parameters and/or defaults for the configuration specific to the `UrlscanEnrichmentConnector`.
3636
"""
3737

38-
api_key: SecretStr | None = Field(
38+
api_key: SecretStr = Field(
3939
description="URLScan API Key",
40-
default=None,
4140
)
4241
import_screenshot: bool = Field(
4342
description="Allows or not the import of the screenshot of the scan submitted in URLScan to OpenCTI.",

internal-enrichment/urlscan-enrichment/tests/tests_connector/test_settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939
"token": "test-token",
4040
},
4141
"connector": {},
42-
"urlscan_enrichment": {},
42+
"urlscan_enrichment": {
43+
"api_key": "test-api-key",
44+
},
4345
},
4446
id="minimal_valid_settings_dict",
4547
),

0 commit comments

Comments
 (0)