# kathireswaran-manoharan/fyp-usbips architecture

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

- Interactive diagram: https://gitdiagram.com/kathireswaran-manoharan/fyp-usbips
- Repository: https://github.com/kathireswaran-manoharan/fyp-usbips

## Overview

USBIPS is a Windows USB intrusion-prevention client with a companion central management server. Its documented device-arrival workflow extracts identity, classifies the device, quarantines it, checks the local allowlist, then releases approved devices; removal is tracked separately. The client also has synchronization, logging, access-control, and presence subsystems, while the server exposes client, device, request, and event APIs plus a dashboard. The principal client workflow is documented in the README; several internal connections and server API data paths are not shown in the supplied excerpts, so they are left unconnected.

Main entry points: [`server/app/main.py`](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/main.py) (Server application), [`Network/SyncManager.cpp`](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Network/SyncManager.cpp) (Sync manager), [`Enforcement/EnforcementManager.cpp`](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Enforcement/EnforcementManager.cpp) (Quarantine and release), [`main.cpp`](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/main.cpp) (USB monitor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["USB client"]
  node_client_entry["USB monitor<br/>[main.cpp]"]
  node_extractor["Identity extraction"]
  node_classifier["Device classification"]
end

subgraph group_runtime["Device runtime"]
  node_allowlist["Local allowlist"]
  node_enforcement["Quarantine and release"]
  node_presence["Removal tracking"]
  node_access["Access control"]
  node_device_model["USB device model<br/>[USBDevice.h]"]
end

subgraph group_sync["Central sync"]
  node_event_logger["Security event logging<br/>[EventLogger.cpp]"]
  node_sync_manager["Sync manager<br/>[SyncManager.cpp]"]
  node_rest_client["REST client<br/>[RestClient.cpp]"]
end

subgraph group_server["Management server"]
  node_server_app["Server application<br/>[main.py]"]
  node_server_db[("Server database<br/>[db.py]")]
  node_client_api["Client API<br/>[clients.py]"]
  node_device_api["Device API<br/>[devices.py]"]
  node_request_api["Request API<br/>[requests.py]"]
  node_event_api["Event API<br/>[events.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
  node_dashboard["Dashboard page<br/>[index.html]"]
end

node_operator(("Operator"))
node_usb_device["USB device"]

node_usb_device -->|"notifies arrival"| node_client_entry
node_client_entry -->|"extracts identity"| node_extractor
node_extractor -->|"classifies device"| node_classifier
node_classifier -->|"quarantines first"| node_enforcement
node_enforcement -->|"awaits decision"| node_allowlist
node_allowlist -->|"releases approved"| node_enforcement
node_operator -->|"approves unknown"| node_client_entry
node_usb_device -->|"removal notification"| node_presence
node_sync_manager -->|"calls"| node_rest_client
node_sync_manager -->|"syncs remote list"| node_allowlist
node_sync_manager -->|"checks tracked devices"| node_presence
node_sync_manager -->|"enforces revocation"| node_enforcement
node_sync_manager -->|"uploads pending events"| node_event_logger
node_server_app -->|"initializes"| node_server_db
node_server_app -->|"mounts router"| node_client_api
node_server_app -->|"mounts router"| node_device_api
node_server_app -->|"mounts router"| node_request_api
node_server_app -->|"mounts router"| node_event_api
node_server_app -->|"renders"| node_dashboard
node_rest_client -.->|"communicates with"| node_server_app

click node_client_entry "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/main.cpp"
click node_extractor "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Extractor/DeviceInfoExtractor.cpp"
click node_classifier "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Classifier/DeviceClassifier.cpp"
click node_allowlist "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Allowlist/AllowlistManager.cpp"
click node_enforcement "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Enforcement/EnforcementManager.cpp"
click node_presence "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Presence/DevicePresenceMonitor.cpp"
click node_access "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/AccessControl/AccessController.cpp"
click node_device_model "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Models/USBDevice.h"
click node_event_logger "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Logging/EventLogger.cpp"
click node_sync_manager "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Network/SyncManager.cpp"
click node_rest_client "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Network/RestClient.cpp"
click node_server_app "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/main.py"
click node_server_db "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/database/db.py"
click node_client_api "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/api/clients.py"
click node_device_api "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/api/devices.py"
click node_request_api "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/api/requests.py"
click node_event_api "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/api/events.py"
click node_schemas "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/models/schemas.py"
click node_dashboard "https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/templates/index.html"

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_client_entry,node_extractor,node_classifier toneBlue
class node_allowlist,node_enforcement,node_presence,node_access,node_device_model toneAmber
class node_event_logger,node_sync_manager,node_rest_client toneMint
class node_server_app,node_server_db,node_client_api,node_device_api,node_request_api,node_event_api,node_schemas,node_dashboard toneRose
class node_operator,node_usb_device toneIndigo
```

## Components

### USB client

- [USB monitor](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/main.cpp): `main.cpp`
- [Identity extraction](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Extractor/DeviceInfoExtractor.cpp): `Extractor/DeviceInfoExtractor.cpp`
- [Device classification](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Classifier/DeviceClassifier.cpp): `Classifier/DeviceClassifier.cpp`

### Device runtime

- [Local allowlist](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Allowlist/AllowlistManager.cpp): `Allowlist/AllowlistManager.cpp`
- [Quarantine and release](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Enforcement/EnforcementManager.cpp): `Enforcement/EnforcementManager.cpp`
- [Removal tracking](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Presence/DevicePresenceMonitor.cpp): `Presence/DevicePresenceMonitor.cpp`
- [Access control](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/AccessControl/AccessController.cpp): `AccessControl/AccessController.cpp`
- [USB device model](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Models/USBDevice.h): `Models/USBDevice.h`

### Central sync

- [Security event logging](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Logging/EventLogger.cpp): `Logging/EventLogger.cpp`
- [Sync manager](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Network/SyncManager.cpp): `Network/SyncManager.cpp`
- [REST client](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/Network/RestClient.cpp): `Network/RestClient.cpp`

### Management server

- [Server application](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/main.py): `server/app/main.py`
- [Server database](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/database/db.py): `server/app/database/db.py`
- [Client API](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/api/clients.py): `server/app/api/clients.py`
- [Device API](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/api/devices.py): `server/app/api/devices.py`
- [Request API](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/api/requests.py): `server/app/api/requests.py`
- [Event API](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/api/events.py): `server/app/api/events.py`
- [API schemas](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/models/schemas.py): `server/app/models/schemas.py`
- [Dashboard page](https://github.com/kathireswaran-manoharan/fyp-usbips/blob/main/server/app/templates/index.html): `server/app/templates/index.html`

### Other components

- **Operator**
- **USB device**

## Connections

- USB device → USB monitor: notifies arrival (evidence: `README.md`)
- USB monitor → Identity extraction: extracts identity (evidence: `README.md`)
- Identity extraction → Device classification: classifies device (evidence: `README.md`)
- Device classification → Quarantine and release: quarantines first (evidence: `README.md`)
- Quarantine and release → Local allowlist: awaits decision (evidence: `README.md`)
- Local allowlist → Quarantine and release: releases approved (evidence: `README.md`)
- Operator → USB monitor: approves unknown (evidence: `README.md`)
- USB device → Removal tracking: removal notification (evidence: `README.md`)
- Sync manager → REST client: calls (evidence: `Network/SyncManager.cpp`)
- Sync manager → Local allowlist: syncs remote list (evidence: `Network/SyncManager.cpp`)
- Sync manager → Removal tracking: checks tracked devices (evidence: `Network/SyncManager.cpp`)
- Sync manager → Quarantine and release: enforces revocation (evidence: `Network/SyncManager.cpp`)
- Sync manager → Security event logging: uploads pending events (evidence: `Network/SyncManager.cpp`)
- Server application → Server database: initializes (evidence: `server/app/main.py`)
- Server application → Client API: mounts router (evidence: `server/app/main.py`)
- Server application → Device API: mounts router (evidence: `server/app/main.py`)
- Server application → Request API: mounts router (evidence: `server/app/main.py`)
- Server application → Event API: mounts router (evidence: `server/app/main.py`)
- Server application → Dashboard page: renders (evidence: `server/app/main.py`)
- REST client → Server application: communicates with
