# microsoft/sysmon-linux architecture

> Architecture diagram of the GitHub repository microsoft/sysmon-linux, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/microsoft/sysmon-linux
- Repository: https://github.com/microsoft/sysmon-linux

## Overview

Sysmon for Linux monitors process, file-system, and network activity with eBPF, then processes and logs events; SysmonLogView makes the output easier to read and filter. The principal workflow is kernel activity capture, event handling, and log output. Separate runtime concerns include installation and network tracking. The README documents filtering, BTF-based offset discovery, and the log viewer; source excerpts are incomplete, so uncertain runtime wiring is omitted or marked unverified.

Main entry points: [`sysmonforlinux.c`](https://github.com/microsoft/sysmon-linux/blob/main/sysmonforlinux.c) (Sysmon event processor), [`ebpfKern`](https://github.com/microsoft/sysmon-linux/tree/main/ebpfKern) (Activity probes), [`sysmonLogView/sysmonLogView.cpp`](https://github.com/microsoft/sysmon-linux/blob/main/sysmonLogView/sysmonLogView.cpp) (SysmonLogView), [`ebpfKern/sysmonHelpers.c`](https://github.com/microsoft/sysmon-linux/blob/main/ebpfKern/sysmonHelpers.c) (Event helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Kernel Capture"]
  node_bpf_loader["eBPF loader<br/>[sysmonBPFLoad.c]"]
  node_bpf_common[("eBPF maps")]
  node_bpf_helpers["Event helpers<br/>[sysmonHelpers.c]"]
  node_activity_probes["Activity probes"]
end

subgraph group_runtime["Event Runtime"]
  node_sysmon["Sysmon event processor<br/>[sysmonforlinux.c]"]
  node_network_tracker["Network tracker<br/>[networkTracker.cpp]"]
  node_xml_output["XML output<br/>[outputxml.cpp]"]
  node_configuration["Configuration and filtering<br/>[sysmonforlinux.c]"]
end

subgraph group_support["System Support"]
  node_installer["Installer<br/>[installer.c]"]
  node_linux_helpers["Linux helpers<br/>[linuxHelpers.cpp]"]
  node_event_definitions["Event definitions<br/>[sysmon_defs.h]"]
end

subgraph group_viewer["Log Viewing"]
  node_log_viewer["SysmonLogView<br/>[sysmonLogView.cpp]"]
  node_event_names["Event-name lookup"]
end

node_operator(("System operator"))
node_kernel(("Linux kernel"))
node_system_log[("System log")]
node_user(("Log reader"))

node_kernel -.->|"triggers probes"| node_activity_probes
node_activity_probes -->|"use maps"| node_bpf_common
node_bpf_helpers -->|"lookup event storage"| node_bpf_common
node_activity_probes -.->|"emit events"| node_bpf_helpers
node_bpf_loader -.->|"loads programs"| node_activity_probes
node_activity_probes -.->|"deliver events"| node_sysmon
node_sysmon -->|"uses tracker"| node_network_tracker
node_sysmon -->|"uses helpers"| node_linux_helpers
node_sysmon -->|"uses installer"| node_installer
node_sysmon -->|"uses definitions"| node_event_definitions
node_sysmon -->|"parses rules"| node_configuration
node_sysmon -.->|"formats output"| node_xml_output
node_sysmon -.->|"writes events"| node_system_log
node_system_log -->|"reads output"| node_log_viewer
node_log_viewer -.->|"looks up names"| node_event_names
node_user -->|"filters output"| node_log_viewer
node_operator -.->|"configures monitoring"| node_sysmon

click node_bpf_loader "https://github.com/microsoft/sysmon-linux/blob/main/ebpfKern/sysmonBPFLoad.c"
click node_bpf_common "https://github.com/microsoft/sysmon-linux/blob/main/ebpfKern/sysmonEBPF_common.h"
click node_bpf_helpers "https://github.com/microsoft/sysmon-linux/blob/main/ebpfKern/sysmonHelpers.c"
click node_activity_probes "https://github.com/microsoft/sysmon-linux/tree/main/ebpfKern"
click node_sysmon "https://github.com/microsoft/sysmon-linux/blob/main/sysmonforlinux.c"
click node_network_tracker "https://github.com/microsoft/sysmon-linux/blob/main/networkTracker.cpp"
click node_xml_output "https://github.com/microsoft/sysmon-linux/blob/main/outputxml.cpp"
click node_configuration "https://github.com/microsoft/sysmon-linux/blob/main/sysmonforlinux.c"
click node_installer "https://github.com/microsoft/sysmon-linux/blob/main/installer.c"
click node_linux_helpers "https://github.com/microsoft/sysmon-linux/blob/main/linuxHelpers.cpp"
click node_event_definitions "https://github.com/microsoft/sysmon-linux/blob/main/sysmon_defs.h"
click node_log_viewer "https://github.com/microsoft/sysmon-linux/blob/main/sysmonLogView/sysmonLogView.cpp"
click node_event_names "https://github.com/microsoft/sysmon-linux/blob/main/sysmonLogView/sysmonGetEventName.c"

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_bpf_loader,node_bpf_common,node_bpf_helpers,node_activity_probes toneBlue
class node_sysmon,node_network_tracker,node_xml_output,node_configuration,node_system_log toneAmber
class node_installer,node_linux_helpers,node_event_definitions toneMint
class node_log_viewer,node_event_names toneRose
class node_operator,node_kernel,node_user toneIndigo
```

## Components

### Kernel Capture

- [eBPF loader](https://github.com/microsoft/sysmon-linux/blob/main/ebpfKern/sysmonBPFLoad.c): `ebpfKern/sysmonBPFLoad.c`
- [eBPF maps](https://github.com/microsoft/sysmon-linux/blob/main/ebpfKern/sysmonEBPF_common.h): `ebpfKern/sysmonEBPF_common.h`
- [Event helpers](https://github.com/microsoft/sysmon-linux/blob/main/ebpfKern/sysmonHelpers.c): `ebpfKern/sysmonHelpers.c`
- [Activity probes](https://github.com/microsoft/sysmon-linux/tree/main/ebpfKern): `ebpfKern`

### Event Runtime

- [Sysmon event processor](https://github.com/microsoft/sysmon-linux/blob/main/sysmonforlinux.c): `sysmonforlinux.c`
- [Network tracker](https://github.com/microsoft/sysmon-linux/blob/main/networkTracker.cpp): `networkTracker.cpp`
- [XML output](https://github.com/microsoft/sysmon-linux/blob/main/outputxml.cpp): `outputxml.cpp`
- [Configuration and filtering](https://github.com/microsoft/sysmon-linux/blob/main/sysmonforlinux.c): `sysmonforlinux.c`

### System Support

- [Installer](https://github.com/microsoft/sysmon-linux/blob/main/installer.c): `installer.c`
- [Linux helpers](https://github.com/microsoft/sysmon-linux/blob/main/linuxHelpers.cpp): `linuxHelpers.cpp`
- [Event definitions](https://github.com/microsoft/sysmon-linux/blob/main/sysmon_defs.h): `sysmon_defs.h`

### Log Viewing

- [SysmonLogView](https://github.com/microsoft/sysmon-linux/blob/main/sysmonLogView/sysmonLogView.cpp): `sysmonLogView/sysmonLogView.cpp`
- [Event-name lookup](https://github.com/microsoft/sysmon-linux/blob/main/sysmonLogView/sysmonGetEventName.c): `sysmonLogView/sysmonGetEventName.c`

### Other components

- **System operator**
- **Linux kernel**
- **System log**
- **Log reader**

## Connections

- Linux kernel → Activity probes: triggers probes (evidence: `README.md`)
- Activity probes → eBPF maps: use maps (evidence: `ebpfKern/sysmonEBPF_common.h`)
- Event helpers → eBPF maps: lookup event storage (evidence: `ebpfKern/sysmonHelpers.c`)
- Activity probes → Event helpers: emit events (evidence: `ebpfKern/sysmonUDPsend.c`)
- eBPF loader → Activity probes: loads programs
- Activity probes → Sysmon event processor: deliver events
- Sysmon event processor → Network tracker: uses tracker (evidence: `sysmonforlinux.c`)
- Sysmon event processor → Linux helpers: uses helpers (evidence: `sysmonforlinux.c`)
- Sysmon event processor → Installer: uses installer (evidence: `sysmonforlinux.c`)
- Sysmon event processor → Event definitions: uses definitions (evidence: `sysmonforlinux.c`)
- Sysmon event processor → Configuration and filtering: parses rules (evidence: `sysmonforlinux.c`)
- Sysmon event processor → XML output: formats output
- Sysmon event processor → System log: writes events (evidence: `README.md`)
- System log → SysmonLogView: reads output (evidence: `README.md`)
- SysmonLogView → Event-name lookup: looks up names
- Log reader → SysmonLogView: filters output (evidence: `README.md`)
- System operator → Sysmon event processor: configures monitoring (evidence: `README.md`)
