Skip to content

Commit 47feb33

Browse files
committed
Add Cuckoo Sandbox / CAPEv2 connector with dual API support
New gnat/connectors/cuckoo/ connector supporting both Cuckoo 2.x (/api/) and CAPEv2/3.x (/apiv2/) APIs with auto-detection at authenticate() time. Bearer token auth, sandbox_report_envelope() for STIX observed-data, IOC extraction from network/dropped/signatures sections, score-based verdict mapping, and domain helpers for file/URL submission. Platform count: 158 → 159. 22 new tests. https://claude.ai/code/session_01H5UbjsuiiGya5n1eUCxoaR
1 parent 8e1d632 commit 47feb33

8 files changed

Lines changed: 799 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,33 @@ all v1.4+ modules.
1919
→ Full feature breakdown is in `## [1.4.0]` below; this entry marks the version cut.
2020
## [Unreleased]
2121

22+
### Added — Cuckoo Sandbox / CAPEv2 connector
23+
24+
New `gnat/connectors/cuckoo/` connector for dynamic malware analysis.
25+
Supports both the legacy Cuckoo 2.x API (`/api/`) and CAPEv2/3.x
26+
(`/apiv2/`) with auto-detection at `authenticate()` time. Platform
27+
count: 158 → 159.
28+
29+
- `CuckooClient` — Bearer token auth. STIX type map: observed-data,
30+
malware, indicator. Version-specific endpoint routing via
31+
`self._prefix`. Auto-detection probes `/apiv2/cuckoo/status/` first
32+
(CAPEv2 is more common); falls back to v2 on failure. Optional
33+
`api_version` constructor override skips detection.
34+
- Domain helpers: `submit_file()`, `submit_url()`, `get_report()`,
35+
`get_task_view()`, `get_iocs()`, `iocs_to_indicators()`,
36+
`list_machines()`, `get_pcap()`.
37+
- IOC extraction: walks `network.hosts` (IPs), `network.domains`
38+
(domains), `network.http` (URLs), `dropped` (SHA-256 hashes),
39+
`network.dns.answers` (resolved IPs), and CAPEv2
40+
`signatures[*].marks[*].ioc` (signature-extracted IOCs).
41+
Deduplicates by type+value.
42+
- STIX mapping: `sandbox_report_envelope()` for observed-data with
43+
processes, contacted IPs/domains/URLs, verdict from score mapping
44+
(0-3→clean, 4-6→suspicious, 7+→malicious). Malware SDO from
45+
`malfamily`/`detections` fields. Indicator SDOs via
46+
`make_indicator_pattern()`.
47+
- 22 new tests in `TestCuckooClient`.
48+
2249
### Added — Sensor/telemetry ingestion module (`gnat[telemetry]`)
2350

2451
New `gnat/ingest/telemetry/` package for high-volume honeypot, netflow,

CLAUDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ gnat/ # Main Python package
3131
├── orm/ # STIX 2.1 ORM (STIXBase + 8 object types)
3232
├── stix/ # STIX pattern validation (stix2-patterns integration)
3333
├── clients/ # HTTP client layer (urllib3 BaseClient + CLIENT_REGISTRY)
34-
├── connectors/ # 158 platform connectors (ThreatQ, CrowdStrike, Splunk, etc.)
34+
├── connectors/ # 159 platform connectors (ThreatQ, CrowdStrike, Splunk, etc.)
3535
├── ingest/ # Multi-source ingestion pipeline (14 readers, 12 mappers)
3636
│ └── telemetry/ # High-volume sensor ingestion (Kafka reader, Redis dedup, campaign auto-link)
3737
├── export/ # Export pipeline (EDL, Netskope CE delivery targets)
@@ -352,6 +352,7 @@ Prefer mocking at the HTTP layer (`mock_pool_manager`) rather than patching indi
352352
| Hybrid Analysis / Falcon Sandbox | `gnat/connectors/hybrid_analysis/` | API key + User-Agent header |
353353
| VMRay (hypervisor-level analysis) | `gnat/connectors/vmray/` | API key (`api_key` header) |
354354
| Intezer Analyze (binary DNA attribution) | `gnat/connectors/intezer/` | API key → JWT Bearer |
355+
| Cuckoo Sandbox / CAPEv2 (dynamic malware analysis) | `gnat/connectors/cuckoo/` | Bearer token |
355356
| Huntress Managed EDR / ITDR | `gnat/connectors/huntress/` | HTTP Basic (key id + secret) |
356357
| Arctic Wolf MDR | `gnat/connectors/arctic_wolf/` | Bearer token (+ optional customer id) |
357358
| Red Canary MDR | `gnat/connectors/red_canary/` | API key (`X-Api-Key` header) |

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ GNAT provides a single, consistent abstraction layer over 158 platforms — thre
5252

5353
| Layer | What it does |
5454
|-------|-------------|
55-
| **158 Connectors** | Uniform CRUD + bidirectional STIX 2.1 translation for every supported platform |
55+
| **159 Connectors** | Uniform CRUD + bidirectional STIX 2.1 translation for every supported platform |
5656
| **STIX 2.1 ORM** | Indicator, ThreatActor, Vulnerability, Malware, AttackPattern, Relationship, Observables |
5757
| **Ingest Pipelines** | 15 source readers × 13 mappers; pull from any platform, file, feed, database, or Kafka topic |
5858
| **Export Pipelines** | EDL files, Netskope CE, STIX bundles, CSV; configurable filters + transforms + delivery |
@@ -245,6 +245,7 @@ GNAT provides a single, consistent abstraction layer over 158 platforms — thre
245245
| `hybrid_analysis` | Hybrid Analysis / Falcon Sandbox | API key + User-Agent header |
246246
| `vmray` | VMRay (hypervisor-level analysis) | API key (`api_key` header) |
247247
| `intezer` | Intezer Analyze (binary DNA attribution) | API key → JWT Bearer |
248+
| `cuckoo` | Cuckoo Sandbox / CAPEv2 (dynamic malware analysis) | Bearer token |
248249

249250
### Managed Detection & Response (MDR)
250251

config/config.ini.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,13 @@ api_key = YOUR_HTTPBL_ACCESS_KEY
12321232
[crtsh]
12331233
host = https://crt.sh
12341234

1235+
# --- Cuckoo Sandbox / CAPEv2 (dynamic malware analysis) --------------------
1236+
# Supports both Cuckoo 2.x and CAPEv2/3.x APIs (auto-detected).
1237+
[cuckoo]
1238+
host = https://cuckoo.lab.internal
1239+
api_key = <your-cuckoo-api-key>
1240+
# api_version = 3 ; optional — auto-detected if omitted
1241+
12351242
# --- Google Certificate Transparency log API -------------------------------
12361243
# No authentication required. ``log`` is the path to a specific CT log
12371244
# operated by Google (Argon, Xenon, etc.).

gnat/clients/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
from gnat.connectors.cribl.client import CriblClient
4343
from gnat.connectors.crowdstrike.client import CrowdStrikeClient
4444
from gnat.connectors.crtsh.client import CrtShClient
45+
from gnat.connectors.cuckoo.client import CuckooClient
4546
from gnat.connectors.cyble_vision.client import CybleVisionClient
4647
from gnat.connectors.cycognito.client import CyCognitoClient
4748
from gnat.connectors.cymulate.client import CymulateClient
@@ -339,6 +340,7 @@
339340
"project_honey_pot": ProjectHoneyPotClient,
340341
# Phase 2 Wave 9 — Cert transparency + DFIR + bug bounty
341342
"crtsh": CrtShClient,
343+
"cuckoo": CuckooClient,
342344
"google_ct": GoogleCTClient,
343345
"velociraptor": VelociraptorClient,
344346
"magnet_axiom": MagnetAxiomClient,

gnat/connectors/cuckoo/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright 2026 Bill Halpin
3+
"""
4+
gnat.connectors.cuckoo
5+
=========================
6+
7+
Cuckoo Sandbox / CAPEv2 connector — automated malware analysis with
8+
behavioral reports, IOC extraction, and STIX indicator generation.
9+
Supports both Cuckoo 2.x and CAPEv2/3.x APIs with auto-detection.
10+
"""
11+
12+
from .client import CuckooClient
13+
14+
__all__ = ["CuckooClient"]

0 commit comments

Comments
 (0)