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 Binary Auto Ingest

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

Overview

Concrete tool for ingesting binary analysis JSON into the KB with completeness-gate re-checking and REA node registration, provided by the cti-expert pipeline integration module.

Description

The ingest function in binary_auto.py reads binary analysis JSONs from <case>/bin/analysis/, re-checks the completeness gate (_complete), and ingests only docs that pass. This prevents a truncated or forged JSON left on disk by an interrupted run from reaching the KB on a later pass — the gate guards BOTH save and ingest. It then registers REA nodes for the cross-type loop's node registry via register_rea_nodes.

The function invokes ingest_webpivot.ingest_file via subprocess for each complete JSON — the same adapter used for web evidence. Binary IOCs (domains, IPs, hashes, wallets, certs) become KB entities and edges that cross-correlate with web infrastructure on shared indicators.

Usage

Import this when you need to:

  • Ingest binary analysis JSON into the KB (separate from web raw/ evidence).
  • Re-check the completeness gate before ingesting (interrupted-run safety).
  • Register REA nodes for the cross-type harness loop.

Code Reference

Source Location

  • Repository: cti-expert
  • File: intel_engine/tools/binary_auto.py
  • Lines: L206-231

Signature

def ingest(case_dir, kb):
    """Ingest binary evidence separately; raw/ remains exclusively web-host evidence.
    Only docs that still pass the completeness gate are ingested. Returns (ok, note)."""

Import

from binary_auto import ingest

I/O Contract

Inputs

Name Type Required Description
case_dir str Yes /// Case directory (reads bin/analysis/*.json)
kb str Yes /// KB root path

Outputs

Name Type Description
ok bool True if all complete JSONs ingested successfully
note str stdout + stderr from ingest + REA registration

Usage Examples

Ingest Binary Evidence

from binary_auto import ingest

ok, note = ingest("cases/CASE-0001", "intel_engine/knowledge")
if ok:
    print("binary evidence ingested")
    print(note)  # includes REA node registration output
else:
    print(f"ingest failed: {note}")

Related Pages

Implements Principle

Requires Environment

Page Connections

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