By the end of this chapter, you should be able to:
Map security architecture layers across IoT systems (device, network, cloud)
Identify and classify common IoT attack surfaces and vulnerabilities
Construct defense-in-depth strategies for production IoT deployments
Interpret attack trees to prioritize security countermeasures
Select layered security controls appropriate for each architectural level
In 60 Seconds
IoT security architecture translates threat models and security requirements into concrete system designs — specifying which security controls are applied at each layer (device, gateway, cloud, management) and how they integrate into a cohesive defence. The key architectural principle is that security must be designed in from the start: retrofitting security onto an insecure architecture is orders of magnitude more expensive than designing it correctly initially.
For Beginners: Security Architecture & Attacks
IoT security threats refer to the various ways that connected devices and their data can be compromised. Think of your IoT system as a house – you need to understand how burglars might try to get in before you can choose the right locks, alarms, and security cameras. This chapter helps you understand the threats so you can build effective defenses.
Sensor Squad: Building the Security Blueprint!
“Before you build a house, you need a blueprint,” Max the Microcontroller explained. “Security architecture is the blueprint for protecting our entire IoT system. It shows three main layers: the device layer where I live, the network layer where messages travel, and the cloud layer where data gets stored and analyzed.”
Sammy the Sensor added, “Each layer has its own attack surface – that is a fancy term for all the places where a bad guy might try to break in. At the device layer, attackers might try to physically tamper with me or extract my firmware. At the network layer, they might eavesdrop on messages. At the cloud layer, they might try to hack the API.”
“An attack tree is a really cool way to think about this,” Lila the LED said. “It is like a family tree, but for attacks! At the top is the attacker’s goal – say, stealing sensor data. Then below that are all the different ways they could achieve it, branching out into specific steps. It helps defenders see ALL possible attack paths and block the most dangerous ones.”
“The security maturity model shows how to improve over time,” Bella the Battery explained. “Level 1 is basic – just passwords and firewalls. Level 2 adds monitoring and incident response. Level 3 has automated threat detection. Level 4 is the gold standard with continuous security testing and zero-trust architecture. You do not have to do everything at once, but you should always be climbing to the next level!”
5.2 Defense-in-Depth Layers
Figure 5.1: Defense-in-depth showing five security layers that attackers must breach sequentially - failure of one layer does not compromise the system
Try It: Defense-in-Depth Layer Explorer
Explore each security layer in a defense-in-depth architecture. Select a layer to see its controls, typical attacks it defends against, and what happens when that layer is breached.
Show code
viewof selectedLayer = Inputs.select( ["Perimeter (Firewall & Segmentation)","Authentication & Access Control","Encryption & Data Protection","Application Security","Device-Level Security"], {label:"Select a security layer:",value:"Perimeter (Firewall & Segmentation)" })viewof breachedLayers = Inputs.range([0,5], {value:0,step:1,label:"Number of layers breached by attacker:"})
Show code
{const layers = [ {name:"Perimeter (Firewall & Segmentation)",color:"#3498DB",controls: ["Network firewall rules","VLAN segmentation","DMZ for IoT devices","Intrusion Detection System (IDS)"],attacks: ["Port scanning","Network reconnaissance","Unauthorized access attempts"],breach:"Attacker gains network access but still faces authentication, encryption, and application controls." }, {name:"Authentication & Access Control",color:"#16A085",controls: ["Multi-factor authentication","Role-based access control (RBAC)","Device certificates (X.509)","OAuth 2.0 / JWT tokens"],attacks: ["Credential stuffing","Brute-force attacks","Session hijacking"],breach:"Attacker can impersonate users/devices but encrypted data and application validation remain." }, {name:"Encryption & Data Protection",color:"#E67E22",controls: ["TLS 1.3 for data in transit","AES-256 for data at rest","End-to-end encryption","Key management (HSM)"],attacks: ["Man-in-the-middle attacks","Eavesdropping","Data exfiltration"],breach:"Attacker can read data but application-level validation and device security still protect the system." }, {name:"Application Security",color:"#9B59B6",controls: ["Input validation & sanitization","API rate limiting","Secure coding practices","Web Application Firewall (WAF)"],attacks: ["SQL injection","Cross-site scripting (XSS)","Buffer overflow","API abuse"],breach:"Attacker can manipulate application logic but device-level security (secure boot, tamper detection) remains." }, {name:"Device-Level Security",color:"#E74C3C",controls: ["Secure boot chain","Hardware root of trust (TPM/HSM)","Tamper detection","Firmware signing"],attacks: ["Physical tampering","Firmware extraction","Side-channel attacks","Debug port exploitation"],breach:"FULL COMPROMISE: All layers breached. Attacker has complete control of the device and its data." } ];const selected = layers.find(l => l.name=== selectedLayer);const breached =Math.round(breachedLayers);const svgWidth =600;const svgHeight =300;const centerX = svgWidth /2;const centerY = svgHeight /2;let svg =`<svg width="100%" viewBox="0 0 ${svgWidth}${svgHeight}" xmlns="http://www.w3.org/2000/svg" style="font-family: Arial, sans-serif;">`;// Draw concentric rectangles for layers (outer to inner)for (let i =0; i < layers.length; i++) {const padding = i *28;const x =10+ padding;const y =10+ padding;const w = svgWidth -20- padding *2;const h = svgHeight -20- padding *2;const isBreached = i < breached;const isSelected = layers[i].name=== selectedLayer;const fillColor = isBreached ?"#f8d7da": (isSelected ? layers[i].color+"33": layers[i].color+"18");const strokeColor = isBreached ?"#E74C3C": layers[i].color;const strokeWidth = isSelected ?3:1.5;const dashArray = isBreached ?"8,4":"none"; svg +=`<rect x="${x}" y="${y}" width="${w}" height="${h}" rx="8" fill="${fillColor}" stroke="${strokeColor}" stroke-width="${strokeWidth}" stroke-dasharray="${dashArray}" />`;if (w >120) {const fontSize = i ===4?10:9;const label = ["Perimeter","Auth & Access","Encryption","App Security","Device"][i]; svg +=`<text x="${x +8}" y="${y +14}" font-size="${fontSize}" fill="${strokeColor}" font-weight="${isSelected ?'bold':'normal'}">${label}${isBreached ?' [BREACHED]':''}</text>`; } }// Attacker arrowif (breached >0) {const arrowEndY =10+ (breached -1) *28+14; svg +=`<line x1="${svgWidth -30}" y1="5" x2="${svgWidth -30}" y2="${arrowEndY +20}" stroke="#E74C3C" stroke-width="2.5" marker-end="url(#arrowhead)" />`; svg +=`<defs><marker id="arrowhead" markerWidth="10" markerHeight="7" refX="10" refY="3.5" orient="auto"><polygon points="0 0, 10 3.5, 0 7" fill="#E74C3C" /></marker></defs>`; svg +=`<text x="${svgWidth -50}" y="12" font-size="10" fill="#E74C3C" font-weight="bold" text-anchor="end">Attacker</text>`; } svg +=`</svg>`;const statusColor = breached >=5?"#E74C3C": breached >=3?"#E67E22": breached >=1?"#F39C12":"#16A085";const statusText = breached >=5?"SYSTEM COMPROMISED": breached >=3?"CRITICAL RISK": breached >=1?"PARTIAL BREACH":"ALL LAYERS INTACT";returnhtml`<div style="background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); border-radius: 8px; padding: 20px; border-left: 5px solid ${selected.color};"> <div style="text-align: center; margin-bottom: 15px;"> <span style="font-size: 18px; font-weight: bold; color: ${statusColor};">${statusText}</span> <span style="font-size: 14px; color: #7F8C8D; margin-left: 10px;">(${breached}/5 layers breached)</span> </div>${svg} <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px;"> <div style="background: white; padding: 12px; border-radius: 6px; border-top: 3px solid ${selected.color};"> <strong style="color: ${selected.color};">Security Controls</strong> <ul style="margin: 8px 0 0 0; padding-left: 18px; font-size: 14px;">${selected.controls.map(c =>`<li>${c}</li>`).join("")}</ul> </div> <div style="background: white; padding: 12px; border-radius: 6px; border-top: 3px solid #E74C3C;"> <strong style="color: #E74C3C;">Attacks Defended Against</strong> <ul style="margin: 8px 0 0 0; padding-left: 18px; font-size: 14px;">${selected.attacks.map(a =>`<li>${a}</li>`).join("")}</ul> </div> </div> <div style="background: #fff3cd; padding: 12px; border-radius: 6px; margin-top: 10px; border-left: 4px solid #E67E22;"> <strong style="color: #2C3E50;">If this layer is breached:</strong> <span style="font-size: 14px;">${selected.breach}</span> </div> </div>`;}
5.3 IoT Attack Tree
Figure 5.2: IoT attack tree showing common vulnerability paths: physical access (debug ports, firmware extraction), network attacks (default credentials, unencrypted traffic), software exploits (buffer overflow, injection), and supply chain attacks
5.4 Security Maturity Model
Figure 5.3: Security maturity progression from initial (insecure defaults) through basic (unique passwords, encryption) to managed (PKI, secure boot) and optimized (zero-trust, hardware security modules)
5.5 Interactive Security Quiz
Test your understanding of security and privacy concepts with instant feedback.
IoT Security Fundamentals Quiz
Show code
viewof q1 = Inputs.radio( ["Confidentiality","Integrity","Availability","Authentication"], {label:"Question 1: A hacker intercepts your smart lock's 'unlock' command and modifies it to 'lock'. Which CIA property is violated?",value:null })q1_feedback = {if (q1 ===null) return"";if (q1 ==="Integrity") {returnhtml`<div style="padding: 15px; background: #d4edda; border-left: 4px solid #28a745; margin-top: 10px; border-radius: 4px;"> <strong>✅ Correct!</strong> This is an <strong>Integrity</strong> violation. The data was modified in transit. The attacker changed the command from "unlock" to "lock", tampering with the message content. Defense: Use HMAC or digital signatures to detect modifications. </div>`; } else {returnhtml`<div style="padding: 15px; background: #f8d7da; border-left: 4px solid #dc3545; margin-top: 10px; border-radius: 4px;"> <strong>❌ Incorrect.</strong> The correct answer is <strong>Integrity</strong>. The data was tampered with (modified from "unlock" to "lock") during transmission. Confidentiality would be violated if the attacker <em>read</em> the command. Availability would be violated if the attacker <em>blocked</em> the command. Integrity violations involve <strong>unauthorized modification</strong> of data. </div>`; }}viewof q2 = Inputs.radio( ["The encryption algorithm is too weak","Default credentials can be found with a Google search","The device lacks a hardware security module","The firmware update mechanism is insecure" ], {label:"Question 2: The 2016 Mirai botnet compromised 600,000+ IoT devices. What was the PRIMARY vulnerability?",value:null })q2_feedback = {if (q2 ===null) return"";if (q2 ==="Default credentials can be found with a Google search") {returnhtml`<div style="padding: 15px; background: #d4edda; border-left: 4px solid #28a745; margin-top: 10px; border-radius: 4px;"> <strong>✅ Correct!</strong> Mirai exploited <strong>default credentials</strong> (admin/admin, root/12345, etc.) that were never changed by users. The botnet systematically scanned the internet trying common username/password combinations. Lesson: Force users to change default passwords on first boot, or use unique per-device credentials. </div>`; } else {returnhtml`<div style="padding: 15px; background: #f8d7da; border-left: 4px solid #dc3545; margin-top: 10px; border-radius: 4px;"> <strong>❌ Incorrect.</strong> The correct answer is <strong>default credentials</strong>. Mirai didn't crack encryption or exploit firmware updates—it simply logged in using factory-default passwords like "admin/admin" that users never changed. This is OWASP IoT Top 10 #2: Weak, Guessable, or Hardcoded Passwords. The attack succeeded because devices shipped with known default credentials and didn't force password changes. </div>`; }}viewof q3 = Inputs.radio( ["Security protects systems; Privacy protects personal data","Security is for enterprises; Privacy is for consumers","Security uses encryption; Privacy uses anonymization","Security is technical; Privacy is legal" ], {label:"Question 3: What is the PRIMARY distinction between Security and Privacy?",value:null })q3_feedback = {if (q3 ===null) return"";if (q3 ==="Security protects systems; Privacy protects personal data") {returnhtml`<div style="padding: 15px; background: #d4edda; border-left: 4px solid #28a745; margin-top: 10px; border-radius: 4px;"> <strong>✅ Correct!</strong> <strong>Security</strong> focuses on protecting systems from attacks (CIA triad: Confidentiality, Integrity, Availability). <strong>Privacy</strong> focuses on protecting personal information and giving users control over their data. You can have secure systems that violate privacy (e.g., encrypted surveillance collecting excessive data), or private systems that lack security (e.g., minimal data collection but weak authentication). Both are essential for IoT. </div>`; } else {returnhtml`<div style="padding: 15px; background: #f8d7da; border-left: 4px solid #dc3545; margin-top: 10px; border-radius: 4px;"> <strong>❌ Incorrect.</strong> The correct answer is <strong>"Security protects systems; Privacy protects personal data"</strong>. While the other options contain partial truths (privacy does have legal aspects like GDPR, security uses encryption), the fundamental distinction is the <em>focus</em>: security prevents unauthorized access/attacks on systems, while privacy controls how personal information is collected, used, and shared. Security <strong>enables</strong> privacy but doesn't guarantee it. </div>`; }}viewof q4 = Inputs.radio( ["Encrypt the video feed with AES-256","Change the default password immediately","Enable two-factor authentication","Install security updates monthly" ], {label:"Question 4: You just bought a smart camera for your home. What is the MOST important first step?",value:null })q4_feedback = {if (q4 ===null) return"";if (q4 ==="Change the default password immediately") {returnhtml`<div style="padding: 15px; background: #d4edda; border-left: 4px solid #28a745; margin-top: 10px; border-radius: 4px;"> <strong>✅ Correct!</strong> <strong>Changing default credentials</strong> is the #1 priority. Most IoT breaches (including Mirai, Ring cameras, baby monitors) exploit default passwords that are publicly documented. Until you change "admin/admin" to a strong unique password, your camera is vulnerable to automated attacks. AES-256 encryption won't help if attackers can log in with default credentials. Do this BEFORE connecting to the internet. </div>`; } else {returnhtml`<div style="padding: 15px; background: #f8d7da; border-left: 4px solid #dc3545; margin-top: 10px; border-radius: 4px;"> <strong>❌ Incorrect.</strong> The correct answer is <strong>change the default password</strong>. While encryption, 2FA, and updates are important, they're useless if attackers can simply log in with "admin/admin". Default credentials are the #1 attack vector for IoT devices. Many cameras have strong encryption but are compromised because users never changed the password. The correct order: (1) Change password, (2) Enable 2FA, (3) Update firmware, (4) Verify encryption is enabled. </div>`; }}viewof q5 = Inputs.radio( ["Availability - the lock stopped working","Confidentiality - the unlock code was stolen","Integrity - the unlock command was modified","Authentication - the attacker impersonated the user" ], {label:"Question 5: An attacker uses a DDoS attack to flood your smart lock with requests, making it unresponsive. Which CIA property is violated?",value:null })q5_feedback = {if (q5 ===null) return"";if (q5 ==="Availability - the lock stopped working") {returnhtml`<div style="padding: 15px; background: #d4edda; border-left: 4px solid #28a745; margin-top: 10px; border-radius: 4px;"> <strong>✅ Correct!</strong> This is an <strong>Availability</strong> violation. DDoS (Distributed Denial of Service) attacks overwhelm systems with traffic, making them unavailable to legitimate users. The lock is unresponsive—you can't unlock your door. Defense: Rate limiting (reject excessive requests), resource quotas, DDoS mitigation services (Cloudflare), and network segmentation to isolate IoT devices. </div>`; } else {returnhtml`<div style="padding: 15px; background: #f8d7da; border-left: 4px solid #dc3545; margin-top: 10px; border-radius: 4px;"> <strong>❌ Incorrect.</strong> The correct answer is <strong>Availability</strong>. DDoS attacks make systems <strong>unavailable</strong> by flooding them with requests until they can't respond to legitimate traffic. The attacker didn't steal data (Confidentiality), modify commands (Integrity), or impersonate you (Authentication)—they simply overwhelmed the device. This is the "A" in the CIA triad: ensuring systems remain accessible when needed. </div>`; }}
Test your understanding of security and privacy concepts.
Quiz 1: Key Distinction
5.7 The CIA Triad
⏱️ ~10 min | ⭐ Foundational | 📋 P11.C01.U03
Key Concepts
Security reference architecture: A reusable architectural template for a class of IoT systems specifying security controls, protocols, and integration patterns validated against a defined threat model.
Layered security model: An architecture where independent security controls are applied at the physical, network, transport, application, and management layers, each providing protection against specific attack categories.
Trust boundary: A boundary in the system architecture where data crosses from one security domain to another, requiring explicit security controls (authentication, authorisation, encryption, validation) at the crossing point.
Security control placement: The decision of where in the architecture to apply each security control, balancing effectiveness (close to the threat), performance impact, and resource constraints.
Residual risk: The risk that remains after all chosen security controls are implemented — accepted by the system owner as the cost of the remaining gap between perfect security and what is practically achievable.
The foundational security principles are Confidentiality, Integrity, and Availability (CIA):
Figure 5.4: CIA Triad diagram showing three security pillars
5.7.1 Confidentiality
Definition: Ensuring information is accessible only to authorized parties.
IoT Examples:
Smart home camera footage should not be publicly accessible
Definition: Ensuring information has not been altered or tampered with.
IoT Examples:
Firmware updates are authentic and unmodified
Sensor readings haven’t been manipulated
Command messages from authorized source
Threats:
Firmware injection
Data tampering
Replay attacks
Countermeasures:
// Example: HMAC for message integrity#include <SHA256.h>byte message[]="temperature=22.5";byte secret[]="shared_secret_key";byte hmac[32];void verifyIntegrity(){ SHA256 sha256; sha256.resetHMAC(secret,sizeof(secret)); sha256.update(message,sizeof(message)); sha256.finalizeHMAC(secret,sizeof(secret), hmac,sizeof(hmac));// Compare received HMAC with calculated HMAC// If match → integrity verified}
5.7.3 Availability
Definition: Ensuring systems and data are accessible when needed.
IoT Examples:
Smart locks always respond to unlock commands
Medical devices remain operational
Industrial sensors provide continuous monitoring
Threats:
DDoS attacks (Mirai botnet)
Physical destruction
Power/battery depletion attacks
Countermeasures:
// Example: Rate limiting to prevent DoSunsignedlong lastRequest =0;constint MIN_REQUEST_INTERVAL =1000;// 1 secondvoid handleRequest(){if(millis()- lastRequest < MIN_REQUEST_INTERVAL){// Reject: Too many requestsreturn;} lastRequest = millis();// Process legitimate request}
Try It: CIA Triad Scenario Classifier
Describe an IoT security incident and classify which CIA property (Confidentiality, Integrity, or Availability) is primarily violated. Select a scenario or build your own to test your understanding.
Show code
viewof ciaScenario = Inputs.select( ["Smart thermostat data intercepted over unencrypted Wi-Fi","Attacker modifies insulin pump dosage commands in transit","DDoS attack takes smart grid monitoring system offline","Baby monitor video feed accessed by unauthorized user","Firmware update replaced with malicious version","Ransomware locks hospital IoT devices","GPS coordinates of delivery fleet spoofed to wrong locations","Smart meter readings altered to reduce electricity bill" ], {label:"Select an IoT security scenario:",value:"Smart thermostat data intercepted over unencrypted Wi-Fi" })viewof ciaGuess = Inputs.radio( ["Confidentiality","Integrity","Availability"], {label:"Which CIA property is PRIMARILY violated?",value:null })
Show code
{const scenarios = {"Smart thermostat data intercepted over unencrypted Wi-Fi": {answer:"Confidentiality",explanation:"The attacker can READ private data (temperature patterns, occupancy schedules) without authorization. The data is not modified (Integrity) and the system keeps working (Availability). Countermeasure: Encrypt Wi-Fi traffic with WPA3 and use TLS for cloud communication.",icon:"🔓" },"Attacker modifies insulin pump dosage commands in transit": {answer:"Integrity",explanation:"The attacker MODIFIES the dosage command, changing a legitimate value to a dangerous one. This is a life-threatening integrity violation. Countermeasure: Use HMAC or digital signatures to verify message integrity, plus mutual TLS authentication.",icon:"✏️" },"DDoS attack takes smart grid monitoring system offline": {answer:"Availability",explanation:"The system is UNAVAILABLE to legitimate operators. No data was stolen or modified -- the system simply cannot respond. Countermeasure: Rate limiting, traffic filtering, redundant monitoring paths, and DDoS mitigation services.",icon:"⛔" },"Baby monitor video feed accessed by unauthorized user": {answer:"Confidentiality",explanation:"Private video data is EXPOSED to an unauthorized viewer. This is a severe privacy breach through a confidentiality failure. Countermeasure: Strong authentication (no default passwords), encrypted video streams, and access control lists.",icon:"🔓" },"Firmware update replaced with malicious version": {answer:"Integrity",explanation:"The firmware has been TAMPERED with -- replaced with an unauthorized version. This integrity violation can lead to full device compromise. Countermeasure: Code signing with verified certificates, secure boot chain, and hash verification before applying updates.",icon:"✏️" },"Ransomware locks hospital IoT devices": {answer:"Availability",explanation:"Hospital devices become UNAVAILABLE for patient care. While ransomware may also breach confidentiality, the primary impact is denying access to critical medical equipment. Countermeasure: Network segmentation, regular backups, endpoint protection, and incident response plans.",icon:"⛔" },"GPS coordinates of delivery fleet spoofed to wrong locations": {answer:"Integrity",explanation:"Location data has been FALSIFIED -- the GPS coordinates no longer reflect the true position. This is an integrity violation through signal spoofing. Countermeasure: Multi-source position validation, GPS signal authentication, and anomaly detection for impossible movements.",icon:"✏️" },"Smart meter readings altered to reduce electricity bill": {answer:"Integrity",explanation:"Meter readings have been MODIFIED to show false consumption values. This is data tampering -- a classic integrity violation. Countermeasure: Tamper-evident meters, cryptographic signatures on readings, and server-side anomaly detection.",icon:"✏️" } };const scenario = scenarios[ciaScenario];if (ciaGuess ===null) {returnhtml`<div style="background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); border-radius: 8px; padding: 20px; border-left: 5px solid #3498DB; text-align: center;"> <div style="display: flex; justify-content: center; gap: 30px; margin: 15px 0;"> <div style="text-align: center; padding: 15px 25px; border-radius: 8px; background: #2C3E5015; border: 2px solid #2C3E50;"> <div style="font-size: 28px;">🔒</div> <div style="font-weight: bold; color: #2C3E50; margin-top: 5px;">Confidentiality</div> <div style="font-size: 12px; color: #7F8C8D;">Data exposed</div> </div> <div style="text-align: center; padding: 15px 25px; border-radius: 8px; background: #16A08515; border: 2px solid #16A085;"> <div style="font-size: 28px;">✏️</div> <div style="font-weight: bold; color: #16A085; margin-top: 5px;">Integrity</div> <div style="font-size: 12px; color: #7F8C8D;">Data modified</div> </div> <div style="text-align: center; padding: 15px 25px; border-radius: 8px; background: #E67E2215; border: 2px solid #E67E22;"> <div style="font-size: 28px;">⛔</div> <div style="font-weight: bold; color: #E67E22; margin-top: 5px;">Availability</div> <div style="font-size: 12px; color: #7F8C8D;">System offline</div> </div> </div> <p style="color: #7F8C8D; font-style: italic;">Select your answer above to check your classification.</p> </div>`; }const isCorrect = ciaGuess === scenario.answer;const ciaColors = {"Confidentiality":"#2C3E50","Integrity":"#16A085","Availability":"#E67E22"};returnhtml`<div style="background: ${isCorrect ?'#d4edda':'#f8d7da'}; border-radius: 8px; padding: 20px; border-left: 5px solid ${isCorrect ?'#16A085':'#E74C3C'};"> <div style="font-size: 20px; font-weight: bold; color: ${isCorrect ?'#16A085':'#E74C3C'}; margin-bottom: 10px;">${isCorrect ?'✅ Correct!':'❌ Not quite.'}${isCorrect ?'':` The primary violation is <strong style="color: ${ciaColors[scenario.answer]};">${scenario.answer}</strong>.`} </div> <div style="background: white; padding: 15px; border-radius: 6px; margin-top: 10px;"> <strong style="color: #2C3E50;">Explanation:</strong> ${scenario.explanation} </div> <div style="display: flex; justify-content: center; gap: 20px; margin-top: 15px;">${["Confidentiality","Integrity","Availability"].map(prop => {const isAnswer = prop === scenario.answer;return`<div style="text-align: center; padding: 10px 20px; border-radius: 8px; background: ${isAnswer ? ciaColors[prop] +'22':'#f8f9fa'}; border: 2px solid ${isAnswer ? ciaColors[prop] :'#dee2e6'};"> <div style="font-weight: bold; color: ${ciaColors[prop]};">${prop}</div> <div style="font-size: 12px; color: #7F8C8D;">${isAnswer ?'PRIMARY violation':'Not primary'}</div> </div>`; }).join("")} </div> </div>`;}
5.8 Videos
Understanding security concepts through real-world examples and emerging technologies provides crucial context for IoT security implementation.
Video: Cambridge Analytica and Data Privacy
Case study examining how data collection and analysis can compromise user privacy, with lessons applicable to IoT data practices and consent management.
Video: Blockchain for IoT Security
Explore how blockchain technology provides decentralized security and trust mechanisms for IoT networks, including device authentication and data integrity.
Core Cybersecurity Concepts for IoT
Cybersecurity Basics for IoT
From slides — foundational security concepts contextualized for IoT systems.
Threats, Privacy, and Risk
Threats, Privacy, and Risk in IoT
From slides — overview of privacy threats, risk trade-offs, and mitigations.
5.8.1 Extended Security Properties for IoT
Beyond CIA, IoT systems require:
Property
Description
IoT Example
Authentication
Verify identity of users/devices
Device certificates, 2FA
Authorization
Control what authenticated entities can do
Role-based access control
Non-repudiation
Prevent denial of actions
Digital signatures, audit logs
Accountability
Track who did what and when
Logging, blockchain ledgers
Privacy
Protect personal information
Data anonymization, consent
Try It: Security Properties Maturity Assessment
Evaluate your IoT system’s maturity across all security properties. Rate each property to get a visual maturity profile and prioritized recommendations for improvement.
// TLS/SSL for MQTT over Wi-Fi#include <WiFiClientSecure.h>#include <PubSubClient.h>WiFiClientSecure espClient;PubSubClient client(espClient);// Load CA certificateconstchar* ca_cert = \"-----BEGIN CERTIFICATE-----\n" \"MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9...\n" \"-----END CERTIFICATE-----\n";void setup(){ espClient.setCACert(ca_cert);// Verify server identity client.setServer("mqtt.example.com",8883);// Port 8883 = MQTT over TLS}
5.9.3 Layer 3: Cloud/Application Layer
Components: Cloud platforms, databases, web dashboards
Security Concerns:
Weak API authentication
SQL injection, XSS attacks
Insecure data storage
Inadequate access controls
Countermeasures:
# Secure API with JWT authenticationfrom flask import Flask, request, jsonifyimport jwtimport datetimeapp = Flask(__name__)SECRET_KEY ="your-secret-key"@app.route('/api/sensor-data', methods=['POST'])def receive_data():# Verify JWT token token = request.headers.get('Authorization')try: payload = jwt.decode(token, SECRET_KEY, algorithms=['HS256']) device_id = payload['device_id']# Validate and store data data = request.json# ... sanitize inputs, prevent injection ...return jsonify({"status": "success"}), 200except jwt.InvalidTokenError:return jsonify({"error": "Invalid token"}), 401
Try It: Security Layer Attack Simulator
Simulate attacks against each IoT architecture layer and observe how security controls respond. Adjust the attacker skill level and see which controls hold and which may fail.
<strong>Interpretation:</strong>
<ul style="margin: 10px 0 0 0; padding-left: 20px;">
<li><strong>CRITICAL (8.0-10.0):</strong> Immediate action required. High business impact, easily exploitable.</li>
<li><strong>HIGH (6.0-7.9):</strong> Prioritize mitigation. Significant risk to operations or data.</li>
<li><strong>MEDIUM (4.0-5.9):</strong> Plan mitigation. Moderate risk, should be addressed in roadmap.</li>
<li><strong>LOW (0-3.9):</strong> Monitor and review. Low immediate risk, periodic reassessment needed.</li>
</ul>
5.12 Worked Example: Attack Surface Assessment of a Connected Vehicle Fleet
Scenario: An automotive OEM manages 15,000 connected vehicles with these IoT components per vehicle: telematics control unit (TCU), OBD-II diagnostic port, infotainment system with Wi-Fi/Bluetooth, cellular modem (4G LTE), 6 CAN bus ECUs, GPS module, and a companion mobile app. Assess the attack surface and prioritize defenses.
Step 1: Attack Surface Enumeration
Attack Surface
Entry Points
Impact if Compromised
Accessibility
Cellular modem
Remote (internet-facing API)
Fleet-wide: OTA commands, location tracking
Remote, scalable
OBD-II port
Physical (diagnostic connector)
Single vehicle: CAN bus injection, ECU reprogramming
Step 3: Defense Prioritization by Cost-Effectiveness
Defense
Addresses
Cost/Vehicle
Risk Reduction
Priority
API gateway hardening + mTLS
Cellular (7.6)
$2.50 (certificate)
-3.0 DREAD
1st (highest ROI)
CAN bus gateway firewall
CAN injection (via any entry)
$8.00 (hardware)
-2.5 DREAD
2nd
OBD-II port authentication
Physical access (6.8)
$1.50 (secure connector)
-2.0 DREAD
3rd
Infotainment isolation
Wi-Fi/BT pivot (5.0)
$3.00 (dual-MCU design)
-1.5 DREAD
4th
GPS signal validation
Spoofing (4.2)
$0.50 (software)
-1.0 DREAD
5th
Step 4: Fleet-Wide Security Budget
15,000 vehicles x $15.50/vehicle = $232,500 total
API hardening: $37,500 (protects entire fleet from remote attack)
CAN firewall: $120,000 (prevents safety-critical compromise)
OBD-II auth: $22,500 (deters opportunistic physical attacks)
Infotainment isolation: $45,000 (limits lateral movement)
GPS validation: $7,500 (prevents navigation spoofing)
Compare to breach cost:
Jeep Cherokee recall (2015): $105 million for 1.4 million vehicles
Per-vehicle recall cost: $75/vehicle
Security investment: $15.50/vehicle = 5x cheaper than one recall
Result: A $232,500 investment ($15.50/vehicle) across five defense layers reduces the fleet’s aggregate DREAD score from 30.6 to 20.6, with the cellular API hardening providing the highest ROI by protecting all 15,000 vehicles from remote attacks for just $2.50 each.
Key lesson: Attack surface assessment must weight both impact and scalability. The OBD-II port has a higher per-vehicle DREAD score than the companion app, but the companion app affects all 15,000 users remotely while OBD-II requires physical presence at each vehicle. Prioritize defenses against remote, fleet-wide attack surfaces first.
Putting Numbers to It: Attack Surface Quantification and Risk Scoring
Annualized Loss Expectancy for attack surface risk
\[\text{ALE} = \text{SLE} \times \text{ARO}\]
Where SLE = Single Loss Expectancy, ARO = Annual Rate of Occurrence
Working through an example:
Given: Connected vehicle fleet with 7 attack surfaces from case study
Step 1: Calculate risk for cellular modem attack DREAD Score = 7.6 (from case study) \(\text{SLE} = \$2,000,000\) (fleet-wide OTA compromise impact) \(\text{ARO} = 0.10\) (10% probability per year, remote exploit) \(\text{ALE}_{\text{cellular}} = 2,000,000 \times 0.10 = \$200,000\text{ per year}\)
Result: Cellular API hardening has 2.5-month payback, while OBD-II auth ($22,500 cost) would take 22.5 years to break even. Prioritize defenses by ALE reduction per dollar, not DREAD score alone.
In practice: Security budgets are finite. Quantifying risk with ALE enables rational prioritization. High DREAD scores don’t justify spending if ARO is low (physical attacks). Focus on remote, scalable attack vectors with high ARO first.
Match the Security Architecture Concept to Its Description
Order the Security Maturity Progression
5.13 Concept Relationships
How Security Architecture Concepts Connect
Architectural Layer
Security Controls
Attack Surface
Defense Strategy
Device/Perception
Secure boot, tamper detection
Physical access, JTAG
Hardware root of trust
Network/Communication
TLS/DTLS, network segmentation
Eavesdropping, MITM
Encryption + isolation
Cloud/Application
Authentication, input validation
API vulnerabilities
Defense-in-depth
Attack Surface
Minimization, principle of least privilege
All exposed interfaces
Disable unnecessary services
Maturity Progression
Initial → Basic → Managed → Optimized
Varies by maturity level
Continuous improvement
Layered Defense Principle: Attackers must breach multiple independent layers. Compromising one layer (e.g., network encryption) does not compromise others (e.g., application authentication, device secure boot).
1. Designing security architecture without a threat model
A security architecture not grounded in a specific threat model makes arbitrary control choices that may protect against low-risk threats while missing high-risk ones. Always begin with threat modelling before designing controls.
2. Copying a reference architecture without validating against your threat model
Reference architectures are designed for typical scenarios. If your deployment has unusual physical accessibility, regulatory requirements, or attacker capabilities, validate that the reference architecture adequately addresses your specific threats.
3. Not documenting architectural security decisions and their rationale
Security architecture decisions made without documentation cannot be reviewed, reproduced, or handed off. Document each security control, why it was chosen, what threat it addresses, and what risk remains if it is bypassed.
4. Treating the architecture as static after initial deployment
IoT system architectures evolve over time as new devices are added, integrations are built, and threats change. Schedule periodic architecture reviews (annually at minimum) to ensure the architecture continues to match the current threat model.