Forensics & Defense·6 min read·docs/forensics.md

Forensics, Memory & IOC Hunting

Kernel live, Firewall live, per-process VMA/FD/NS memory analyzer, Host DFIR sweep, IOC hunter, and STIX/SARIF exports.

Interactive Guide LabRing 0/3 VMA, FIM, IOC & DFIR
Live Interactive Console SandboxInteractiveNo backend required

Click any isometric Linux node, simulate an AI prompt-injection probe, inspect Ring 0 eBPF hooks, and seal a case directly in your browser.

● TETRAGON 1.8.05 PQ TUNNELS5 EVENTS
Scope: selected=ai-gpu-01
User Space · Ring 3
Syscall / eBPF Boundary · Tetragon
security_file_open + tcp_connect
Cannot be prompt-injected from Ring 3 · 4 observed transitions
Ring 3 PID 4182 → eBPF verifier → kernel:lsm / kernel:net
Kernel Space · Ring 0 & VMA Check
kernel:lsm / kernel:net
AI Coding Agent (Prompt-Injected)
1 anonymous RWX region (0x7f4c0000 · memfd:stage2 · deleted)
Read-only /proc/<pid>/maps inspection — Ometsuke never opens /proc/<pid>/mem.

Ometsuke pairs Cilium Tetragon's live eBPF telemetry with read-only Linux /proc and host-artifact inspection. Security engineers and MCP-connected AI agents can inspect kernel/user topology, live network verdicts, virtual memory areas (VMAs), open descriptors, namespace isolation, kernel taint, persistence vectors, SUID surfaces, and custom IOCs — without running the console as root or enabling automatic enforcement.

flowchart LR
  subgraph sources["Read-Only Linux Host & eBPF Sources"]
    t["Tetragon v1.8.0 gRPC\n(exec, kprobe, lsm)"]
    p["/proc/<pid>/{stat,status,maps,\nsmaps_rollup,fd,ns,exe}"]
    n["/proc/net/{tcp,tcp6,udp}\n& cgroup v2 gates"]
    h["/proc/sys/kernel/*, /proc/modules,\ncron, systemd, ld.so.preload, SUID"]
  end
  subgraph engines["Pure Domain Engines (internal/domain)"]
    km["kernelmap\nRing 0/3 & eBPF bridges"]
    fw["firewallmap\nWorkloads, verdicts & risk classes"]
    mm["memmap\nVMA, W^X, memfd, FDs, NS, SHA-256"]
    df["forensics\nTaint, Hidden PIDs, Persistence,\nSUID, Multi-Pillar IOC Hunter"]
    hd["hardening\nCIS/KSPP posture"]
  end
  subgraph views["Console Views, Exports & 22 MCP Tools"]
    ui["/kernel-live · /protection/egress/live\n/memory · /forensics · /policies/hardening"]
    ex["JSON · Markdown IR · STIX 2.1\nSARIF 2.1.0 · Signed .tar.gz Bundle"]
    mcp["/mcp (20 read-only + 2 proposal)"]
  end
  t --> km & fw & mm & df
  p --> km & mm & df
  n --> fw
  h --> hd & df
  km & fw & mm & df & hd --> ui & ex & mcp

#1. Real-time visual observatories

ScreenHTTP APIMCP toolCapabilities
Kernel live (/kernel-live)GET /api/v1/kernel/livekernel_live3-zone SVG topology connecting User Space (Ring 3) → Syscall / eBPF Hook Boundary → Kernel Space (Ring 0 kthreadd subsystems), live SSE ticker, indented PPID → PID process tree, loaded /proc/modules table, and 1-click pivot to Memory forensics
Firewall live (/protection/egress/live)GET /api/v1/firewall/livefirewall_live3-zone SVG topology connecting Workloads & Containers → eBPF Firewall Verdict Gate (BLOCKED, FLAGGED, OBSERVED, ALLOWED) → Destinations & Risk Classes (cloud-imds, c2-stratum, ssh-lateral, external, private-lan, loopback), live network SSE ticker, listening sockets (EXPOSED vs LOOPBACK), and workload cgroup gates
Kernel hardening (/policies/hardening)GET /api/v1/hardening/posturehardening_postureLive CIS/KSPP sysctl & LSM posture audit (kptr_restrict, yama.ptrace_scope, unprivileged_bpf_disabled, bpf_jit_harden, kexec_load_disabled, io_uring_disabled, kernel_lockdown, etc.) paired with 24 curated monitor-first kernel hardening TracingPolicies
Incident timeline (/threats/timeline)GET /api/v1/incidents/timelineincident_timelineChronologically correlated MITRE ATT&CK kill-chain stories per container/host workload with Markdown and JSON export

#2. Per-process memory forensics (/memory, /memory/:pid)

  • Endpoints: GET /api/v1/memory/processes (memory_processes) and GET /api/v1/memory/processes/{pid} (memory_process).
  • Strict safety boundary: Ometsuke inspects only read-only metadata (/proc/<pid>/{maps,smaps_rollup,status,fd,ns,exe}). It never opens /proc/<pid>/mem or dumps raw process heap/stack secrets.
  • Visual analysis: Displays a proportional physical RAM composition strip (Private dirty, Private clean, Shared clean, Shared dirty, Swap, RSS, PSS, VmSize, Anon), a 64-bit clickable VMA band map, an explicit [R][W][X][P/S] bit matrix, cached executable SHA-256 digest, Open FDs table, 7 Linux Namespaces compared against PID 1, and correlated Tetragon eBPF memory hooks (memfd_create, mprotect, ptrace, process_vm_writev, mmap, userfaultfd).

#Automatic memory & process-artifact detections

CodeSeverityMITREWhat it detects
MEMFD_EXECcriticalT1620Executable memory-only /memfd:* mapping (fileless payload staging)
HEAP_OR_STACK_EXECcriticalT1055Executable [heap] or [stack] segment (NX/DEP violation)
ANON_EXECcritical / highT1055.012Unbacked anonymous executable mapping (rwxp or r-xp, shellcode / unapproved JIT)
RWX_MAPPINGhighT1055Simultaneous write + execute (rwxp/rwxs) mapping violating W^X separation
DELETED_EXEChighT1055Executable or shared object mapped (deleted) after unlinking on disk
DELETED_BINARY_EXEhighT1070.004Running process executable (/proc/<pid>/exe) unlinked from disk
TMP_SHARED_OBJECThighT1574.006Executable or .so loaded from /tmp/, /dev/shm/, or /var/tmp/
SENSITIVE_OPEN_FDhighT1003Open descriptor to /etc/shadow, docker.sock, containerd.sock, /dev/mem, /proc/kcore, .ssh/, .aws/
CONTAINER_HOST_NShighT1611Containerized process sharing host PID 1 pid, net, or mnt namespace
DELETED_OPEN_FDmediumT1070.004Open file descriptor holding an unlinked file on disk
CONTAINER_PTY_WITH_SOCKETmediumT1059Container process holding both /dev/pts/* and an active socket
CAP_PRIV_NO_SECCOMPmediumT1068Non-zero CapEff with Seccomp disabled and NoNewPrivs=0 alongside active anomalies

#3. Host-wide DFIR sweep and multi-pillar IOC hunter (/forensics)

#Host DFIR sweep (GET /api/v1/forensics/sweep, forensics_sweep)

  1. Kernel taint decoder: Decodes /proc/sys/kernel/tainted bitmask (bits 0–17: proprietary P, forced load F, forced unload R, kernel oops D, out-of-tree O, unsigned E, livepatch K, etc.).
  2. Hidden PID cross-view: Compares readdir(/proc) against direct /proc/<pid>/stat probes for observed PIDs to flag potential LKM getdents64 rootkits hiding live processes.
  3. Persistence hunter: Audits /etc/ld.so.preload (T1574.006), /etc/crontab, /etc/cron.d/* (T1053.003), /etc/systemd/system/*.{service,timer} (T1543.002), /etc/rc.local (T1546.004), and /root/.ssh/authorized_keys (T1098.004, key counts and key types only — private keys are never read).
  4. SUID / SGID scanner: Scans /usr/bin, /usr/sbin, /bin, /sbin, /tmp, /var/tmp, and /dev/shm for setuid/setgid executables, flagging GTFOBins abuse binaries and any SUID binary in temp directories (T1548.001).
  5. Chain of custody: Stamps every host sweep with a deterministic SHA-256 digest (chain_hash_sha256).

#Multi-pillar IOC hunter & persistent watchlist (GET /api/v1/forensics/ioc-scan, forensics_ioc_scan)

Hunts 8 built-in threat-intel rules (Cloud IMDS 169.254.169.254, Stratum/C2 ports 3333/4444/5555/14444/45700, Tor SOCKS 9050/9150, fileless memfd:, /etc/ld.so.preload, /etc/shadow, docker.sock, volatile temp paths), persistent SQLite IOC watchlist entries (/api/v1/forensics/watchlist with JSON, CSV, and STIX 2.1 bulk import), and ad-hoc operator indicators (ips, ports, hashes ≥ 12-char SHA-256 prefixes, patterns) simultaneously across live ledger, running process memory/hashes, network flows/listeners, persistence, and SUID artifacts. Active watchlist indicators are also matched in real time during live Tetragon ingestion, recording watchlist_hit audit entries.

#Baseline drift, Binary FIM, DNS tunneling & cryptographic chain

  • Persistent DFIR history & drift diff (GET /api/v1/forensics/history, GET /api/v1/forensics/diff, POST /api/v1/forensics/snapshot, forensics_diff): Stores scheduled (-dfir-interval) and on-demand host sweep and hardening posture snapshots in SQLite. Diffs newly added/removed kernel modules, persistence entries, SUID binaries, hidden PIDs, and kernel taint transitions, writing a dfir_drift audit entry on change.
  • Binary FIM & OverlayFS drift (GET /api/v1/forensics/fim, forensics_fim): Computes read-only SHA-256 digests of critical host binaries (/usr/bin/sudo, /usr/sbin/sshd, /usr/local/bin/tetragon, /usr/local/bin/ometsuke, etc.), compares them against prior snapshots, and inspects container OverlayFS upperdirs for unexpected executable modifications.
  • DNS / high-entropy tunneling (GET /api/v1/forensics/dns): Correlates port-53 network traffic and CLI resolvers (dig, nslookup, curl, wget) in the ledger, scoring Shannon entropy, deep label counts, and long subdomains for exfiltration / DNS tunneling (T1071.004).
  • Tamper-evident audit hash-chain (GET /api/v1/audit/verify, ometsuke verify-audit, audit_verify): Every row in the append-only SQLite audit log chains SHA-256(prev_hash || canonical_fields). Offline or API verification detects any deletion, truncation, or out-of-band modification.

#Standard incident-response exports

FormatTriggerUse case
JSON bundleJSON button on /memory or /forensicsFull structured evidence payload with chain_hash_sha256
Markdown IR (.md)IR (.md) button on /memory or /forensicsHuman-readable incident ticket / SOC handoff report
STIX 2.1STIX 2.1 button on /forensicsapplication/stix+json bundle (identity, note, indicator with MITRE ATT&CK references) for SIEM/SOAR/MISP
SARIF 2.1.0SARIF button on /forensicsapplication/sarif+json security log for GitHub Advanced Security & automated triage
Signed Evidence Bundle (.tar.gz)Bundle (.tar.gz) button or GET /api/v1/forensics/bundleDeterministic forensic archive bundling REPORT.md, sweep/IOC/hardening/audit-chain JSONs, STIX 2.1, SARIF 2.1.0, MANIFEST.sha256, and optional Ed25519 signature (MANIFEST.sig + SIGNING_KEY.pub when OMETSUKE_SIGNING_KEY is configured)

#4. Non-root Linux capability model

Reading another user's /proc/<pid>/maps requires CAP_SYS_PTRACE, and reading another user's /proc/<pid>/fd requires CAP_DAC_READ_SEARCH. Without them, Ometsuke degrades gracefully (reporting accessible PIDs and world-readable /proc/<pid>/status) and displays an operator banner.

To grant full cross-UID read-only forensics without running as root, install the optional systemd drop-in deploy/systemd/ometsuke-forensics.conf:

sh
sudo install -d -m 0755 /etc/systemd/system/ometsuke.service.d
sudo install -o root -g root -m 0644 deploy/systemd/ometsuke-forensics.conf \
  /etc/systemd/system/ometsuke.service.d/forensics.conf
sudo systemctl daemon-reload && sudo systemctl restart ometsuke.service

#5. SOC investigation runbook

  1. Start in Kernel live (/kernel-live) or Firewall live (/protection/egress/live) to spot anomalous eBPF hook spikes or flagged outbound connections (cloud IMDS, C2 / Stratum, SSH lateral).
  2. Pivot straight from a suspicious Ring 3 process into Memory forensics (/memory/:pid) to inspect its VMA layout, executable SHA-256, W^X violations, open FDs, and container namespace isolation.
  3. Open DFIR sweep (/forensics) to verify kernel taint, hidden PIDs, persistence vectors, and SUID surface, then run a custom IOC hunter query across the whole host using the observed SHA-256 or destination IP.
  4. Export the sealed STIX 2.1 / SARIF / Markdown IR bundle, and load any required monitor-first TracingPolicy from the 108-template Policy catalog (/policies/load?catalog=1) with an explicit human seal.