# emtrion/cvewatch architecture

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

- Interactive diagram: https://gitdiagram.com/emtrion/cvewatch
- Repository: https://github.com/emtrion/cvewatch

## Overview

emCVE-Watch combines a PHP account and project portal with a Python vulnerability-scanning service. Users create projects and upload Debian elbe XML or Yocto CSV; scheduled checks process package data, compare it with vulnerability feeds, store findings, and email reports. The graph preserves the documented upload-to-report capabilities and the sampled scanner dependencies. Some portal-to-scanner handoffs are described only in the README, so those links cite that documentation; unsampled internals are not inferred.

Main entry points: [`webapp/deb.py`](https://github.com/emtrion/cvewatch/blob/main/webapp/deb.py) (Debian Scanner), [`webapp/yocto.py`](https://github.com/emtrion/cvewatch/blob/main/webapp/yocto.py) (Yocto Scanner), [`webapp/cron.py`](https://github.com/emtrion/cvewatch/blob/main/webapp/cron.py) (Scheduled Checks), [`webapp/utils.py`](https://github.com/emtrion/cvewatch/blob/main/webapp/utils.py) (Scan Utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Web Portal"]
  node_auth["Account Access<br/>[login.inc.php]"]
  node_profile["Profile Settings<br/>[profile.inc.php]"]
  node_project_ui["Project Views<br/>[project_view.php]"]
  node_project_ops["Project Management<br/>[projects.php]"]
end

subgraph group_intake["Project Intake"]
  node_upload["File Upload<br/>[projects.inc.php]"]
  node_debian_input["Debian elbe XML<br/>[utils.py]"]
  node_yocto_input["Yocto CSV Recipe"]
end

subgraph group_scanner["CVE Scanning"]
  node_scheduler["Scheduled Checks<br/>[cron.py]"]
  node_debian_scan["Debian Scanner<br/>[deb.py]"]
  node_yocto_scan["Yocto Scanner<br/>[yocto.py]"]
  node_shared_utils["Scan Utilities<br/>[utils.py]"]
end

subgraph group_services["Data And Notifications"]
  node_feed_update["Feed Updates<br/>[update.py]"]
  node_db_access["Database Access<br/>[database.py]"]
  node_app_database[("Application Database<br/>[db.sql]")]
  node_mailer["Report Mailer<br/>[mail.py]"]
end

node_user(("Project User"))
node_external_feeds[("Debian And NVD Feeds")]
node_email_service{{"SMTP Email"}}

node_user -->|"signs in"| node_auth
node_user -->|"manages projects"| node_project_ui
node_project_ui -->|"lists projects"| node_project_ops
node_user -->|"uploads inventory"| node_upload
node_upload -.->|"stores upload"| node_debian_input
node_upload -->|"accepts CSV"| node_yocto_input
node_debian_input -->|"checks packages"| node_debian_scan
node_scheduler -->|"runs checks"| node_debian_scan
node_scheduler -->|"runs checks"| node_yocto_scan
node_scheduler -->|"updates feeds"| node_feed_update
node_scheduler -->|"uses utilities"| node_shared_utils
node_shared_utils -->|"checks packages"| node_debian_scan
node_debian_scan -->|"reads and writes"| node_db_access
node_yocto_scan -->|"reads and writes"| node_db_access
node_debian_scan -->|"uses utilities"| node_shared_utils
node_yocto_scan -->|"uses utilities"| node_shared_utils
node_debian_scan -->|"sends reports"| node_mailer
node_yocto_scan -->|"sends reports"| node_mailer
node_debian_scan -.->|"refreshes feed"| node_feed_update
node_yocto_scan -->|"refreshes feed"| node_feed_update
node_feed_update -->|"downloads data"| node_external_feeds
node_db_access -.->|"queries database"| node_app_database
node_mailer -.->|"sends mail"| node_email_service
node_user -->|"edits account"| node_profile

click node_auth "https://github.com/emtrion/cvewatch/blob/main/login/includes/login.inc.php"
click node_profile "https://github.com/emtrion/cvewatch/blob/main/profile/includes/profile.inc.php"
click node_project_ui "https://github.com/emtrion/cvewatch/blob/main/projects/project_view.php"
click node_project_ops "https://github.com/emtrion/cvewatch/blob/main/assets/includes/projects.php"
click node_upload "https://github.com/emtrion/cvewatch/blob/main/projects/includes/projects.inc.php"
click node_debian_input "https://github.com/emtrion/cvewatch/blob/main/webapp/utils.py"
click node_yocto_input "https://github.com/emtrion/cvewatch/blob/main/yocto/meta-xxx/classes/package-list.bbclass"
click node_scheduler "https://github.com/emtrion/cvewatch/blob/main/webapp/cron.py"
click node_debian_scan "https://github.com/emtrion/cvewatch/blob/main/webapp/deb.py"
click node_yocto_scan "https://github.com/emtrion/cvewatch/blob/main/webapp/yocto.py"
click node_shared_utils "https://github.com/emtrion/cvewatch/blob/main/webapp/utils.py"
click node_feed_update "https://github.com/emtrion/cvewatch/blob/main/webapp/update.py"
click node_db_access "https://github.com/emtrion/cvewatch/blob/main/webapp/database.py"
click node_app_database "https://github.com/emtrion/cvewatch/blob/main/assets/setup/db.sql"
click node_mailer "https://github.com/emtrion/cvewatch/blob/main/webapp/mail.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_auth,node_profile,node_project_ui,node_project_ops,node_user toneBlue
class node_upload,node_debian_input,node_yocto_input,node_external_feeds toneAmber
class node_scheduler,node_debian_scan,node_yocto_scan,node_shared_utils toneMint
class node_feed_update,node_db_access,node_app_database,node_mailer toneRose
class node_email_service toneIndigo
```

## Components

### Web Portal

- [Account Access](https://github.com/emtrion/cvewatch/blob/main/login/includes/login.inc.php): `login/includes/login.inc.php`
- [Profile Settings](https://github.com/emtrion/cvewatch/blob/main/profile/includes/profile.inc.php): `profile/includes/profile.inc.php`
- [Project Views](https://github.com/emtrion/cvewatch/blob/main/projects/project_view.php): `projects/project_view.php`
- [Project Management](https://github.com/emtrion/cvewatch/blob/main/assets/includes/projects.php): `assets/includes/projects.php`

### Project Intake

- [File Upload](https://github.com/emtrion/cvewatch/blob/main/projects/includes/projects.inc.php): `projects/includes/projects.inc.php`
- [Debian elbe XML](https://github.com/emtrion/cvewatch/blob/main/webapp/utils.py): `webapp/utils.py`
- [Yocto CSV Recipe](https://github.com/emtrion/cvewatch/blob/main/yocto/meta-xxx/classes/package-list.bbclass): `yocto/meta-xxx/classes/package-list.bbclass`

### CVE Scanning

- [Scheduled Checks](https://github.com/emtrion/cvewatch/blob/main/webapp/cron.py): `webapp/cron.py`
- [Debian Scanner](https://github.com/emtrion/cvewatch/blob/main/webapp/deb.py): `webapp/deb.py`
- [Yocto Scanner](https://github.com/emtrion/cvewatch/blob/main/webapp/yocto.py): `webapp/yocto.py`
- [Scan Utilities](https://github.com/emtrion/cvewatch/blob/main/webapp/utils.py): `webapp/utils.py`

### Data And Notifications

- [Feed Updates](https://github.com/emtrion/cvewatch/blob/main/webapp/update.py): `webapp/update.py`
- [Database Access](https://github.com/emtrion/cvewatch/blob/main/webapp/database.py): `webapp/database.py`
- [Application Database](https://github.com/emtrion/cvewatch/blob/main/assets/setup/db.sql): `assets/setup/db.sql`
- [Report Mailer](https://github.com/emtrion/cvewatch/blob/main/webapp/mail.py): `webapp/mail.py`

### Other components

- **Project User**
- **Debian And NVD Feeds**
- **SMTP Email**

## Connections

- Project User → Account Access: signs in
- Project User → Project Views: manages projects (evidence: `README.md`)
- Project Views → Project Management: lists projects (evidence: `projects/project_view.php`)
- Project User → File Upload: uploads inventory (evidence: `README.md`)
- File Upload → Debian elbe XML: stores upload (evidence: `README.md`)
- File Upload → Yocto CSV Recipe: accepts CSV (evidence: `projects/includes/projects.inc.php`)
- Debian elbe XML → Debian Scanner: checks packages (evidence: `webapp/utils.py`)
- Scheduled Checks → Debian Scanner: runs checks (evidence: `webapp/cron.py`)
- Scheduled Checks → Yocto Scanner: runs checks (evidence: `webapp/cron.py`)
- Scheduled Checks → Feed Updates: updates feeds (evidence: `webapp/cron.py`)
- Scheduled Checks → Scan Utilities: uses utilities (evidence: `webapp/cron.py`)
- Scan Utilities → Debian Scanner: checks packages (evidence: `webapp/utils.py`)
- Debian Scanner → Database Access: reads and writes (evidence: `webapp/deb.py`)
- Yocto Scanner → Database Access: reads and writes (evidence: `webapp/yocto.py`)
- Debian Scanner → Scan Utilities: uses utilities (evidence: `webapp/deb.py`)
- Yocto Scanner → Scan Utilities: uses utilities (evidence: `webapp/yocto.py`)
- Debian Scanner → Report Mailer: sends reports (evidence: `webapp/deb.py`)
- Yocto Scanner → Report Mailer: sends reports (evidence: `webapp/yocto.py`)
- Debian Scanner → Feed Updates: refreshes feed (evidence: `webapp/deb.py`)
- Yocto Scanner → Feed Updates: refreshes feed (evidence: `webapp/yocto.py`)
- Feed Updates → Debian And NVD Feeds: downloads data (evidence: `webapp/update.py`)
- Database Access → Application Database: queries database
- Report Mailer → SMTP Email: sends mail (evidence: `README.md`)
- Project User → Profile Settings: edits account (evidence: `README.md`)
