Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:7onez Cti expert Intel Cmd Clusters

From Leeroopedia
Knowledge Sources
Domains OSINT, Attribution, Pipeline
Last Updated 2026-10-28 14:00 GMT

Overview

Concrete tool for partitioning a case into same-operator components from the KB without collecting anything (pure KB read), provided by the cti-expert deterministic pipeline.

Description

The cmd_clusters function in intel.py reads a case's KB and partitions its hosts into same-operator components using _write_clusters. It is the unit of judgment: run it before correlating a big case so each cluster is judged on its own evidence instead of one unfocused pass over every domain. _write_clusters calls query._components with the case's noise IPs and analyst-approved edges, then enriches each component with its binding indicators (the edges that actually formed it).

The function persists cases/<case>/clusters.json with: per-cluster domains, binding indicators (display + machine key + rels + domains in cluster + KB-wide domain count), corroboration (ONE shared artifact is a LEAD, TWO independent ones make a cluster), and related_hosts (hosts at the expansion depth, owner-linked to a previous hop, never cluster members).

Usage

Import this when you need to:

  • Partition a case into clusters without re-collecting (pure KB read).
  • Persist the cluster partition for the judgment phase.
  • See which indicators bind each cluster and the corroboration level (LEAD vs. confirmed).

Code Reference

Source Location

  • Repository: cti-expert
  • File: intel_engine/tools/intel.py
  • Lines: L1712-1738 (cmd_clusters), L966-1096 (_write_clusters)

Signature

def cmd_clusters(a):
    """Partition a case into same-operator components WITHOUT collecting anything.
    CLI: intel.py clusters <case> [--min N] [--max-prevalence N] [--json] [--all]

def _write_clusters(case_dir, case, hosts=None, min_shared=2, max_prevalence=8) -> list:
    """Partition + persist clusters.json with binding indicators + corroboration."""

Import

# CLI: python3 intel_engine/tools/intel.py clusters <case> [--min 2] [--json]

I/O Contract

Inputs (CLI Args)

Name Type Required Description
case str Yes Case ID
min int No /// Min shared indicators (default 2)
max_prevalence int No /// Prevalence ceiling (default 8)
json bool No /// Output JSON instead of text
all bool No /// Show singletons too

Outputs

Name Type Description
clusters.json file Per-cluster domains, binding indicators, corroboration, related_hosts
(stdout) text /// Per-cluster summary with binding + corroboration flag

Usage Examples

Partition and Persist

python3 intel_engine/tools/intel.py clusters CASE-0001 --min 2 --max-prevalence 8
# Output:
#   clusters: 3 component(s) over 12 host(s) — 2 multi-domain, 1 singleton
#      c1 (5): example.com, site-a.example, ... via email:registrant@example.com  [2 artifact(s)]
#      c2 (4): ...

JSON Output

python3 intel_engine/tools/intel.py clusters CASE-0001 --json

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment