# uzankhan/vanguard-knight architecture

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

- Interactive diagram: https://gitdiagram.com/uzankhan/vanguard-knight
- Repository: https://github.com/uzankhan/vanguard-knight

## Overview

Vanguard Knight is a Windows endpoint-protection application with a GUI and a background-service mode. The principal path is user setup and authentication, followed by event collection and analysis in the detection engine, with alerts presented for review. The source index identifies additional detection, hardening, recovery, and self-protection capabilities. Several implementation files were not excerpted, so links to those subsystems are shown only where the index or excerpts support them; unverified engine integrations are dashed.

Main entry points: [`core_engine.py`](https://github.com/uzankhan/vanguard-knight/blob/main/core_engine.py) (Detection Engine), [`gui_app.py`](https://github.com/uzankhan/vanguard-knight/blob/main/gui_app.py) (Security Dashboard), [`app_main.py`](https://github.com/uzankhan/vanguard-knight/blob/main/app_main.py) (Application Startup), [`wizard.py`](https://github.com/uzankhan/vanguard-knight/blob/main/wizard.py) (First-Run Setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Startup and Interface"]
  node_app["Application Startup<br/>[app_main.py]"]
  node_gui["Security Dashboard<br/>[gui_app.py]"]
  node_visuals["HUD Effects<br/>[hacker_fx.py]"]
  node_theme["Visual Theme<br/>[theme.py]"]
end

subgraph group_identity["Setup and Identity"]
  node_wizard["First-Run Setup<br/>[wizard.py]"]
  node_handauth["Hand Enrollment<br/>[hand_auth.py]"]
  node_verify["Deactivation Verification"]
  node_recoverykey["Recovery Key<br/>[recovery_key.py]"]
end

subgraph group_protection["Detection and Defense"]
  node_engine["Detection Engine<br/>[core_engine.py]"]
  node_sysmon["Sysmon Event Reader<br/>[sysmon_reader.py]"]
  node_forensics["Forensics<br/>[forensics.py]"]
  node_entropy["Entropy Analysis<br/>[entropy.py]"]
  node_trusted["Trusted Applications<br/>[trusted_apps.py]"]
  node_usb["USB HID Guard<br/>[usb_guard.py]"]
  node_network["Network Recon<br/>[network_recon.py]"]
  node_hardening["System Hardening"]
  node_verdict["Threat Verdict Popup<br/>[verdict_popup.py]"]
  node_deception["Deception Defense<br/>[deception.py]"]
end

subgraph group_resilience["Recovery and Resilience"]
  node_selfprotect["Self-Protection<br/>[self_protection.py]"]
  node_watchdog["Watchdog<br/>[watchdog_main.py]"]
  node_service["Windows Service<br/>[windows_service.py]"]
  node_persistence["Persistence Guard"]
end

node_user(("User"))
node_system(("Windows System"))

node_user -->|"launches"| node_app
node_app -->|"starts setup"| node_wizard
node_app -->|"checks enrollment"| node_handauth
node_app -->|"opens dashboard"| node_gui
node_wizard -->|"enrolls hand"| node_handauth
node_wizard -->|"creates recovery key"| node_recoverykey
node_user -->|"requests deactivation"| node_verify
node_verify -->|"checks gesture"| node_handauth
node_verify -->|"checks fallback"| node_recoverykey
node_user -.->|"monitors system"| node_engine
node_system -.->|"emits events"| node_sysmon
node_engine -.->|"reads events"| node_sysmon
node_engine -.->|"uses forensics"| node_forensics
node_engine -.->|"uses analysis"| node_entropy
node_engine -.->|"checks trust"| node_trusted
node_engine -.->|"uses USB guard"| node_usb
node_engine -.->|"uses hardening"| node_hardening
node_hardening -->|"scans ports"| node_network
node_engine -.->|"requests review"| node_gui
node_gui -->|"presents verdict"| node_verdict
node_gui -->|"uses effects"| node_visuals
node_gui -->|"uses theme"| node_theme
node_service -->|"starts engine"| node_engine
node_service -->|"monitors integrity"| node_selfprotect
node_watchdog -->|"uses supervision"| node_selfprotect

click node_app "https://github.com/uzankhan/vanguard-knight/blob/main/app_main.py"
click node_gui "https://github.com/uzankhan/vanguard-knight/blob/main/gui_app.py"
click node_visuals "https://github.com/uzankhan/vanguard-knight/blob/main/hacker_fx.py"
click node_theme "https://github.com/uzankhan/vanguard-knight/blob/main/theme.py"
click node_wizard "https://github.com/uzankhan/vanguard-knight/blob/main/wizard.py"
click node_handauth "https://github.com/uzankhan/vanguard-knight/blob/main/hand_auth.py"
click node_verify "https://github.com/uzankhan/vanguard-knight/blob/main/hand_verify_dialog.py"
click node_recoverykey "https://github.com/uzankhan/vanguard-knight/blob/main/recovery_key.py"
click node_engine "https://github.com/uzankhan/vanguard-knight/blob/main/core_engine.py"
click node_sysmon "https://github.com/uzankhan/vanguard-knight/blob/main/sysmon_reader.py"
click node_forensics "https://github.com/uzankhan/vanguard-knight/blob/main/forensics.py"
click node_entropy "https://github.com/uzankhan/vanguard-knight/blob/main/entropy.py"
click node_trusted "https://github.com/uzankhan/vanguard-knight/blob/main/trusted_apps.py"
click node_usb "https://github.com/uzankhan/vanguard-knight/blob/main/usb_guard.py"
click node_network "https://github.com/uzankhan/vanguard-knight/blob/main/network_recon.py"
click node_hardening "https://github.com/uzankhan/vanguard-knight/blob/main/system_hardening.py"
click node_verdict "https://github.com/uzankhan/vanguard-knight/blob/main/verdict_popup.py"
click node_deception "https://github.com/uzankhan/vanguard-knight/blob/main/deception.py"
click node_selfprotect "https://github.com/uzankhan/vanguard-knight/blob/main/self_protection.py"
click node_watchdog "https://github.com/uzankhan/vanguard-knight/blob/main/watchdog_main.py"
click node_service "https://github.com/uzankhan/vanguard-knight/blob/main/windows_service.py"
click node_persistence "https://github.com/uzankhan/vanguard-knight/blob/main/persistence_guard.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_app,node_gui,node_visuals,node_theme,node_user toneBlue
class node_wizard,node_handauth,node_verify,node_recoverykey toneAmber
class node_engine,node_sysmon,node_forensics,node_entropy,node_trusted,node_usb,node_network,node_hardening,node_verdict,node_deception toneMint
class node_selfprotect,node_watchdog,node_service,node_persistence toneRose
class node_system toneIndigo
```

## Components

### Startup and Interface

- [Application Startup](https://github.com/uzankhan/vanguard-knight/blob/main/app_main.py): `app_main.py`
- [Security Dashboard](https://github.com/uzankhan/vanguard-knight/blob/main/gui_app.py): `gui_app.py`
- [HUD Effects](https://github.com/uzankhan/vanguard-knight/blob/main/hacker_fx.py): `hacker_fx.py`
- [Visual Theme](https://github.com/uzankhan/vanguard-knight/blob/main/theme.py): `theme.py`

### Setup and Identity

- [First-Run Setup](https://github.com/uzankhan/vanguard-knight/blob/main/wizard.py): `wizard.py`
- [Hand Enrollment](https://github.com/uzankhan/vanguard-knight/blob/main/hand_auth.py): `hand_auth.py`
- [Deactivation Verification](https://github.com/uzankhan/vanguard-knight/blob/main/hand_verify_dialog.py): `hand_verify_dialog.py`
- [Recovery Key](https://github.com/uzankhan/vanguard-knight/blob/main/recovery_key.py): `recovery_key.py`

### Detection and Defense

- [Detection Engine](https://github.com/uzankhan/vanguard-knight/blob/main/core_engine.py): `core_engine.py`
- [Sysmon Event Reader](https://github.com/uzankhan/vanguard-knight/blob/main/sysmon_reader.py): `sysmon_reader.py`
- [Forensics](https://github.com/uzankhan/vanguard-knight/blob/main/forensics.py): `forensics.py`
- [Entropy Analysis](https://github.com/uzankhan/vanguard-knight/blob/main/entropy.py): `entropy.py`
- [Trusted Applications](https://github.com/uzankhan/vanguard-knight/blob/main/trusted_apps.py): `trusted_apps.py`
- [USB HID Guard](https://github.com/uzankhan/vanguard-knight/blob/main/usb_guard.py): `usb_guard.py`
- [Network Recon](https://github.com/uzankhan/vanguard-knight/blob/main/network_recon.py): `network_recon.py`
- [System Hardening](https://github.com/uzankhan/vanguard-knight/blob/main/system_hardening.py): `system_hardening.py`
- [Threat Verdict Popup](https://github.com/uzankhan/vanguard-knight/blob/main/verdict_popup.py): `verdict_popup.py`
- [Deception Defense](https://github.com/uzankhan/vanguard-knight/blob/main/deception.py): `deception.py`

### Recovery and Resilience

- [Self-Protection](https://github.com/uzankhan/vanguard-knight/blob/main/self_protection.py): `self_protection.py`
- [Watchdog](https://github.com/uzankhan/vanguard-knight/blob/main/watchdog_main.py): `watchdog_main.py`
- [Windows Service](https://github.com/uzankhan/vanguard-knight/blob/main/windows_service.py): `windows_service.py`
- [Persistence Guard](https://github.com/uzankhan/vanguard-knight/blob/main/persistence_guard.py): `persistence_guard.py`

### Other components

- **User**
- **Windows System**

## Connections

- User → Application Startup: launches (evidence: `app_main.py`)
- Application Startup → First-Run Setup: starts setup (evidence: `app_main.py`)
- Application Startup → Hand Enrollment: checks enrollment (evidence: `app_main.py`)
- Application Startup → Security Dashboard: opens dashboard (evidence: `app_main.py`)
- First-Run Setup → Hand Enrollment: enrolls hand (evidence: `wizard.py`)
- First-Run Setup → Recovery Key: creates recovery key (evidence: `wizard.py`)
- User → Deactivation Verification: requests deactivation (evidence: `hand_verify_dialog.py`)
- Deactivation Verification → Hand Enrollment: checks gesture (evidence: `hand_verify_dialog.py`)
- Deactivation Verification → Recovery Key: checks fallback (evidence: `hand_verify_dialog.py`)
- User → Detection Engine: monitors system
- Windows System → Sysmon Event Reader: emits events
- Detection Engine → Sysmon Event Reader: reads events (evidence: `core_engine.py`)
- Detection Engine → Forensics: uses forensics (evidence: `core_engine.py`)
- Detection Engine → Entropy Analysis: uses analysis (evidence: `core_engine.py`)
- Detection Engine → Trusted Applications: checks trust (evidence: `core_engine.py`)
- Detection Engine → USB HID Guard: uses USB guard (evidence: `core_engine.py`)
- Detection Engine → System Hardening: uses hardening (evidence: `core_engine.py`)
- System Hardening → Network Recon: scans ports (evidence: `system_hardening.py`)
- Detection Engine → Security Dashboard: requests review (evidence: `gui_app.py`)
- Security Dashboard → Threat Verdict Popup: presents verdict (evidence: `gui_app.py`)
- Security Dashboard → HUD Effects: uses effects (evidence: `gui_app.py`)
- Security Dashboard → Visual Theme: uses theme (evidence: `gui_app.py`)
- Windows Service → Detection Engine: starts engine (evidence: `windows_service.py`)
- Windows Service → Self-Protection: monitors integrity (evidence: `windows_service.py`)
- Watchdog → Self-Protection: uses supervision (evidence: `watchdog_main.py`)
