Description: Securing IoT-Enabled Smart Factories using Mosquitto MQTT, Node-RED and Wazuh SIEM — RQF Level 03
This project demonstrates a complete Industry 4.0 cybersecurity implementation using open-source tools on Ubuntu Linux. It covers secure IoT communication, real-time industrial monitoring and live threat detection — all mapped to IEC 62443 and NIST CSF international frameworks.
"A smart factory is only as secure as its weakest connected device — we built the tools to protect it."
| Requirement | Implementation | Tool Used |
|---|---|---|
| Secure IoT Communication | MQTT with authentication | Mosquitto |
| Data Encryption | TLS certificates on Port 8883 | OpenSSL + Mosquitto |
| Real-Time Monitoring | Live industrial dashboard | Node-RED |
| Threat Detection | Brute force attack detected | Wazuh SIEM |
| NIST CSF Protect | MQTT authentication | Mosquitto |
| NIST CSF Detect | Live dashboard monitoring | Node-RED |
| NIST CSF Respond | Rule 5712 Level 10 alert | Wazuh |
| IEC 62443 | Zone access control | Full stack |
[IoT Sensors] → [MQTT Broker] → [Node-RED] → [Dashboard] ↓ ↓ [Auth Check] [Wazuh SIEM] ↓ ↓ [Access Denied] [Security Alerts]
- Publish-subscribe IoT protocol
- Username/password authentication enforced
- TLS encryption configured on Port 8883
- Anonymous connections completely blocked
- Visual flow-based programming tool
- Connects IoT sensors to live dashboard
- Displays temperature, pressure and device status
- Updates every 3 seconds automatically
- Real-time security monitoring platform
- Detected brute force attack — Rule 5712
- Severity Level 10 critical alert generated
- 1,134 security events monitored
Industry-4.0-Security-Demo/ │ ├── README.md ├── mqtt/ │ ├── mqtt_setup.md │ └── sensor_simulator.py ├── nodered/ │ ├── nodered_setup.md │ └── flow.json ├── wazuh/ │ └── wazuh_setup.md ├── screenshots/ │ ├── mqtt_demo.png │ ├── dashboard.png │ └── wazuh_alerts.png └── docs/ └── presentation.pdf
- Ubuntu 20.04 or later
- Python 3.x
- Docker and Docker Compose
- Node.js 18.x
git clone https://github.com/YOUR_USERNAME/Industry-4.0-Security-Demo.git
cd Industry-4.0-Security-Demosudo apt install mosquitto mosquitto-clients
sudo mosquitto_passwd -c /etc/mosquitto/passwd mqttuser
sudo systemctl restart mosquittosudo npm install -g --unsafe-perm node-red
node-redOpen: http://localhost:1880
cd wazuh-docker/single-node
docker compose up -dOpen: https://localhost
# Test authenticated connection
mosquitto_sub -h localhost -p 1883 \
-u mqttuser -P mqtt1234 \
-t factory/sensor
# Test anonymous blocked
mosquitto_pub -h localhost -p 1883 \
-t factory/sensor -m "test"
# Result: Connection Refused# Generate certificates
sudo openssl genrsa -out ca.key 2048
sudo openssl req -new -x509 -days 365 \
-key ca.key -out ca.crt -subj "/CN=localhost"# Simulate brute force attack
ssh wronguser@localhost
# Wazuh detects: Rule 5712 — Level 10| Test | Result |
|---|---|
| MQTT Authentication | ✅ Only mqttuser authorized |
| Anonymous Connection | ❌ Blocked — Connection refused |
| TLS Configuration | ✅ Certificates generated on Port 8883 |
| Dashboard | ✅ Live temperature and pressure monitoring |
| Brute Force Detection | ✅ Rule 5712 triggered — Level 10 |
| Total Events Monitored | 1,134 security events |
| Function | Implementation |
|---|---|
| Identify | IoT device inventory mapped |
| Protect | MQTT authentication + TLS |
| Detect | Node-RED dashboard + Wazuh |
| Respond | Wazuh Rule 5712 alert |
| Recover | System isolation procedures |
| Requirement | Implementation |
|---|---|
| Zone Access Control | MQTT authentication |
| Conduit Security | TLS encryption |
| Continuous Monitoring | Wazuh SIEM |
| Defence in Depth | 3-layer security stack |
- NIST Cybersecurity Framework v1.1 (2018)
- IEC 62443 Industrial Security Standard (2018)
- ENISA Threat Landscape for ICS (2022)
- Eclipse Mosquitto Documentation
- Node-RED Documentation
- Wazuh Documentation
Musfira RQF Level 03 — Industry 4.0 Security





