← Course Index

7.13 OpenCTI Threat Intelligence Platform:
STIX 2.1 Knowledge Graphs, Connectors & SIEM Enrichment

Structuring Adversary & TTP Graphs, Operating Ingestion & Enrichment Connectors, and Streaming Curated Intelligence to SIEM & SOAR

Module 7: Vulnerability Research & Defense OpenCTI & STIX 2.1 TAXII 2.1, GraphQL & SIEM Streams

1. Turning Raw Threat Feeds into a Connected STIX 2.1 Knowledge Graph

Flat lists of IP addresses and file hashes age out quickly and give SOC analysts little insight into who is attacking, which malware family or MITRE ATT&CK technique is involved, or what detection rule should fire. OpenCTI is an open-source Cyber Threat Intelligence (CTI) platform built natively on the STIX 2.1 standard. It organizes threat actors, intrusion sets, campaigns, malware, vulnerabilities, attack patterns, and technical observables into a queryable knowledge graph backed by Elasticsearch, Redis, RabbitMQ, and S3/MinIO object storage.

Decoupled Connector Architecture: OpenCTI relies on independent worker processes called connectors (EXTERNAL_IMPORT, INTERNAL_ENRICHMENT, INTERNAL_IMPORT_FILE, INTERNAL_EXPORT_FILE, and STREAM) that normalize external feeds (such as MITRE ATT&CK, CISA KEV, or TAXII servers) into STIX 2.1 bundles, enrich observables on demand, and stream curated intelligence to SIEM/SOAR tools.
1. INGESTION CONNECTORS MITRE ATT&CK & CISA KEV TAXII 2.1 & OSINT Feeds Threat Reports & Sigma Rules Internal Incident Observations 2. OPENCTI STIX 2.1 CORE STIX 2.1 Entity & Edge Graph Actors, Malware, TTPs, CVEs & IOCs Enrichment, Confidence & Decay TLP markings, scoring & indicator aging 3. DISTRIBUTE & OPERATIONALIZE TAXII 2.1 collections & SSE live streams GraphQL API for SOAR alert enrichment 4. DEFENSIVE OUTCOMES • Context-Rich SIEM Detections • Automated SOAR Triage Context • TLP-Governed Intel Sharing
Figure 7.13: OpenCTI Threat Intelligence Architecture Linking External Ingestion Connectors, the STIX 2.1 Knowledge Graph, and Real-Time SIEM/SOAR Distribution.

2. Core OpenCTI Connector Types & Integration Patterns

Component / Pattern Primary Function Operational Guidance
External Import Connectors Scheduled ETL workers pulling threat feeds (MITRE ATT&CK, CISA KEV, abuse.ch, MISP, commercial feeds) into STIX 2.1. Import MITRE ATT&CK first so campaigns, malware, and indicators attach to standardized tactics and techniques.
Internal Enrichment Connectors On-demand or automatic lookups (WHOIS, passive DNS, sandbox, reputation APIs) attached to observables. Trigger selectively on high-priority observables or investigation entities to avoid API quota exhaustion.
Live Streams (SSE) & TAXII 2.1 Publishes filtered STIX 2.1 indicators and objects to Microsoft Sentinel, Elastic, Splunk, or EDR platforms. Filter streams by confidence threshold, indicator validity window, and Traffic Light Protocol (TLP) markings.
GraphQL API & pycti Programmatic interface for SOAR playbooks, custom ingestion scripts, and automated case enrichment. Scope API tokens with least-privilege RBAC roles and organization/TLP boundaries.
Curate Before Blocking: Raw OSINT feeds often include shared cloud egress IPs, CDN nodes, or stale infrastructure. Always enforce confidence thresholds, indicator decay rules, and allowlist checks in OpenCTI before pushing indicators into automated firewall or EDR block policies.

3. Practical OpenCTI, STIX 2.1 & SIEM Integration Examples (10 Scenarios)

Example 1: Checking OpenCTI Platform & Connector Stack Health (Bash / Docker)

Bash (docker) — Verifying OpenCTI Core Services, Workers & Connectors
docker compose ps --format "table {{.Name}}\t{{.Status}}" | grep -E "opencti|worker|connector|elastic|rabbit"
SAMPLE OUTPUT
opencti-platform-1           Up 6 days (healthy)
opencti-worker-1             Up 6 days
opencti-connector-mitre-1    Up 6 days
opencti-elasticsearch-1      Up 6 days (healthy)
opencti-rabbitmq-1           Up 6 days (healthy)

Example 2: Querying an Observable via OpenCTI GraphQL API (Bash / curl)

Bash (curl) — Looking Up an IPv4 Observable & Confidence Score via GraphQL
curl -s -X POST "https://opencti.example.internal/graphql" \
  -H "Authorization: Bearer $OPENCTI_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"query":"query { stixCyberObservables(search: \"198.51.100.77\") { edges { node { id observable_value x_opencti_score } } } }"}'
SAMPLE OUTPUT
{"data":{"stixCyberObservables":{"edges":[{"node":{"id":"ipv4-addr--9a14...","observable_value":"198.51.100.77","x_opencti_score":85}}]}}}

Example 3: Building a STIX 2.1 Indicator & Relationship Bundle in Python

Python — Constructing a Valid STIX 2.1 Indicator Linked to a Malware Entity
import json, uuid

malware_id = f"malware--{uuid.uuid4()}"
indicator_id = f"indicator--{uuid.uuid4()}"

bundle = {
    "type": "bundle",
    "id": f"bundle--{uuid.uuid4()}",
    "objects": [
        {"type": "malware", "spec_version": "2.1", "id": malware_id, "name": "LummaStealer", "is_family": True},
        {
            "type": "indicator",
            "spec_version": "2.1",
            "id": indicator_id,
            "pattern": "[domain-name:value = 'cdn-update-sync.example']",
            "pattern_type": "stix",
            "valid_from": "2026-11-26T00:00:00Z",
            "confidence": 85
        },
        {
            "type": "relationship",
            "spec_version": "2.1",
            "id": f"relationship--{uuid.uuid4()}",
            "relationship_type": "indicates",
            "source_ref": indicator_id,
            "target_ref": malware_id
        }
    ]
}

print("STIX 2.1 objects prepared:", len(bundle["objects"]))
SAMPLE OUTPUT
STIX 2.1 objects prepared: 3

Example 4: Enriching an Alert Observable Using the Python pycti Client

Python (pycti) — Querying Indicator Context & Labels for SOAR Triage
from pycti import OpenCTIApiClient

client = OpenCTIApiClient("https://opencti.example.internal", "TOKEN_REDACTED")
indicators = client.indicator.list(search="cdn-update-sync.example", first=1)

for ind in indicators:
    labels = [l["value"] for l in ind.get("objectLabel", [])]
    print(f"Pattern: {ind['pattern']} | Confidence: {ind['confidence']} | Labels: {labels}")
SAMPLE OUTPUT
Pattern: [domain-name:value = 'cdn-update-sync.example'] | Confidence: 85 | Labels: ['c2', 'infostealer']

Example 5: Polling an OpenCTI TAXII 2.1 Collection Endpoint (Bash / curl)

Bash (curl) — Fetching High-Confidence STIX Indicators via TAXII 2.1
curl -s -H "Authorization: Bearer $OPENCTI_TOKEN" \
     -H "Accept: application/taxii+json;version=2.1" \
     "https://opencti.example.internal/taxii2/root/collections/soc-high-conf/objects/?limit=2" | head -c 210
SAMPLE OUTPUT
{"more":true,"objects":[{"type":"indicator","spec_version":"2.1","id":"indicator--44f2...","pattern":"[ipv4-addr:value = '198.51.100.77']","confidence":90}]}

Example 6: Correlating OpenCTI Threat Intelligence Indicators in Microsoft Sentinel (KQL)

KQL (Microsoft Sentinel) — Matching Streamed OpenCTI IOCs Against DNS & Network Logs
let ActiveCTI = ThreatIntelligenceIndicator
| where TimeGenerated > ago(7d)
| where SourceSystem has "OpenCTI" and Active == true and ConfidenceScore >= 75
| summarize arg_max(TimeGenerated, *) by IndicatorId;
DnsEvents
| where TimeGenerated > ago(24h)
| join kind=inner (ActiveCTI | where isnotempty(DomainName)) on $left.Name == $right.DomainName
| project TimeGenerated, Computer, ClientIP, QueryName = Name, ThreatType, ConfidenceScore, Description
SAMPLE OUTPUT
TimeGenerated        Computer     ClientIP    QueryName               ThreatType ConfidenceScore
-------------        --------     --------    ---------               ---------- ---------------
2026-11-26T17:52:14Z WKSTN-MKT-08 10.20.12.34 cdn-update-sync.example Malicious  85

Example 7: Filtering Expired or Low-Confidence Indicators Before Export (Python)

Python — Applying Confidence & Expiration Gates to Curated Feed Exports
from datetime import datetime

as_of = datetime.strptime("26-Nov-2026", "%d-%b-%Y")
feed = [
    {"ioc": "198.51.100.77", "confidence": 90, "valid_until": "15-Dec-2026"},
    {"ioc": "203.0.113.19",  "confidence": 40, "valid_until": "15-Dec-2026"},
    {"ioc": "192.0.2.55",    "confidence": 85, "valid_until": "01-Nov-2026"},
]

exportable = [
    x["ioc"] for x in feed
    if x["confidence"] >= 75 and datetime.strptime(x["valid_until"], "%d-%b-%Y") >= as_of
]
print("Approved for SIEM export:", exportable)
SAMPLE OUTPUT
Approved for SIEM export: ['198.51.100.77']

Example 8: Velociraptor VQL — Hunting a Known Malicious File Hash from OpenCTI

VQL (Velociraptor) — Checking Suspicious User Directories for a Curated SHA-256 Hash
SELECT
  FullPath,
  Size,
  hash(path=FullPath).SHA256 AS SHA256
FROM glob(globs=["C:/Users/*/Downloads/*", "/tmp/*"])
WHERE SHA256 = "8f42e9c1b07d6a543210fedcba9876543210abcdef0123456789abcdef012345"
SAMPLE OUTPUT
FullPath                              Size   SHA256
--------                              ----   ------
C:/Users/a.sharma/Downloads/setup.exe 412672 8f42e9c1b07d6a543210fedcba9876543210abcdef0123456789abcdef012345

Example 9: Wazuh Rule — Alerting on OpenCTI CDB List Indicator Matches

XML (Wazuh Rule) — Matching Network / Proxy Domains Against Exported OpenCTI List

  
    31100
    etc/lists/opencti-domains
    OpenCTI high-confidence malicious domain matched in web/proxy log
  
SAMPLE OUTPUT
** Alert 1795732410.44918: - local,opencti,threat_intel
2026 Nov 26 17:58:19 (proxy-gw-01) 10.20.1.15->/var/log/squid/access.log
Rule: 102510 (level 12) -> 'OpenCTI high-confidence malicious domain matched in web/proxy log'

Example 10: Summarizing Ingested STIX Entity Distribution in Python

Python — Auditing STIX 2.1 Object Counts by Entity Type
from collections import Counter

stix_objects = [
    {"type": "indicator"}, {"type": "indicator"}, {"type": "malware"},
    {"type": "intrusion-set"}, {"type": "attack-pattern"}, {"type": "relationship"},
]

for obj_type, count in Counter(o["type"] for o in stix_objects).items():
    print(f"{obj_type}: {count}")
SAMPLE OUTPUT
indicator: 2
malware: 1
intrusion-set: 1
attack-pattern: 1
relationship: 1

4. Interactive OpenCTI Workflow & Intelligence Pipeline Simulator

Select a CTI operational scenario below to review recommended OpenCTI configuration and triage actions:

← Previous: 7.12 Immutable Cyber Recovery Vaults 7.14 Dark Web Monitoring & Ransomware Leaks →