# garo10/mobitriage architecture

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

- Interactive diagram: https://gitdiagram.com/garo10/mobitriage
- Repository: https://github.com/garo10/mobitriage

## Overview

1. **High-level shape**
   TinyCheck is split into two separate product surfaces:
   - a **capture/reporting kiosk** for end users, and
   - an **admin backend** for configuration and IoC management.
   
   Each surface has its own **Vue.js frontend** and **Python/Flask backend**, with a shared Python analysis library under `analysis/`.

2. **User-facing capture plane**
   The kiosk plane is `server/frontend` plus `app/frontend`.
   - `server/frontend/app/blueprints/*` exposes Flask endpoints for device/network setup, capture, saving captures, analysis, and updates.
   - `app/frontend/src/views/*` is the browser UI for selecting Wi‑Fi, creating an AP, running captures, and showing reports.
   
   This is the flow a non-technical user follows on the TinyCheck device.

3. **Admin/configuration plane**
   The management plane is `server/backend` plus `app/backend`.
   - `server/backend/app/blueprints/*` provides APIs for configuration, IoCs, whitelist handling, and MISP integration.
   - `app/backend/src/views/*` is the admin UI for editing configuration, managing database-backed settings, and curating IoCs/whitelists.
   
   This plane is used to tune detection and reduce false positives.

4. **Traffic capture and analysis pipeline**
   The main runtime pipeline is:
   - a target device joins the TinyCheck network/AP,
   - traffic is captured by the frontend server,
   - logs/artifacts are passed into the `analysis/` package,
   - analysis produces a report for the UI.
   
   The analysis package contains dedicated engines for **Zeek** and **Suricata**, plus log parsing and report generation.

5. **Analysis subsystem**
   `analysis/` is a reusable Python module with:
   - `parsezeeklogs.py` for Zeek log ingestion,
   - `zeekengine.py` and `suricataengine.py` for detection logic,
   - `report.py` for packaging results,
   - locale files for report/UI text.
   
   This is the core detection layer that turns network artifacts into human-readable findings.

6. **IoC and whitelist management**
   The backend plane maintains detection inputs:
   - `assets/iocs.json` and `assets/whitelist.json` ship default indicator and allow-list content,
   - `server/backend/app/classes/iocs.py` and `whitelist.py` manage those datasets,
   - `server/backend/app/blueprints/ioc.py` and `whitelist.py` expose APIs/UI actions,
   - `server/backend/app/blueprints/misp.py` integrates external threat intel.
   
   The whitelist boundary is important: it suppresses known-benign traffic to keep reports actionable.

7. **Persistence layer**
   The repo includes `assets/scheme.sql` and `server/backend/app/db/models.py`, indicating a structured database-backed configuration store.
   The backend service owns persisted state such as configuration, curated indicators, and whitelist records.
   
   The frontend capture plane appears to consume this configuration rather than own it.

8. **External tools and services**
   Several external components materially shape the architecture:
   - **Zeek** and **Suricata** for packet/log analysis,
   - **MISP** as a threat-intelligence source,
   - **hostapd/Wi‑Fi interfaces** for ephemeral access point creation,
   - optional deployment patterns like standalone/kiosk and network-accessed modes.
   
   These are not just dependencies; they define how TinyCheck attaches to devices and how detections are produced.

9. **UI structure**
   Both web apps are independent Vue builds with their own routing, assets, fonts, and i18n/locales.
   - `app/frontend` focuses on the guided user flow.
   - `app/backend` focuses on admin workflows.
   
   The duplicated locale structure suggests both surfaces are localized separately but share a similar language set.

10. **Operational scripts and deployment**
   Top-level scripts such as `install.sh`, `update.sh`, `uninstall.sh`, and `kiosk.sh` indicate the project is meant to be installed as a device/appliance rather than deployed as a generic web service.
   The repo is therefore closer to a **localized security appliance** than a single monolithic app.

11. **Recommended architecture diagram boundaries**
   A faithful diagram should show:
   - **Browser UI for capture/reporting**
   - **Capture/analysis Flask service**
   - **Browser UI for admin/configuration**
   - **Admin/configuration Flask service**
   - **Shared analysis engine**
   - **Persistent config/IoC/whitelist store**
   - **External analysis/intel sources: Zeek, Suricata, MISP**
   
   The key data flow is from **captured device traffic → analysis engines → report**, while the key control flow is from **admin curation → config/IoC updates → detection tuning**.

Main entry points: [`server/backend`](https://github.com/garo10/mobitriage/tree/main/server/backend) (Admin API), [`analysis/analysis.py`](https://github.com/garo10/mobitriage/blob/main/analysis/analysis.py) (Analysis entry), [`server/frontend`](https://github.com/garo10/mobitriage/tree/main/server/frontend) (Capture API), [`server/backend/app/classes/iocs.py`](https://github.com/garo10/mobitriage/blob/main/server/backend/app/classes/iocs.py) (IoC manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_kiosk["Capture kiosk"]
  node_fe_ui["Capture UI<br/>Vue app"]
  node_fe_api["Capture API<br/>Flask service"]
end

subgraph group_admin["Admin backend"]
  node_be_ui["Admin UI<br/>Vue app"]
  node_be_api["Admin API<br/>Flask service"]
  node_ioc_class["IoC manager<br/>Python class<br/>[iocs.py]"]
  node_whitelist_class["Whitelist manager<br/>Python class<br/>[whitelist.py]"]
  node_misp_class["MISP client<br/>Python class<br/>[misp.py]"]
  node_ioc_bp["IoC API<br/>Flask blueprint<br/>[ioc.py]"]
  node_whitelist_bp["Whitelist API<br/>Flask blueprint<br/>[whitelist.py]"]
  node_config_bp["Config API<br/>Flask blueprint<br/>[config.py]"]
  node_misp_bp["MISP API<br/>Flask blueprint<br/>[misp.py]"]
end

subgraph group_analysis["Analysis core"]
  node_analysis_entry["Analysis entry<br/>Python module<br/>[analysis.py]"]
  node_zeek_log["Zeek logs<br/>parser<br/>[parsezeeklogs.py]"]
  node_zeek_engine["Zeek engine<br/>detector<br/>[zeekengine.py]"]
  node_suricata_engine["Suricata engine<br/>detector<br/>[suricataengine.py]"]
  node_report["Report<br/>renderer<br/>[report.py]"]
end

subgraph group_data["Persistent data"]
  node_config_store[("Config model<br/>DB model<br/>[models.py]")]
  node_config_defaults["Defaults<br/>assets"]
end

subgraph group_ops["Device ops"]
  node_appliance["Device scripts<br/>shell<br/>[install.sh]"]
end

subgraph group_externals["External systems"]
  node_zeek{{"Zeek<br/>external analyzer"}}
  node_suricata{{"Suricata<br/>external analyzer"}}
  node_misp{{"MISP<br/>external intel"}}
  node_hostapd{{"Wi-Fi AP<br/>external service<br/>[hostapd.conf]"}}
end

node_fe_ui -->|"user actions"| node_fe_api
node_fe_api -->|"send artifacts"| node_analysis_entry
node_analysis_entry -->|"parse"| node_zeek_log
node_analysis_entry -->|"zeek detect"| node_zeek_engine
node_analysis_entry -->|"suricata detect"| node_suricata_engine
node_zeek_log -.->|"input"| node_zeek
node_zeek_engine -.->|"signals"| node_zeek
node_suricata_engine -.->|"signals"| node_suricata
node_analysis_entry -->|"render"| node_report
node_report -->|"display"| node_fe_ui
node_be_ui -->|"admin actions"| node_be_api
node_be_api -->|"config"| node_config_bp
node_be_api -->|"ioc"| node_ioc_bp
node_be_api -->|"allow-list"| node_whitelist_bp
node_be_api -->|"intel sync"| node_misp_bp
node_config_bp -->|"persist"| node_config_store
node_ioc_bp -->|"manage"| node_ioc_class
node_whitelist_bp -->|"manage"| node_whitelist_class
node_misp_bp -->|"sync"| node_misp_class
node_ioc_class -.->|"seed"| node_config_defaults
node_whitelist_class -.->|"seed"| node_config_defaults
node_ioc_class -->|"store"| node_config_store
node_whitelist_class -->|"store"| node_config_store
node_misp_class -.->|"fetch"| node_misp
node_fe_api -->|"ap setup"| node_hostapd
node_appliance -.->|"deploy"| node_fe_api
node_appliance -.->|"deploy"| node_be_api

click node_fe_ui "https://github.com/garo10/mobitriage/tree/main/app/frontend"
click node_fe_api "https://github.com/garo10/mobitriage/tree/main/server/frontend"
click node_be_ui "https://github.com/garo10/mobitriage/tree/main/app/backend"
click node_be_api "https://github.com/garo10/mobitriage/tree/main/server/backend"
click node_analysis_entry "https://github.com/garo10/mobitriage/blob/main/analysis/analysis.py"
click node_zeek_log "https://github.com/garo10/mobitriage/blob/main/analysis/classes/parsezeeklogs.py"
click node_zeek_engine "https://github.com/garo10/mobitriage/blob/main/analysis/classes/zeekengine.py"
click node_suricata_engine "https://github.com/garo10/mobitriage/blob/main/analysis/classes/suricataengine.py"
click node_report "https://github.com/garo10/mobitriage/blob/main/analysis/classes/report.py"
click node_config_store "https://github.com/garo10/mobitriage/blob/main/server/backend/app/db/models.py"
click node_config_defaults "https://github.com/garo10/mobitriage/tree/main/assets"
click node_ioc_class "https://github.com/garo10/mobitriage/blob/main/server/backend/app/classes/iocs.py"
click node_whitelist_class "https://github.com/garo10/mobitriage/blob/main/server/backend/app/classes/whitelist.py"
click node_misp_class "https://github.com/garo10/mobitriage/blob/main/server/backend/app/classes/misp.py"
click node_ioc_bp "https://github.com/garo10/mobitriage/blob/main/server/backend/app/blueprints/ioc.py"
click node_whitelist_bp "https://github.com/garo10/mobitriage/blob/main/server/backend/app/blueprints/whitelist.py"
click node_config_bp "https://github.com/garo10/mobitriage/blob/main/server/backend/app/blueprints/config.py"
click node_misp_bp "https://github.com/garo10/mobitriage/blob/main/server/backend/app/blueprints/misp.py"
click node_appliance "https://github.com/garo10/mobitriage/blob/main/install.sh"
click node_hostapd "https://github.com/garo10/mobitriage/blob/main/server/frontend/app/assets/hostapd.conf"

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_fe_ui,node_fe_api toneBlue
class node_be_ui,node_be_api,node_ioc_class,node_whitelist_class,node_misp_class,node_ioc_bp,node_whitelist_bp,node_config_bp,node_misp_bp toneAmber
class node_analysis_entry,node_zeek_log,node_zeek_engine,node_suricata_engine,node_report toneMint
class node_config_store,node_config_defaults toneRose
class node_appliance toneIndigo
class node_zeek,node_suricata,node_misp,node_hostapd toneTeal
```

## Components

### Capture kiosk

User-facing capture and reporting surface

- [Capture UI](https://github.com/garo10/mobitriage/tree/main/app/frontend): Vue app · Guided kiosk interface for Wi-Fi, capture, and reporting · `app/frontend`
- [Capture API](https://github.com/garo10/mobitriage/tree/main/server/frontend): Flask service · Endpoints for device setup, capture, save, analysis, and updates · `server/frontend`

### Admin backend

Configuration and IoC management surface

- [Admin UI](https://github.com/garo10/mobitriage/tree/main/app/backend): Vue app · Administrative interface for configuration and indicator management · `app/backend`
- [Admin API](https://github.com/garo10/mobitriage/tree/main/server/backend): Flask service · Backend endpoints for config, IoCs, whitelist, and MISP · `server/backend`
- [IoC manager](https://github.com/garo10/mobitriage/blob/main/server/backend/app/classes/iocs.py): Python class · Curates indicator datasets · `server/backend/app/classes/iocs.py`
- [Whitelist manager](https://github.com/garo10/mobitriage/blob/main/server/backend/app/classes/whitelist.py): Python class · Maintains allow-list data · `server/backend/app/classes/whitelist.py`
- [MISP client](https://github.com/garo10/mobitriage/blob/main/server/backend/app/classes/misp.py): Python class · Integrates external threat intelligence · `server/backend/app/classes/misp.py`
- [IoC API](https://github.com/garo10/mobitriage/blob/main/server/backend/app/blueprints/ioc.py): Flask blueprint · API surface for IoC workflows · `server/backend/app/blueprints/ioc.py`
- [Whitelist API](https://github.com/garo10/mobitriage/blob/main/server/backend/app/blueprints/whitelist.py): Flask blueprint · API surface for whitelist workflows · `server/backend/app/blueprints/whitelist.py`
- [Config API](https://github.com/garo10/mobitriage/blob/main/server/backend/app/blueprints/config.py): Flask blueprint · API surface for configuration management · `server/backend/app/blueprints/config.py`
- [MISP API](https://github.com/garo10/mobitriage/blob/main/server/backend/app/blueprints/misp.py): Flask blueprint · API surface for threat-intel sync · `server/backend/app/blueprints/misp.py`

### Analysis core

Shared detection and report generation layer

- [Analysis entry](https://github.com/garo10/mobitriage/blob/main/analysis/analysis.py): Python module · Top-level orchestration for analysis execution · `analysis/analysis.py`
- [Zeek logs](https://github.com/garo10/mobitriage/blob/main/analysis/classes/parsezeeklogs.py): parser · Ingests and normalizes Zeek output · `analysis/classes/parsezeeklogs.py`
- [Zeek engine](https://github.com/garo10/mobitriage/blob/main/analysis/classes/zeekengine.py): detector · Zeek-based detection logic · `analysis/classes/zeekengine.py`
- [Suricata engine](https://github.com/garo10/mobitriage/blob/main/analysis/classes/suricataengine.py): detector · Suricata-based detection logic · `analysis/classes/suricataengine.py`
- [Report](https://github.com/garo10/mobitriage/blob/main/analysis/classes/report.py): renderer · Formats findings for the UI · `analysis/classes/report.py`

### Persistent data

Packaged defaults and stored configuration data

- [Config model](https://github.com/garo10/mobitriage/blob/main/server/backend/app/db/models.py): DB model · Structured persisted configuration and state · `server/backend/app/db/models.py`
- [Defaults](https://github.com/garo10/mobitriage/tree/main/assets): assets · Seed indicator and whitelist content shipped with the repo · `assets`

### Device ops

Installation and appliance startup scripts

- [Device scripts](https://github.com/garo10/mobitriage/blob/main/install.sh): shell · Install, kiosk, update, and uninstall scripts for appliance deployment · `install.sh`

### External systems

Third-party tools and integration points

- **Zeek**: external analyzer · Packet and log analysis engine
- **Suricata**: external analyzer · IDS engine used for detection signals
- **MISP**: external intel · Threat-intelligence source
- [Wi-Fi AP](https://github.com/garo10/mobitriage/blob/main/server/frontend/app/assets/hostapd.conf): external service · Access-point and wireless interface layer for device onboarding · `server/frontend/app/assets/hostapd.conf`

## Connections

- Capture UI → Capture API: user actions · Kiosk UI drives capture and reporting workflows
- Capture API → Analysis entry: send artifacts · Capture service passes logs and artifacts into analysis
- Analysis entry → Zeek logs: parse · Normalize Zeek logs before detection
- Analysis entry → Zeek engine: zeek detect · Run Zeek-based detection logic
- Analysis entry → Suricata engine: suricata detect · Run Suricata-based detection logic
- Zeek logs → Zeek: input · Consumes Zeek-generated logs
- Zeek engine → Zeek: signals · Uses Zeek as an analysis source
- Suricata engine → Suricata: signals · Uses Suricata as an analysis source
- Analysis entry → Report: render · Package findings into a report
- Report → Capture UI: display · Report is presented in the kiosk UI
- Admin UI → Admin API: admin actions · Admin UI manages configuration and indicators
- Admin API → Config API: config · Configuration workflows exposed by backend API
- Admin API → IoC API: ioc · IoC management workflows exposed by backend API
- Admin API → Whitelist API: allow-list · Whitelist management workflows exposed by backend API
- Admin API → MISP API: intel sync · Threat-intelligence integration exposed by backend API
- Config API → Config model: persist · Backend stores structured configuration state
- IoC API → IoC manager: manage · IoC blueprint delegates dataset operations
- Whitelist API → Whitelist manager: manage · Whitelist blueprint delegates dataset operations
- MISP API → MISP client: sync · MISP blueprint delegates intel synchronization
- IoC manager → Defaults: seed · Loads packaged IoC defaults
- Whitelist manager → Defaults: seed · Loads packaged whitelist defaults
- IoC manager → Config model: store · Curated IoCs are persisted in backend storage
- Whitelist manager → Config model: store · Curated whitelist entries are persisted in backend storage
- MISP client → MISP: fetch · Pulls external threat-intelligence data
- Capture API → Wi-Fi AP: ap setup · Creates or manages the device access point
- Device scripts → Capture API: deploy · Scripts boot the capture service in appliance mode
- Device scripts → Admin API: deploy · Scripts boot the admin service in appliance mode
