Skip to content

Commit 85b4c46

Browse files
committed
fix(cisa-kev): default create_infrastructures to false
The CISA KEV connector creates Vulnerability and Software entities for each catalog entry. When cisa.create_infrastructures was true (the old default) it ALSO emitted an Infrastructure SDO with the same name as the Software SCO. KEV catalog entries (PHP, Joomla, Laravel, GNU C Library, Apache Struts, October CMS, etc.) are software products. None of them map to any value in the STIX 2.1 infrastructure-type-ov vocabulary (amplification, botnet, command-and-control, firewall, routers-switches, ...), so the connector silently emitted Infrastructure objects with an empty infrastructure_types field — non-compliant STIX that's also duplicated by the Software SCO already in the bundle. Flipping the default to false stops fresh deployments from generating that noise while preserving the legacy opt-in path for existing users who rely on the behaviour. No code logic changed — just the default. Also adds the first test suite for this connector (previously zero): 32 tests covering config defaults, env-var overrides, bundle composition in every flag combination, regression cases for the real product names that prompted this change, and end-to-end stix2.Bundle serialisation. Docs (README, __metadata__/CONNECTOR_CONFIG_DOC.md, connector_config_schema.json) updated in lock-step with the default.
1 parent fa3b2fa commit 85b4c46

8 files changed

Lines changed: 450 additions & 7 deletions

File tree

external-import/cisa-known-exploited-vulnerabilities/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ There are a number of configuration options, which are set either in `docker-com
6565
| Parameter | config.yml | Docker environment variable | Default | Mandatory | Description |
6666
|-------------------------|----------------------------|---------------------------------|-------------------------------------------------------------------------------|-----------|------------------------------------------------------------------------|
6767
| Catalog URL | cisa.catalog_url | `CISA_CATALOG_URL` | https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json | No | URL of the CISA KEV catalog JSON feed. |
68-
| Create Infrastructures | cisa.create_infrastructures| `CISA_CREATE_INFRASTRUCTURES` | true | No | Create Infrastructure entities for affected products. |
68+
| Create Infrastructures | cisa.create_infrastructures| `CISA_CREATE_INFRASTRUCTURES` | false | No | Also create Infrastructure entities for affected products. Disabled by default — KEV entries are software products and do not map to any valid STIX 2.1 `infrastructure-type-ov` value, so enabling this produces Infrastructure objects with an empty `infrastructure_types`. Left opt-in for legacy workflows. |
6969
| KEV Flag Only | cisa.kev_flag_only | `CISA_KEV_FLAG_ONLY` | false | No | When enabled, the connector only sets the `x_opencti_cisa_kev` flag on Vulnerability objects without modifying any other attribute (description, dates, markings) and without creating additional entities or relationships. See [KEV Flag Only Mode](#kev-flag-only-mode). |
7070
| TLP | cisa.tlp | `CISA_TLP` | TLP:CLEAR | No | TLP marking for imported data (`TLP:CLEAR`, `TLP:GREEN`, `TLP:AMBER`, `TLP:AMBER+STRICT`, `TLP:RED`). |
7171
| Interval (deprecated) | cisa.interval | `CISA_INTERVAL` | 7 | No | **[DEPRECATED]** Interval in days between runs. Use `CONNECTOR_DURATION_PERIOD` instead. |
@@ -94,7 +94,7 @@ Configure the connector in `docker-compose.yml`:
9494
- CONNECTOR_LOG_LEVEL=info
9595
- CONNECTOR_DURATION_PERIOD=P1D
9696
- CISA_CATALOG_URL=https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json
97-
- CISA_CREATE_INFRASTRUCTURES=true
97+
- CISA_CREATE_INFRASTRUCTURES=false
9898
- CISA_KEV_FLAG_ONLY=false
9999
- CISA_TLP=TLP:CLEAR
100100
restart: always

external-import/cisa-known-exploited-vulnerabilities/__metadata__/CONNECTOR_CONFIG_DOC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Below is an exhaustive enumeration of all configurable parameters available, eac
1414
| CONNECTOR_LOG_LEVEL | `string` | | `debug` `info` `warn` `warning` `error` | | `"error"` | Determines the verbosity of the logs. |
1515
| CONNECTOR_DURATION_PERIOD | `string` | | Format: [`duration`](https://json-schema.org/understanding-json-schema/reference/string#built-in-formats) | | `"P2D"` | Duration between two scheduled runs of the connector (ISO 8601 format). |
1616
| CISA_CATALOG_URL | `string` | | string | | `"https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json"` | The URL that hosts the KEV Catalog https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json. |
17-
| CISA_CREATE_INFRASTRUCTURES | `boolean` | | boolean | | `true` | Allows you to create or not create an infrastructure in OpenCTI. |
17+
| CISA_CREATE_INFRASTRUCTURES | `boolean` | | boolean | | `false` | Also emit a STIX Infrastructure SDO for each affected product, alongside the Software SCO. Disabled by default because CISA KEV entries (e.g. PHP, Joomla, Laravel) are software products and do not map cleanly to any value in the STIX 2.1 infrastructure-type-ov vocabulary; enabling this produces Infrastructure objects with an empty infrastructure_types field. Left opt-in for workflows that depend on the legacy behaviour. |
1818
| CISA_KEV_FLAG_ONLY | `boolean` | | boolean | | `false` | When enabled, the connector only sets the x_opencti_cisa_kev flag on Vulnerability objects without creating additional entities (vendors, software, infrastructures) or relationships. |
1919
| CISA_TLP | `string` | | `TLP:WHITE` `TLP:CLEAR` `TLP:GREEN` `TLP:AMBER` `TLP:AMBER+STRICT` `TLP:RED` | | `"TLP:CLEAR"` | Traffic Light Protocol (TLP) level to apply on objects imported into OpenCTI. Possible values: TLP:CLEAR, TLP:GREEN, TLP:AMBER, TLP:AMBER+STRICT, TLP:RED. |
2020
| CISA_INTERVAL | `integer` | | integer | ⛔️ | `7` | [DEPRECATED] Interval in days between two scheduled runs of the connector. |

external-import/cisa-known-exploited-vulnerabilities/__metadata__/connector_config_schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
"type": "string"
5959
},
6060
"CISA_CREATE_INFRASTRUCTURES": {
61-
"default": true,
62-
"description": "Allows you to create or not create an infrastructure in OpenCTI.",
61+
"default": false,
62+
"description": "Also emit a STIX Infrastructure SDO for each affected product, alongside the Software SCO. Disabled by default because CISA KEV entries (e.g. PHP, Joomla, Laravel) are software products and do not map cleanly to any value in the STIX 2.1 infrastructure-type-ov vocabulary; enabling this produces Infrastructure objects with an empty infrastructure_types field. Left opt-in for workflows that depend on the legacy behaviour.",
6363
"type": "boolean"
6464
},
6565
"CISA_KEV_FLAG_ONLY": {

external-import/cisa-known-exploited-vulnerabilities/src/models/configs/cisakev_configs.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,16 @@ class _ConfigLoaderCISAKEV(ConfigBaseSettings):
2828
description="The URL that hosts the KEV Catalog https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json.",
2929
)
3030
create_infrastructures: bool = Field(
31-
default=True,
32-
description="Allows you to create or not create an infrastructure in OpenCTI.",
31+
default=False,
32+
description=(
33+
"Also emit a STIX Infrastructure SDO for each affected product, "
34+
"alongside the Software SCO. Disabled by default because CISA KEV "
35+
"entries (e.g. PHP, Joomla, Laravel) are software products and do "
36+
"not map cleanly to any value in the STIX 2.1 infrastructure-type-ov "
37+
"vocabulary; enabling this produces Infrastructure objects with an "
38+
"empty infrastructure_types field. Left opt-in for workflows that "
39+
"depend on the legacy behaviour."
40+
),
3341
)
3442
kev_flag_only: bool = Field(
3543
default=False,

external-import/cisa-known-exploited-vulnerabilities/tests/__init__.py

Whitespace-only changes.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
"""Test fixtures for the CISA KEV connector.
2+
3+
Adds `src/` to sys.path so tests can `import main` and
4+
`from models.configs.cisakev_configs import _ConfigLoaderCISAKEV`
5+
without packaging the connector. Mirrors how the connector itself
6+
is invoked at runtime (`python3 main.py` from `src/`).
7+
"""
8+
9+
import sys
10+
from pathlib import Path
11+
12+
import pytest
13+
14+
SRC = Path(__file__).resolve().parent.parent / "src"
15+
sys.path.insert(0, str(SRC))
16+
17+
18+
@pytest.fixture
19+
def sample_kev_entry():
20+
"""A representative single-product CISA KEV entry.
21+
22+
Field shape mirrors the upstream catalog:
23+
https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json
24+
"""
25+
return {
26+
"cveID": "CVE-2024-12345",
27+
"vendorProject": "Acme Corp",
28+
"product": "Acme Widget Server",
29+
"vulnerabilityName": "Acme Widget Server RCE",
30+
"dateAdded": "2024-01-15",
31+
"shortDescription": "Acme Widget Server contains a remote code execution vulnerability.",
32+
"requiredAction": "Apply mitigations per vendor instructions.",
33+
"dueDate": "2024-02-05",
34+
"knownRansomwareCampaignUse": "Unknown",
35+
"notes": "",
36+
"cwes": ["CWE-78"],
37+
}
38+
39+
40+
@pytest.fixture
41+
def kev_entry_software_product():
42+
"""A KEV entry that is unambiguously a software product (not infrastructure).
43+
44+
Real example from the CISA KEV catalog.
45+
"""
46+
return {
47+
"cveID": "CVE-2017-9805",
48+
"vendorProject": "Apache",
49+
"product": "Struts",
50+
"vulnerabilityName": "Apache Struts Deserialization Vulnerability",
51+
"dateAdded": "2021-11-03",
52+
"shortDescription": "Apache Struts contains an unsafe deserialization vulnerability.",
53+
"requiredAction": "Apply updates per vendor instructions.",
54+
"dueDate": "2022-05-03",
55+
"knownRansomwareCampaignUse": "Known",
56+
"notes": "",
57+
"cwes": ["CWE-502"],
58+
}

0 commit comments

Comments
 (0)