# chitvijoshi/netsnoop architecture

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

- Interactive diagram: https://gitdiagram.com/chitvijoshi/netsnoop
- Repository: https://github.com/chitvijoshi/netsnoop

## Overview

NetSnoop monitors host processes for five anomaly classes, turns detections into alerts, and persists them to CSV for a Streamlit dashboard. The README documents the complete capability set; sampled monitor excerpts show alert construction, observers, CSV persistence, platform access, and memory scanning, but do not expose the full monitor orchestration or all detector implementations. Dashed links mark those documented but unsampled connections.

Main entry points: [`netsnoop/monitor_simple.py`](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py) (Monitor system), [`netsnoop/dashboard_simple.py`](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/dashboard_simple.py) (Dashboard application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_monitoring["Monitoring engine"]
  node_monitor_system["Monitor system<br/>[monitor_simple.py]"]
  node_platform["Platform access<br/>[monitor_simple.py]"]
  node_memory["Memory detection<br/>[monitor_simple.py]"]
  node_cpu["CPU detection<br/>[monitor_simple.py]"]
  node_burst["Process burst detection<br/>[monitor_simple.py]"]
  node_network["Network detection<br/>[monitor_simple.py]"]
  node_threads["Thread detection<br/>[monitor_simple.py]"]
  node_config["Threshold configuration<br/>[monitor_simple.py]"]
end

subgraph group_alerts["Alert handling"]
  node_alerts["Alert construction<br/>[monitor_simple.py]"]
  node_filters["Alert filters<br/>[monitor_simple.py]"]
  node_observers["Alert observers<br/>[monitor_simple.py]"]
  node_csv_store[("CSV alert store<br/>[monitor_simple.py]")]
  node_log["Alert log<br/>[monitor_simple.py]"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard_app["Dashboard application"]
  node_repository["CSV repository"]
  node_viewmodels["Dashboard view models"]
  node_charts["Charts and metrics"]
  node_table["Alert table and filters"]
end

node_operator(("System operator"))
node_host(("Host processes"))

node_operator -.->|"starts monitoring"| node_monitor_system
node_monitor_system -.->|"starts detector"| node_memory
node_monitor_system -.->|"starts detector"| node_cpu
node_monitor_system -.->|"starts detector"| node_burst
node_monitor_system -.->|"starts detector"| node_network
node_monitor_system -.->|"starts detector"| node_threads
node_memory -->|"scans processes"| node_platform
node_cpu -.->|"reads process usage"| node_platform
node_burst -->|"tracks process creation"| node_platform
node_network -.->|"reads connections"| node_platform
node_threads -.->|"reads thread counts"| node_platform
node_host -.->|"provides process data"| node_platform
node_config -.->|"sets thresholds"| node_memory
node_config -.->|"sets thresholds"| node_cpu
node_config -.->|"sets thresholds"| node_burst
node_config -.->|"sets thresholds"| node_network
node_config -.->|"sets thresholds"| node_threads
node_memory -.->|"builds alerts"| node_alerts
node_cpu -.->|"builds alerts"| node_alerts
node_burst -.->|"builds alerts"| node_alerts
node_network -.->|"builds alerts"| node_alerts
node_threads -.->|"builds alerts"| node_alerts
node_alerts -->|"notifies observers"| node_observers
node_observers -.->|"writes alerts"| node_csv_store
node_observers -->|"writes log"| node_log
node_operator -->|"opens dashboard"| node_dashboard_app
node_dashboard_app -->|"loads alert data"| node_repository
node_repository -.->|"reads alerts"| node_csv_store
node_dashboard_app -->|"prepares views"| node_viewmodels
node_viewmodels -->|"supplies statistics"| node_charts
node_viewmodels -->|"supplies alert rows"| node_table

click node_monitor_system "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py"
click node_platform "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py"
click node_memory "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py"
click node_cpu "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py"
click node_burst "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py"
click node_network "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py"
click node_threads "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py"
click node_config "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py"
click node_alerts "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py"
click node_filters "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py"
click node_observers "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py"
click node_csv_store "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py"
click node_log "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py"
click node_dashboard_app "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/dashboard_simple.py"
click node_repository "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/dashboard_simple.py"
click node_viewmodels "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/dashboard_simple.py"
click node_charts "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/dashboard_simple.py"
click node_table "https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/dashboard_simple.py"

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_monitor_system,node_platform,node_memory,node_cpu,node_burst,node_network,node_threads,node_config toneBlue
class node_alerts,node_filters,node_observers,node_csv_store,node_log toneAmber
class node_dashboard_app,node_repository,node_viewmodels,node_charts,node_table toneMint
class node_operator,node_host toneIndigo
```

## Components

### Monitoring engine

- [Monitor system](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py): `netsnoop/monitor_simple.py`
- [Platform access](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py): `netsnoop/monitor_simple.py`
- [Memory detection](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py): `netsnoop/monitor_simple.py`
- [CPU detection](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py): `netsnoop/monitor_simple.py`
- [Process burst detection](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py): `netsnoop/monitor_simple.py`
- [Network detection](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py): `netsnoop/monitor_simple.py`
- [Thread detection](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py): `netsnoop/monitor_simple.py`
- [Threshold configuration](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py): `netsnoop/monitor_simple.py`

### Alert handling

- [Alert construction](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py): `netsnoop/monitor_simple.py`
- [Alert filters](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py): `netsnoop/monitor_simple.py`
- [Alert observers](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py): `netsnoop/monitor_simple.py`
- [CSV alert store](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py): `netsnoop/monitor_simple.py`
- [Alert log](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/monitor_simple.py): `netsnoop/monitor_simple.py`

### Dashboard

- [Dashboard application](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/dashboard_simple.py): `netsnoop/dashboard_simple.py`
- [CSV repository](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/dashboard_simple.py): `netsnoop/dashboard_simple.py`
- [Dashboard view models](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/dashboard_simple.py): `netsnoop/dashboard_simple.py`
- [Charts and metrics](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/dashboard_simple.py): `netsnoop/dashboard_simple.py`
- [Alert table and filters](https://github.com/chitvijoshi/netsnoop/blob/main/netsnoop/dashboard_simple.py): `netsnoop/dashboard_simple.py`

### Other components

- **System operator**
- **Host processes**

## Connections

- System operator → Monitor system: starts monitoring (evidence: `README.md`)
- Monitor system → Memory detection: starts detector (evidence: `README.md`)
- Monitor system → CPU detection: starts detector (evidence: `README.md`)
- Monitor system → Process burst detection: starts detector (evidence: `README.md`)
- Monitor system → Network detection: starts detector (evidence: `README.md`)
- Monitor system → Thread detection: starts detector (evidence: `README.md`)
- Memory detection → Platform access: scans processes (evidence: `netsnoop/monitor_simple.py`)
- CPU detection → Platform access: reads process usage (evidence: `README.md`)
- Process burst detection → Platform access: tracks process creation (evidence: `netsnoop/monitor_simple.py`)
- Network detection → Platform access: reads connections (evidence: `README.md`)
- Thread detection → Platform access: reads thread counts (evidence: `README.md`)
- Host processes → Platform access: provides process data (evidence: `README.md`)
- Threshold configuration → Memory detection: sets thresholds (evidence: `netsnoop/monitor_simple.py`)
- Threshold configuration → CPU detection: sets thresholds (evidence: `README.md`)
- Threshold configuration → Process burst detection: sets thresholds (evidence: `README.md`)
- Threshold configuration → Network detection: sets thresholds (evidence: `README.md`)
- Threshold configuration → Thread detection: sets thresholds (evidence: `README.md`)
- Memory detection → Alert construction: builds alerts (evidence: `README.md`)
- CPU detection → Alert construction: builds alerts (evidence: `README.md`)
- Process burst detection → Alert construction: builds alerts (evidence: `README.md`)
- Network detection → Alert construction: builds alerts (evidence: `README.md`)
- Thread detection → Alert construction: builds alerts (evidence: `README.md`)
- Alert construction → Alert observers: notifies observers (evidence: `netsnoop/monitor_simple.py`)
- Alert observers → CSV alert store: writes alerts (evidence: `README.md`)
- Alert observers → Alert log: writes log (evidence: `netsnoop/monitor_simple.py`)
- System operator → Dashboard application: opens dashboard (evidence: `README.md`)
- Dashboard application → CSV repository: loads alert data (evidence: `netsnoop/dashboard_simple.py`)
- CSV repository → CSV alert store: reads alerts (evidence: `README.md`)
- Dashboard application → Dashboard view models: prepares views (evidence: `netsnoop/dashboard_simple.py`)
- Dashboard view models → Charts and metrics: supplies statistics (evidence: `netsnoop/dashboard_simple.py`)
- Dashboard view models → Alert table and filters: supplies alert rows (evidence: `netsnoop/dashboard_simple.py`)
