# rhythm113/eclipse-agent architecture

> Architecture diagram of the GitHub repository rhythm113/eclipse-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rhythm113/eclipse-agent
- Repository: https://github.com/rhythm113/eclipse-agent

## Overview

Eclipse is a Linux endpoint security agent that monitors hosts, reports telemetry to a security server, and can intervene locally during exploitation. The main runtime path starts at the agent entry point, enrolls an identity, then runs a session that starts collectors and exchanges events with the server. Separately, the memory-forensics sensor can freeze a process in-kernel while the agent evaluates the signal, captures evidence, and applies configured action. The README documents major capabilities not fully sampled; relationships below rely on those statements where source excerpts are unavailable.

Main entry points: [`agent/src/transport/session.cpp`](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/transport/session.cpp) (Session runtime), [`agent/src/memf/engine.cpp`](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/memf/engine.cpp) (Signal decisions), [`agent/src/main.cpp`](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/main.cpp) (Agent commands), [`agent/bpf/memforensics.bpf.c`](https://github.com/rhythm113/eclipse-agent/blob/main/agent/bpf/memforensics.bpf.c) (Memory sensor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Agent runtime"]
  node_entry["Agent commands<br/>[main.cpp]"]
  node_session["Session runtime<br/>[session.cpp]"]
end

subgraph group_monitor["Host monitoring"]
  node_collector_hub["Collector framework<br/>[collector.hpp]"]
  node_host_collectors["Host collectors"]
  node_db_collectors["Database capture<br/>[mysql.cpp]"]
  node_edr_kernel["EDR eBPF sensor<br/>[edr.bpf.c]"]
  node_edr_agent["EDR event handling<br/>[edr.cpp]"]
end

subgraph group_defense["Exploit defense"]
  node_memf_kernel["Memory sensor<br/>[memforensics.bpf.c]"]
  node_memf_engine["Signal decisions<br/>[engine.cpp]"]
  node_memf_probe["Probe control<br/>[probe_bpf.cpp]"]
  node_evidence["Evidence collection<br/>[collect.cpp]"]
end

subgraph group_connectivity["Server connectivity"]
  node_enrollment["Enrollment<br/>[enroll.cpp]"]
  node_transport["Secure transport<br/>[session.cpp]"]
  node_spool[("Telemetry spool<br/>[spool.cpp]")]
end

subgraph group_operations["Host operations"]
  node_actions["Host response<br/>[runner.cpp]"]
  node_ssh["Emergency SSH<br/>[master.cpp]"]
  node_setup["Setup wizard<br/>[wizard.cpp]"]
end

node_operator(("Host operator"))
node_server(("SOC server"))

node_operator -->|"runs commands"| node_entry
node_entry -->|"enrolls identity"| node_enrollment
node_entry -->|"starts session"| node_session
node_session -->|"starts collectors"| node_collector_hub
node_collector_hub -->|"runs collection"| node_host_collectors
node_session -->|"registers capture"| node_db_collectors
node_edr_kernel -->|"emits events"| node_edr_agent
node_session -->|"starts monitoring"| node_edr_agent
node_memf_kernel -->|"freezes process"| node_memf_probe
node_memf_kernel -->|"writes ring events"| node_memf_engine
node_memf_probe -->|"feeds records"| node_memf_engine
node_memf_engine -.->|"triggers capture"| node_evidence
node_evidence -->|"uploads bundle"| node_server
node_memf_engine -.->|"guides response"| node_actions
node_session -->|"exchanges telemetry"| node_transport
node_transport -->|"sends events"| node_server
node_session -->|"stores batches"| node_spool
node_server -->|"sends commands"| node_session
node_session -->|"dispatches actions"| node_actions
node_operator -->|"configures agent"| node_setup
node_session -->|"opens console"| node_ssh

click node_entry "https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/main.cpp"
click node_enrollment "https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/enroll/enroll.cpp"
click node_session "https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/transport/session.cpp"
click node_collector_hub "https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/collectors/collector.hpp"
click node_host_collectors "https://github.com/rhythm113/eclipse-agent/tree/main/agent/src/collectors"
click node_db_collectors "https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/collectors/mysql.cpp"
click node_edr_kernel "https://github.com/rhythm113/eclipse-agent/blob/main/agent/bpf/edr.bpf.c"
click node_edr_agent "https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/edr/edr.cpp"
click node_memf_kernel "https://github.com/rhythm113/eclipse-agent/blob/main/agent/bpf/memforensics.bpf.c"
click node_memf_engine "https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/memf/engine.cpp"
click node_memf_probe "https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/memf/probe_bpf.cpp"
click node_evidence "https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/memf/collect.cpp"
click node_actions "https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/actions/runner.cpp"
click node_transport "https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/transport/session.cpp"
click node_spool "https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/transport/spool.cpp"
click node_ssh "https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/ssh/master.cpp"
click node_setup "https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/setup/wizard.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_session toneBlue
class node_collector_hub,node_host_collectors,node_db_collectors,node_edr_kernel,node_edr_agent toneAmber
class node_memf_kernel,node_memf_engine,node_memf_probe,node_evidence,node_server toneMint
class node_enrollment,node_transport,node_spool toneRose
class node_actions,node_ssh,node_setup,node_operator toneIndigo
```

## Components

### Agent runtime

- [Agent commands](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/main.cpp): `agent/src/main.cpp`
- [Session runtime](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/transport/session.cpp): `agent/src/transport/session.cpp`

### Host monitoring

- [Collector framework](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/collectors/collector.hpp): `agent/src/collectors/collector.hpp`
- [Host collectors](https://github.com/rhythm113/eclipse-agent/tree/main/agent/src/collectors): `agent/src/collectors`
- [Database capture](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/collectors/mysql.cpp): `agent/src/collectors/mysql.cpp`
- [EDR eBPF sensor](https://github.com/rhythm113/eclipse-agent/blob/main/agent/bpf/edr.bpf.c): `agent/bpf/edr.bpf.c`
- [EDR event handling](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/edr/edr.cpp): `agent/src/edr/edr.cpp`

### Exploit defense

- [Memory sensor](https://github.com/rhythm113/eclipse-agent/blob/main/agent/bpf/memforensics.bpf.c): `agent/bpf/memforensics.bpf.c`
- [Signal decisions](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/memf/engine.cpp): `agent/src/memf/engine.cpp`
- [Probe control](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/memf/probe_bpf.cpp): `agent/src/memf/probe_bpf.cpp`
- [Evidence collection](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/memf/collect.cpp): `agent/src/memf/collect.cpp`

### Server connectivity

- [Enrollment](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/enroll/enroll.cpp): `agent/src/enroll/enroll.cpp`
- [Secure transport](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/transport/session.cpp): `agent/src/transport/session.cpp`
- [Telemetry spool](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/transport/spool.cpp): `agent/src/transport/spool.cpp`

### Host operations

- [Host response](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/actions/runner.cpp): `agent/src/actions/runner.cpp`
- [Emergency SSH](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/ssh/master.cpp): `agent/src/ssh/master.cpp`
- [Setup wizard](https://github.com/rhythm113/eclipse-agent/blob/main/agent/src/setup/wizard.cpp): `agent/src/setup/wizard.cpp`

### Other components

- **Host operator**
- **SOC server**

## Connections

- Host operator → Agent commands: runs commands (evidence: `agent/src/main.cpp`)
- Agent commands → Enrollment: enrolls identity (evidence: `agent/src/main.cpp`)
- Agent commands → Session runtime: starts session (evidence: `agent/src/main.cpp`)
- Session runtime → Collector framework: starts collectors (evidence: `agent/src/transport/session.cpp`)
- Collector framework → Host collectors: runs collection (evidence: `agent/src/collectors/collector.hpp`)
- Session runtime → Database capture: registers capture (evidence: `agent/src/transport/session.cpp`)
- EDR eBPF sensor → EDR event handling: emits events
- Session runtime → EDR event handling: starts monitoring (evidence: `agent/src/transport/session.cpp`)
- Memory sensor → Probe control: freezes process
- Memory sensor → Signal decisions: writes ring events
- Probe control → Signal decisions: feeds records
- Signal decisions → Evidence collection: triggers capture
- Evidence collection → SOC server: uploads bundle
- Signal decisions → Host response: guides response
- Session runtime → Secure transport: exchanges telemetry (evidence: `agent/src/transport/session.cpp`)
- Secure transport → SOC server: sends events
- Session runtime → Telemetry spool: stores batches (evidence: `agent/src/transport/session.cpp`)
- SOC server → Session runtime: sends commands
- Session runtime → Host response: dispatches actions
- Host operator → Setup wizard: configures agent
- Session runtime → Emergency SSH: opens console (evidence: `agent/src/transport/session.cpp`)
