# kucukkgl/fusionsec-lab architecture

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

- Interactive diagram: https://gitdiagram.com/kucukkgl/fusionsec-lab
- Repository: https://github.com/kucukkgl/fusionsec-lab

## Overview

FusionSec Lab is a Flask security-training application. Its main user workflow is account signup, login, and an authenticated welcome page; separate training surfaces cover SQL injection, file-integrity events, DFIR artifacts, and log control. The app module registers these route handlers and initializes the training database. A background control connector also polls an external JSON feed. The graph follows explicit registrations, calls, and documented behavior; unsampled template and subsystem internals are not expanded.

Main entry points: [`app.py`](https://github.com/kucukkgl/fusionsec-lab/blob/main/app.py) (Flask app), [`pentest/init_db.py`](https://github.com/kucukkgl/fusionsec-lab/blob/main/pentest/init_db.py) (Lab database), [`pentest/signup.py`](https://github.com/kucukkgl/fusionsec-lab/blob/main/pentest/signup.py) (Signup), [`pentest/login.py`](https://github.com/kucukkgl/fusionsec-lab/blob/main/pentest/login.py) (Login and welcome)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask app<br/>[app.py]"]
end

subgraph group_accounts["Accounts and SQLi lab"]
  node_signup["Signup<br/>[signup.py]"]
  node_login["Login and welcome<br/>[login.py]"]
  node_hashing["Password hashing"]
  node_database[("Lab database<br/>[init_db.py]")]
  node_sqli["SQL injection lab<br/>[sqli.py]"]
  node_admin["SQLi mode control<br/>[admin.py]"]
end

subgraph group_training["Security exercises"]
  node_fim["FIM event routes<br/>[fim.py]"]
  node_fimfiles["FIM event files"]
  node_dfir["DFIR artifact route<br/>[artifacts.py]"]
  node_logcontrol["Log controls<br/>[log_control.py]"]
end

subgraph group_operations["Operations"]
  node_c2["Control connector<br/>[c2_connector.py]"]
  node_control["Remote control feed"]
  node_runtime["Runtime action files"]
  node_logging["Logging setup<br/>[logging_config.py]"]
end

node_user(("Lab user"))

node_user -->|"sends requests"| node_app
node_app -->|"registers routes"| node_signup
node_app -->|"registers routes"| node_login
node_app -->|"registers routes"| node_sqli
node_app -->|"registers routes"| node_admin
node_app -->|"registers routes"| node_fim
node_app -->|"registers routes"| node_dfir
node_app -->|"registers routes"| node_logcontrol
node_app -->|"initializes"| node_database
node_signup -->|"hashes password"| node_hashing
node_signup -->|"inserts account"| node_database
node_login -->|"reads account"| node_database
node_login -->|"verifies password"| node_hashing
node_sqli -->|"queries users"| node_database
node_fim -->|"writes event files"| node_fimfiles
node_dfir -->|"writes artifact"| node_dfir
node_app -->|"starts threads"| node_c2
node_c2 -->|"fetches feed"| node_control
node_c2 -->|"writes action files"| node_runtime
node_app -->|"sets up logging"| node_logging

click node_app "https://github.com/kucukkgl/fusionsec-lab/blob/main/app.py"
click node_signup "https://github.com/kucukkgl/fusionsec-lab/blob/main/pentest/signup.py"
click node_login "https://github.com/kucukkgl/fusionsec-lab/blob/main/pentest/login.py"
click node_hashing "https://github.com/kucukkgl/fusionsec-lab/blob/main/pentest/password_hashing.py"
click node_database "https://github.com/kucukkgl/fusionsec-lab/blob/main/pentest/init_db.py"
click node_sqli "https://github.com/kucukkgl/fusionsec-lab/blob/main/pentest/sqli.py"
click node_admin "https://github.com/kucukkgl/fusionsec-lab/blob/main/pentest/admin.py"
click node_fim "https://github.com/kucukkgl/fusionsec-lab/blob/main/internal/fim.py"
click node_fimfiles "https://github.com/kucukkgl/fusionsec-lab/tree/main/fim"
click node_dfir "https://github.com/kucukkgl/fusionsec-lab/blob/main/dfir/artifacts.py"
click node_logcontrol "https://github.com/kucukkgl/fusionsec-lab/blob/main/internal/log_control.py"
click node_c2 "https://github.com/kucukkgl/fusionsec-lab/blob/main/host_manager/c2_connector.py"
click node_runtime "https://github.com/kucukkgl/fusionsec-lab/tree/main/runtime"
click node_logging "https://github.com/kucukkgl/fusionsec-lab/blob/main/logging_config.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_user toneBlue
class node_signup,node_login,node_hashing,node_database,node_sqli,node_admin toneAmber
class node_fim,node_fimfiles,node_dfir,node_logcontrol toneMint
class node_c2,node_control,node_runtime,node_logging toneRose
```

## Components

### Web application

- [Flask app](https://github.com/kucukkgl/fusionsec-lab/blob/main/app.py): `app.py`

### Accounts and SQLi lab

- [Signup](https://github.com/kucukkgl/fusionsec-lab/blob/main/pentest/signup.py): `pentest/signup.py`
- [Login and welcome](https://github.com/kucukkgl/fusionsec-lab/blob/main/pentest/login.py): `pentest/login.py`
- [Password hashing](https://github.com/kucukkgl/fusionsec-lab/blob/main/pentest/password_hashing.py): `pentest/password_hashing.py`
- [Lab database](https://github.com/kucukkgl/fusionsec-lab/blob/main/pentest/init_db.py): `pentest/init_db.py`
- [SQL injection lab](https://github.com/kucukkgl/fusionsec-lab/blob/main/pentest/sqli.py): `pentest/sqli.py`
- [SQLi mode control](https://github.com/kucukkgl/fusionsec-lab/blob/main/pentest/admin.py): `pentest/admin.py`

### Security exercises

- [FIM event routes](https://github.com/kucukkgl/fusionsec-lab/blob/main/internal/fim.py): `internal/fim.py`
- [FIM event files](https://github.com/kucukkgl/fusionsec-lab/tree/main/fim): `fim`
- [DFIR artifact route](https://github.com/kucukkgl/fusionsec-lab/blob/main/dfir/artifacts.py): `dfir/artifacts.py`
- [Log controls](https://github.com/kucukkgl/fusionsec-lab/blob/main/internal/log_control.py): `internal/log_control.py`

### Operations

- [Control connector](https://github.com/kucukkgl/fusionsec-lab/blob/main/host_manager/c2_connector.py): `host_manager/c2_connector.py`
- **Remote control feed**
- [Runtime action files](https://github.com/kucukkgl/fusionsec-lab/tree/main/runtime): `runtime`
- [Logging setup](https://github.com/kucukkgl/fusionsec-lab/blob/main/logging_config.py): `logging_config.py`

### Other components

- **Lab user**

## Connections

- Lab user → Flask app: sends requests (evidence: `app.py`)
- Flask app → Signup: registers routes (evidence: `app.py`)
- Flask app → Login and welcome: registers routes (evidence: `app.py`)
- Flask app → SQL injection lab: registers routes (evidence: `app.py`)
- Flask app → SQLi mode control: registers routes (evidence: `app.py`)
- Flask app → FIM event routes: registers routes (evidence: `app.py`)
- Flask app → DFIR artifact route: registers routes (evidence: `app.py`)
- Flask app → Log controls: registers routes (evidence: `app.py`)
- Flask app → Lab database: initializes (evidence: `app.py`)
- Signup → Password hashing: hashes password (evidence: `pentest/signup.py`)
- Signup → Lab database: inserts account (evidence: `pentest/signup.py`)
- Login and welcome → Lab database: reads account (evidence: `pentest/login.py`)
- Login and welcome → Password hashing: verifies password (evidence: `pentest/login.py`)
- SQL injection lab → Lab database: queries users (evidence: `pentest/sqli.py`)
- FIM event routes → FIM event files: writes event files (evidence: `internal/fim.py`)
- DFIR artifact route → DFIR artifact route: writes artifact (evidence: `dfir/artifacts.py`)
- Flask app → Control connector: starts threads (evidence: `app.py`)
- Control connector → Remote control feed: fetches feed (evidence: `host_manager/c2_connector.py`)
- Control connector → Runtime action files: writes action files (evidence: `host_manager/c2_connector.py`)
- Flask app → Logging setup: sets up logging (evidence: `app.py`)
