# aggkavya/iot-is architecture

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

- Interactive diagram: https://gitdiagram.com/aggkavya/iot-is
- Repository: https://github.com/aggkavya/iot-is

## Overview

Secure MQTT-Based IoT Access Control System demonstrates unauthorized command injection in a smart-building MQTT setup and its mitigation with broker ACLs. The main workflow is dashboard or attacker → Mosquitto broker → door, light, or alarm, with device status and security events reflected in the dashboard. The README documents vulnerable and protected broker modes; the sampled source shows device MQTT behavior, backend APIs and event streaming, and attacker reporting. Broker configuration relationships and the overall run modes are documented, but the control-panel orchestration is not mapped here.

Main entry points: [`secure-iot-mqtt/backend/app.py`](https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/backend/app.py) (Dashboard Backend), [`secure-iot-mqtt/attacker/attacker.py`](https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/attacker/attacker.py) (MQTT Attack Tool), [`secure-iot-mqtt/frontend/app.js`](https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/frontend/app.js) (Dashboard UI), [`secure-iot-mqtt/devices/door_device.py`](https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/devices/door_device.py) (Door Device)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_broker_security["Broker Security"]
  node_mosquitto["Mosquitto Broker"]
  node_vulnerable_config["Vulnerable Config"]
  node_protected_config["Protected Config"]
  node_vulnerable_acl["Vulnerable ACL"]
  node_protected_acl["Protected ACL<br/>[acl_protected.conf]"]
end

subgraph group_device_runtime["Smart Devices"]
  node_door["Door Device<br/>[door_device.py]"]
  node_light["Light Device<br/>[light_device.py]"]
  node_alarm["Alarm Device<br/>[alarm_device.py]"]
end

subgraph group_dashboard["Dashboard"]
  node_backend["Dashboard Backend<br/>[app.py]"]
  node_dashboard_ui["Dashboard UI<br/>[app.js]"]
  node_dashboard_page["Dashboard Page<br/>[index.html]"]
end

subgraph group_attack["Attack Tool"]
  node_attacker_tool["MQTT Attack Tool<br/>[attacker.py]"]
end

node_user(("Dashboard User"))
node_attacker_actor(("Attacker"))

node_user -->|"uses"| node_dashboard_ui
node_dashboard_ui -->|"requests API"| node_backend
node_backend -->|"publishes commands"| node_mosquitto
node_backend -->|"subscribes status"| node_mosquitto
node_mosquitto -->|"delivers status"| node_backend
node_door -->|"subscribes commands"| node_mosquitto
node_door -->|"publishes status"| node_mosquitto
node_light -->|"subscribes commands"| node_mosquitto
node_light -->|"publishes status"| node_mosquitto
node_alarm -->|"subscribes commands"| node_mosquitto
node_alarm -->|"publishes status"| node_mosquitto
node_vulnerable_config -->|"configures mode"| node_mosquitto
node_protected_config -->|"configures mode"| node_mosquitto
node_vulnerable_acl -.->|"sets authorization"| node_mosquitto
node_protected_acl -->|"sets authorization"| node_mosquitto
node_attacker_actor -->|"runs"| node_attacker_tool
node_attacker_tool -->|"publishes or subscribes"| node_mosquitto
node_attacker_tool -->|"reports attempts"| node_backend
node_dashboard_page -->|"hosts interface"| node_dashboard_ui

click node_vulnerable_config "https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/broker/mosquitto_vulnerable.conf"
click node_protected_config "https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/broker/mosquitto_protected.conf"
click node_vulnerable_acl "https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/broker/acl_vulnerable.conf"
click node_protected_acl "https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/broker/acl_protected.conf"
click node_door "https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/devices/door_device.py"
click node_light "https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/devices/light_device.py"
click node_alarm "https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/devices/alarm_device.py"
click node_backend "https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/backend/app.py"
click node_dashboard_ui "https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/frontend/app.js"
click node_dashboard_page "https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/frontend/index.html"
click node_attacker_tool "https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/attacker/attacker.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_mosquitto,node_vulnerable_config,node_protected_config,node_vulnerable_acl,node_protected_acl,node_user toneBlue
class node_door,node_light,node_alarm toneAmber
class node_backend,node_dashboard_ui,node_dashboard_page toneMint
class node_attacker_tool toneRose
class node_attacker_actor toneIndigo
```

## Components

### Broker Security

- **Mosquitto Broker**
- [Vulnerable Config](https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/broker/mosquitto_vulnerable.conf): `secure-iot-mqtt/broker/mosquitto_vulnerable.conf`
- [Protected Config](https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/broker/mosquitto_protected.conf): `secure-iot-mqtt/broker/mosquitto_protected.conf`
- [Vulnerable ACL](https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/broker/acl_vulnerable.conf): `secure-iot-mqtt/broker/acl_vulnerable.conf`
- [Protected ACL](https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/broker/acl_protected.conf): `secure-iot-mqtt/broker/acl_protected.conf`

### Smart Devices

- [Door Device](https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/devices/door_device.py): `secure-iot-mqtt/devices/door_device.py`
- [Light Device](https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/devices/light_device.py): `secure-iot-mqtt/devices/light_device.py`
- [Alarm Device](https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/devices/alarm_device.py): `secure-iot-mqtt/devices/alarm_device.py`

### Dashboard

- [Dashboard Backend](https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/backend/app.py): `secure-iot-mqtt/backend/app.py`
- [Dashboard UI](https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/frontend/app.js): `secure-iot-mqtt/frontend/app.js`
- [Dashboard Page](https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/frontend/index.html): `secure-iot-mqtt/frontend/index.html`

### Attack Tool

- [MQTT Attack Tool](https://github.com/aggkavya/iot-is/blob/main/secure-iot-mqtt/attacker/attacker.py): `secure-iot-mqtt/attacker/attacker.py`

### Other components

- **Dashboard User**
- **Attacker**

## Connections

- Dashboard User → Dashboard UI: uses
- Dashboard UI → Dashboard Backend: requests API (evidence: `secure-iot-mqtt/frontend/app.js`)
- Dashboard Backend → Mosquitto Broker: publishes commands (evidence: `secure-iot-mqtt/backend/app.py`)
- Dashboard Backend → Mosquitto Broker: subscribes status (evidence: `secure-iot-mqtt/backend/app.py`)
- Mosquitto Broker → Dashboard Backend: delivers status (evidence: `secure-iot-mqtt/backend/app.py`)
- Door Device → Mosquitto Broker: subscribes commands (evidence: `secure-iot-mqtt/devices/door_device.py`)
- Door Device → Mosquitto Broker: publishes status (evidence: `secure-iot-mqtt/devices/door_device.py`)
- Light Device → Mosquitto Broker: subscribes commands (evidence: `secure-iot-mqtt/devices/light_device.py`)
- Light Device → Mosquitto Broker: publishes status (evidence: `secure-iot-mqtt/devices/light_device.py`)
- Alarm Device → Mosquitto Broker: subscribes commands (evidence: `secure-iot-mqtt/devices/alarm_device.py`)
- Alarm Device → Mosquitto Broker: publishes status (evidence: `secure-iot-mqtt/devices/alarm_device.py`)
- Vulnerable Config → Mosquitto Broker: configures mode
- Protected Config → Mosquitto Broker: configures mode
- Vulnerable ACL → Mosquitto Broker: sets authorization
- Protected ACL → Mosquitto Broker: sets authorization
- Attacker → MQTT Attack Tool: runs
- MQTT Attack Tool → Mosquitto Broker: publishes or subscribes (evidence: `secure-iot-mqtt/attacker/attacker.py`)
- MQTT Attack Tool → Dashboard Backend: reports attempts (evidence: `secure-iot-mqtt/attacker/attacker.py`)
- Dashboard Page → Dashboard UI: hosts interface
