IoT Security Reviewer
Overview
Conduct comprehensive security reviews of IoT devices and embedded systems with focus on confidentiality, integrity, availability, authentication, and authorization. Apply industry best practices, OWASP IoT Top 10 guidelines, and platform-specific hardening techniques for ESP32, RP2350, Android, and MQTT-based systems.
When to Use This Skill
Trigger this skill for:
- Security audits of IoT firmware and embedded code
- Implementing secure authentication mechanisms (BLE, MQTT, API)
- Reviewing network security configurations (WiFi, TLS, certificates)
- Analyzing secure boot, OTA updates, and firmware integrity
- Hardening production deployments and removing vulnerabilities
- Evaluating data protection (encryption at rest and in transit)
- Conducting threat modeling and attack surface analysis
- Reviewing Argus system components or similar IoT architectures
Security Review Workflow
1. Initial Assessment
Understand the System:
- Identify all components (devices, gateways, apps, servers)
- Map communication channels and protocols
- Document trust boundaries and data flows
- Catalog sensitive data and assets
Quick Security Scan:
- Check for hardcoded credentials in source code
- Verify TLS/encryption is used for network communication
- Confirm secure boot and flash encryption are enabled
- Review authentication mechanisms
- Identify exposed services and open ports
2. Apply Security Checklist
Reference the comprehensive checklist in references/security_checklist.md covering:
Confidentiality - Data encryption, secure storage, log sanitization
Integrity - Firmware signing, secure boot, message authentication
Availability - DoS protection, resilience, monitoring
Authentication - Device identity, user auth, network auth
Authorization - Access control, privilege separation, RBAC
Network Security - WiFi, MQTT, protocols, segmentation
Physical Security - Debug interfaces, tamper detection
Compliance - OWASP IoT Top 10, privacy regulations
Work through each section systematically, checking off items as verified or identifying gaps.
3. Vulnerability Analysis
Review Against OWASP IoT Top 10:
Load references/common_vulnerabilities.md for detailed coverage of:
- Weak, guessable, or hardcoded passwords
- Insecure network services
- Insecure ecosystem interfaces
- Lack of secure update mechanism
- Use of insecure or outdated components
- Insufficient privacy protection
- Insecure data transfer and storage
- Lack of device management
- Insecure default settings
- Lack of physical hardening
Additional Vulnerability Classes:
- Side-channel attacks
- Buffer overflow and memory corruption
- Command injection
- Replay attacks
- Man-in-the-middle attacks
- Denial of service
For each vulnerability category:
- Check if the system is susceptible
- Assess severity and exploitability
- Recommend specific mitigations
- Prioritize fixes based on risk
4. Code Review and Implementation Guidance
Secure Implementation Examples:
When implementing security features or reviewing code, reference references/secure_examples.md for proven patterns:
- WiFi Security: NVS storage with encryption, flash encryption configuration
- MQTT TLS: Certificate validation, mutual TLS, cipher suite selection
- BLE Security: Secure Simple Pairing, bonding, passkey implementation
- OTA Updates: Signature verification, secure boot integration, rollback protection
- API Keys: Rotation strategies, secure storage, grace period handling
Code Review Focus Areas:
- Memory safety (bounds checking, zero after use)
- Cryptographic implementation (use proven libraries)
- Input validation (sanitization, length checks)
- Error handling (secure failure, no info leakage)
- Privilege separation (least privilege principle)
5. Architecture-Specific Reviews
For Argus or Similar Systems:
Load references/argus_security.md for system-specific guidance:
- Network segmentation: VLAN configuration, firewall rules
- Trust model: Multi-tier authentication and encryption
- Component security: T-Embed (ESP32-S3), Presto (RP2350), Android app
- MQTT broker: Mosquitto configuration, ACL, TLS setup
- Threat scenarios: Specific attack vectors and mitigations
- Incident response: Detection, response, recovery procedures
Apply to Your System:
- Adapt the trust model to your architecture
- Customize ACL rules for your topic structure
- Implement appropriate certificate pinning
- Configure network segmentation
- Define incident response procedures
6. Testing and Validation
Static Analysis:
- Run cppcheck or clang-tidy on C/C++ code
- Use SonarQube for multi-language projects
- Scan dependencies with OWASP Dependency-Check
Dynamic Testing:
- Test authentication bypass attempts
- Verify certificate validation
- Attempt replay attacks
- Test rate limiting and DoS protection
- Validate input sanitization
Network Analysis:
- Capture traffic with Wireshark
- Verify all communication is encrypted
- Check for certificate validation
- Scan for open ports with nmap
- Test for MITM vulnerabilities
Penetration Testing:
- Attempt to extract credentials from device
- Test physical security (debug ports, JTAG)
- Try firmware downgrade attacks
- Test BLE pairing security
- Attempt privilege escalation
7. Documentation and Reporting
Security Report Structure:
- Executive Summary: High-level findings and risk assessment
- System Overview: Components, architecture, data flows
- Findings: Vulnerabilities discovered with severity ratings
- Recommendations: Prioritized remediation steps
- Compliance: OWASP IoT Top 10 coverage, regulatory compliance
- Testing Results: Static analysis, penetration testing outcomes
- Action Items: Specific tasks with assignees and timelines
Risk Rating:
- Critical: Hardcoded credentials, no encryption, exposed debug ports
- High: Weak authentication, missing OTA security, no input validation
- Medium: Outdated libraries, verbose logging, weak cipher suites
- Low: Missing monitoring, incomplete documentation, minor hardening
Security Implementation Guidelines
Quick Wins (Implement First)
Enable Flash Encryption (ESP32)
#define CONFIG_SECURE_FLASH_ENC_ENABLED 1
Enable Secure Boot
#define CONFIG_SECURE_BOOT_V2_ENABLED 1
Use TLS for All Network Communication
- MQTT: Use mqtts:// on port 8883
- HTTP: Use https:// only
- Validate certificates, don't skip verification
Store Credentials Securely
- Use encrypted NVS on ESP32
- Android Keystore for mobile apps
- Never hardcode in source code
Implement API Key Rotation
- Generate strong, random keys
- Rotate every 90 days
- Support key grace period
Platform-Specific Hardening
ESP32/ESP32-S3:
- Enable flash encryption and secure boot
- Disable JTAG and UART console in production
- Use hardware RNG for key generation
- Implement watchdog timer
- Clear sensitive data from memory after use
RP2350 (MicroPython):
- Hash validation for uploaded scripts
- Whitelist allowed modules
- Restrict filesystem access
- Secure BLE bonding storage
- Disable dangerous built-ins in production
Android:
- Use Android Keystore for secrets
- Implement certificate pinning
- Enable ProGuard/R8 obfuscation
- Remove debug logs in release builds
- Network security configuration with cleartext disabled
MQTT Broker:
- Require TLS on port 8883
- Enforce client authentication
- Implement topic-based ACL
- Use strong cipher suites (TLS 1.2+)
- Monitor failed authentication attempts
Defense in Depth Strategy
Apply multiple layers of security:
- Network Layer: TLS encryption, certificate validation, network segmentation
- Application Layer: Authentication, authorization, input validation
- Device Layer: Secure boot, flash encryption, physical hardening
- Monitoring Layer: Logging, anomaly detection, alerting
- Operational Layer: Update mechanism, incident response, key rotation
Using the References
Quick Reference Guide
- Conducting a security audit? → Start with
references/security_checklist.md
- Reviewing for specific vulnerabilities? → Use
references/common_vulnerabilities.md
- Implementing secure features? → Reference
references/secure_examples.md
- Reviewing Argus system? → Load
references/argus_security.md
Search Patterns for Large References
If reference files are extensive, use these grep patterns:
# Find specific vulnerability information
grep -i "hardcoded" references/common_vulnerabilities.md
# Locate implementation examples
grep -B5 -A20 "esp_mqtt_client_config_t" references/secure_examples.md
# Find checklist items
grep "\[ \]" references/security_checklist.md
# Search for Argus-specific guidance
grep -i "t-embed\|presto" references/argus_security.md
Common Security Patterns
Secure By Default
- Deny by default, allow explicitly
- Fail securely (deny on error)
- Minimum necessary privileges
- Encrypted by default
- Strong authentication required
Security Anti-Patterns to Avoid
❌ Hardcoded credentials or API keys
❌ Disabled certificate validation ("to make it work")
❌ HTTP instead of HTTPS
❌ Admin/admin default credentials
❌ Debug code left in production
❌ Sensitive data in logs
❌ Unsigned firmware updates
❌ No input validation
❌ Weak encryption (WEP, MD5, SHA1)
❌ Exposed debug ports (JTAG, UART)
Security Best Practices
✅ Use proven crypto libraries (mbedTLS, OpenSSL)
✅ Validate all inputs (length, type, range)
✅ Use constant-time comparisons for secrets
✅ Zero sensitive data after use
✅ Implement rate limiting
✅ Log security events
✅ Keep dependencies updated
✅ Enable all security features
✅ Regular security audits
✅ Incident response plan
Tools and Techniques
Static Analysis
- cppcheck:
cppcheck --enable=all src/
- clang-tidy:
clang-tidy src/*.cpp
- SonarQube: Multi-language code quality
Dependency Scanning
- OWASP Dependency-Check: Identify vulnerable libraries
- npm audit / pip-audit: Language-specific scanners
Network Analysis
- Wireshark: Packet capture and protocol analysis
- nmap: Port scanning and service detection
Penetration Testing
- Metasploit: Exploit framework
- Aircrack-ng: WiFi security testing
- Burp Suite: Web application testing
Output Format
When completing a security review, provide:
- Summary: Overall security posture (Strong/Moderate/Weak)
- Critical Findings: Issues requiring immediate attention
- Compliance Status: OWASP IoT Top 10 coverage
- Recommendations: Prioritized action items with code examples
- Risk Assessment: Likelihood and impact of identified vulnerabilities
- Remediation Timeline: Suggested timeline for fixes
Use code examples from the references to demonstrate secure implementations for identified issues.
Continuous Security
Security is not a one-time review but an ongoing process:
- Regular audits: Quarterly security reviews
- Dependency updates: Monitor and patch vulnerabilities
- Threat modeling: Update as architecture evolves
- Penetration testing: Annual third-party testing
- Incident response drills: Test response procedures
- Security training: Keep team updated on best practices
This skill provides comprehensive IoT security review capabilities. Load the reference files as needed for detailed checklists, vulnerability information, implementation examples, and system-specific guidance.
1---2name: iot-security-reviewer3description: Expert IoT security review covering network security, authentication, encryption, secure boot, and attack surface analysis. Use when reviewing device security, implementing authentication, hardening firmware, conducting security audits, or analyzing embedded systems for vulnerabilities. Particularly valuable for ESP32/RP2350 projects, BLE/WiFi devices, MQTT systems, and mobile IoT applications.4---5
6# IoT Security Reviewer
7
8## Overview
9
10Conduct comprehensive security reviews of IoT devices and embedded systems with focus on confidentiality, integrity, availability, authentication, and authorization. Apply industry best practices, OWASP IoT Top 10 guidelines, and platform-specific hardening techniques for ESP32, RP2350, Android, and MQTT-based systems.
11
12## When to Use This Skill
13
14Trigger this skill for:
15- Security audits of IoT firmware and embedded code
16- Implementing secure authentication mechanisms (BLE, MQTT, API)
17- Reviewing network security configurations (WiFi, TLS, certificates)
18- Analyzing secure boot, OTA updates, and firmware integrity
19- Hardening production deployments and removing vulnerabilities
20- Evaluating data protection (encryption at rest and in transit)
21- Conducting threat modeling and attack surface analysis
22- Reviewing Argus system components or similar IoT architectures
23
24## Security Review Workflow
25
26### 1. Initial Assessment
27
28**Understand the System:**
29- Identify all components (devices, gateways, apps, servers)
30- Map communication channels and protocols
31- Document trust boundaries and data flows
32- Catalog sensitive data and assets
33
34**Quick Security Scan:**
35- Check for hardcoded credentials in source code
36- Verify TLS/encryption is used for network communication
37- Confirm secure boot and flash encryption are enabled
38- Review authentication mechanisms
39- Identify exposed services and open ports
40
41### 2. Apply Security Checklist
42
43Reference the comprehensive checklist in `references/security_checklist.md` covering:
44
45**Confidentiality** - Data encryption, secure storage, log sanitization
46**Integrity** - Firmware signing, secure boot, message authentication
47**Availability** - DoS protection, resilience, monitoring
48**Authentication** - Device identity, user auth, network auth
49**Authorization** - Access control, privilege separation, RBAC
50**Network Security** - WiFi, MQTT, protocols, segmentation
51**Physical Security** - Debug interfaces, tamper detection
52**Compliance** - OWASP IoT Top 10, privacy regulations
53
54Work through each section systematically, checking off items as verified or identifying gaps.
55
56### 3. Vulnerability Analysis
57
58**Review Against OWASP IoT Top 10:**
59
60Load `references/common_vulnerabilities.md` for detailed coverage of:
611. Weak, guessable, or hardcoded passwords
622. Insecure network services
633. Insecure ecosystem interfaces
644. Lack of secure update mechanism
655. Use of insecure or outdated components
666. Insufficient privacy protection
677. Insecure data transfer and storage
688. Lack of device management
699. Insecure default settings
7010. Lack of physical hardening
71
72**Additional Vulnerability Classes:**
73- Side-channel attacks
74- Buffer overflow and memory corruption
75- Command injection
76- Replay attacks
77- Man-in-the-middle attacks
78- Denial of service
79
80For each vulnerability category:
81- Check if the system is susceptible
82- Assess severity and exploitability
83- Recommend specific mitigations
84- Prioritize fixes based on risk
85
86### 4. Code Review and Implementation Guidance
87
88**Secure Implementation Examples:**
89
90When implementing security features or reviewing code, reference `references/secure_examples.md` for proven patterns:
91
92- **WiFi Security**: NVS storage with encryption, flash encryption configuration
93- **MQTT TLS**: Certificate validation, mutual TLS, cipher suite selection
94- **BLE Security**: Secure Simple Pairing, bonding, passkey implementation
95- **OTA Updates**: Signature verification, secure boot integration, rollback protection
96- **API Keys**: Rotation strategies, secure storage, grace period handling
97
98**Code Review Focus Areas:**
99- Memory safety (bounds checking, zero after use)
100- Cryptographic implementation (use proven libraries)
101- Input validation (sanitization, length checks)
102- Error handling (secure failure, no info leakage)
103- Privilege separation (least privilege principle)
104
105### 5. Architecture-Specific Reviews
106
107**For Argus or Similar Systems:**
108
109Load `references/argus_security.md` for system-specific guidance:
110
111- **Network segmentation**: VLAN configuration, firewall rules
112- **Trust model**: Multi-tier authentication and encryption
113- **Component security**: T-Embed (ESP32-S3), Presto (RP2350), Android app
114- **MQTT broker**: Mosquitto configuration, ACL, TLS setup
115- **Threat scenarios**: Specific attack vectors and mitigations
116- **Incident response**: Detection, response, recovery procedures
117
118**Apply to Your System:**
119- Adapt the trust model to your architecture
120- Customize ACL rules for your topic structure
121- Implement appropriate certificate pinning
122- Configure network segmentation
123- Define incident response procedures
124
125### 6. Testing and Validation
126
127**Static Analysis:**
128- Run cppcheck or clang-tidy on C/C++ code
129- Use SonarQube for multi-language projects
130- Scan dependencies with OWASP Dependency-Check
131
132**Dynamic Testing:**
133- Test authentication bypass attempts
134- Verify certificate validation
135- Attempt replay attacks
136- Test rate limiting and DoS protection
137- Validate input sanitization
138
139**Network Analysis:**
140- Capture traffic with Wireshark
141- Verify all communication is encrypted
142- Check for certificate validation
143- Scan for open ports with nmap
144- Test for MITM vulnerabilities
145
146**Penetration Testing:**
147- Attempt to extract credentials from device
148- Test physical security (debug ports, JTAG)
149- Try firmware downgrade attacks
150- Test BLE pairing security
151- Attempt privilege escalation
152
153### 7. Documentation and Reporting
154
155**Security Report Structure:**
1561. **Executive Summary**: High-level findings and risk assessment
1572. **System Overview**: Components, architecture, data flows
1583. **Findings**: Vulnerabilities discovered with severity ratings
1594. **Recommendations**: Prioritized remediation steps
1605. **Compliance**: OWASP IoT Top 10 coverage, regulatory compliance
1616. **Testing Results**: Static analysis, penetration testing outcomes
1627. **Action Items**: Specific tasks with assignees and timelines
163
164**Risk Rating:**
165- **Critical**: Hardcoded credentials, no encryption, exposed debug ports
166- **High**: Weak authentication, missing OTA security, no input validation
167- **Medium**: Outdated libraries, verbose logging, weak cipher suites
168- **Low**: Missing monitoring, incomplete documentation, minor hardening
169
170## Security Implementation Guidelines
171
172### Quick Wins (Implement First)
173
1741. **Enable Flash Encryption** (ESP32)
175 ```c
176 #define CONFIG_SECURE_FLASH_ENC_ENABLED 1
177 ```
178
1792. **Enable Secure Boot**
180 ```c
181 #define CONFIG_SECURE_BOOT_V2_ENABLED 1
182 ```
183
1843. **Use TLS for All Network Communication**
185 - MQTT: Use mqtts:// on port 8883
186 - HTTP: Use https:// only
187 - Validate certificates, don't skip verification
188
1894. **Store Credentials Securely**
190 - Use encrypted NVS on ESP32
191 - Android Keystore for mobile apps
192 - Never hardcode in source code
193
1945. **Implement API Key Rotation**
195 - Generate strong, random keys
196 - Rotate every 90 days
197 - Support key grace period
198
199### Platform-Specific Hardening
200
201**ESP32/ESP32-S3:**
202- Enable flash encryption and secure boot
203- Disable JTAG and UART console in production
204- Use hardware RNG for key generation
205- Implement watchdog timer
206- Clear sensitive data from memory after use
207
208**RP2350 (MicroPython):**
209- Hash validation for uploaded scripts
210- Whitelist allowed modules
211- Restrict filesystem access
212- Secure BLE bonding storage
213- Disable dangerous built-ins in production
214
215**Android:**
216- Use Android Keystore for secrets
217- Implement certificate pinning
218- Enable ProGuard/R8 obfuscation
219- Remove debug logs in release builds
220- Network security configuration with cleartext disabled
221
222**MQTT Broker:**
223- Require TLS on port 8883
224- Enforce client authentication
225- Implement topic-based ACL
226- Use strong cipher suites (TLS 1.2+)
227- Monitor failed authentication attempts
228
229### Defense in Depth Strategy
230
231Apply multiple layers of security:
232
2331. **Network Layer**: TLS encryption, certificate validation, network segmentation
2342. **Application Layer**: Authentication, authorization, input validation
2353. **Device Layer**: Secure boot, flash encryption, physical hardening
2364. **Monitoring Layer**: Logging, anomaly detection, alerting
2375. **Operational Layer**: Update mechanism, incident response, key rotation
238
239## Using the References
240
241### Quick Reference Guide
242
243- **Conducting a security audit?** → Start with `references/security_checklist.md`
244- **Reviewing for specific vulnerabilities?** → Use `references/common_vulnerabilities.md`
245- **Implementing secure features?** → Reference `references/secure_examples.md`
246- **Reviewing Argus system?** → Load `references/argus_security.md`
247
248### Search Patterns for Large References
249
250If reference files are extensive, use these grep patterns:
251
252```bash
253# Find specific vulnerability information
254grep -i "hardcoded" references/common_vulnerabilities.md
255
256# Locate implementation examples
257grep -B5 -A20 "esp_mqtt_client_config_t" references/secure_examples.md
258
259# Find checklist items
260grep "\[ \]" references/security_checklist.md
261
262# Search for Argus-specific guidance
263grep -i "t-embed\|presto" references/argus_security.md
264```
265
266## Common Security Patterns
267
268### Secure By Default
269
270- Deny by default, allow explicitly
271- Fail securely (deny on error)
272- Minimum necessary privileges
273- Encrypted by default
274- Strong authentication required
275
276### Security Anti-Patterns to Avoid
277
278❌ Hardcoded credentials or API keys
279❌ Disabled certificate validation ("to make it work")
280❌ HTTP instead of HTTPS
281❌ Admin/admin default credentials
282❌ Debug code left in production
283❌ Sensitive data in logs
284❌ Unsigned firmware updates
285❌ No input validation
286❌ Weak encryption (WEP, MD5, SHA1)
287❌ Exposed debug ports (JTAG, UART)
288
289### Security Best Practices
290
291✅ Use proven crypto libraries (mbedTLS, OpenSSL)
292✅ Validate all inputs (length, type, range)
293✅ Use constant-time comparisons for secrets
294✅ Zero sensitive data after use
295✅ Implement rate limiting
296✅ Log security events
297✅ Keep dependencies updated
298✅ Enable all security features
299✅ Regular security audits
300✅ Incident response plan
301
302## Tools and Techniques
303
304### Static Analysis
305- **cppcheck**: `cppcheck --enable=all src/`
306- **clang-tidy**: `clang-tidy src/*.cpp`
307- **SonarQube**: Multi-language code quality
308
309### Dependency Scanning
310- **OWASP Dependency-Check**: Identify vulnerable libraries
311- **npm audit** / **pip-audit**: Language-specific scanners
312
313### Network Analysis
314- **Wireshark**: Packet capture and protocol analysis
315- **nmap**: Port scanning and service detection
316
317### Penetration Testing
318- **Metasploit**: Exploit framework
319- **Aircrack-ng**: WiFi security testing
320- **Burp Suite**: Web application testing
321
322## Output Format
323
324When completing a security review, provide:
325
3261. **Summary**: Overall security posture (Strong/Moderate/Weak)
3272. **Critical Findings**: Issues requiring immediate attention
3283. **Compliance Status**: OWASP IoT Top 10 coverage
3294. **Recommendations**: Prioritized action items with code examples
3305. **Risk Assessment**: Likelihood and impact of identified vulnerabilities
3316. **Remediation Timeline**: Suggested timeline for fixes
332
333Use code examples from the references to demonstrate secure implementations for identified issues.
334
335## Continuous Security
336
337Security is not a one-time review but an ongoing process:
338
339- **Regular audits**: Quarterly security reviews
340- **Dependency updates**: Monitor and patch vulnerabilities
341- **Threat modeling**: Update as architecture evolves
342- **Penetration testing**: Annual third-party testing
343- **Incident response drills**: Test response procedures
344- **Security training**: Keep team updated on best practices
345
346---
347
348This skill provides comprehensive IoT security review capabilities. Load the reference files as needed for detailed checklists, vulnerability information, implementation examples, and system-specific guidance.