IoT Security

Chapter 9
Edge, Cloud, API and Data Security

Diploma in IOT
IoT Security   •   Diploma

Edge, Cloud, API and Data Security

Introduction and Context

IoT security is no longer limited to protecting individual sensors. Modern IoT systems connect constrained devices to gateways, edge computers, cloud platforms, application programming interfaces (APIs), mobile applications, digital twins, analytics systems and enterprise databases. Each connection creates a possible route for unauthorised access, data manipulation, privacy loss or service disruption.

The security objective is therefore broader than confidentiality alone. A dependable IoT architecture must preserve:

  • Confidentiality: only authorised parties can view data.
  • Integrity: data and commands are not altered improperly.
  • Availability: services remain accessible when required.
  • Authenticity: communicating entities are who they claim to be.
  • Accountability: actions can be traced to identities and systems.
  • Privacy: personal and sensitive information is collected and used appropriately.

This chapter explains how to secure gateways and edge systems, cloud services, APIs, mobile applications, digital twins and data pipelines. It focuses on practical controls suitable for IoT engineers, administrators and application developers.

Learning Objectives

After studying this chapter, the learner should be able to:

  1. Explain the security roles of gateways, edge nodes and cloud platforms.
  2. Apply hardening principles to IoT gateways and edge-computing systems.
  3. Describe secure API authentication, authorisation and input validation.
  4. Identify security requirements for mobile IoT applications.
  5. Explain the security and privacy risks of digital twins.
  6. Protect IoT data throughout collection, transmission, processing, storage and disposal.
  7. Design a layered security architecture for an IoT deployment.
  8. Evaluate practical, ethical and governance issues in IoT data security.

1. The IoT Computing Continuum

IoT workloads are distributed across several locations. A sensor may collect data, a gateway may translate protocols, an edge server may analyse events locally, and a cloud service may store long-term records or train an analytical model.

Layered IoT security architecture DevicesSensors and actuators Gateway / EdgeFiltering, protocoltranslation, local control Cloud PlatformStorage, analytics,identity and services ApplicationsWeb, mobile,dashboards anddigital twins Security controls: identity, encryption, segmentation, validation, monitoring and recovery
Layered IoT security architecture from devices to cloud and applications
Figure: Layered IoT security architecture from devices to cloud and applications

Figure: Security controls must operate across the complete IoT computing continuum.

The boundary between edge and cloud is not fixed. An edge node may be a small industrial computer, a gateway may run containers, and a cloud platform may provide virtual machines, managed databases and serverless functions. Security responsibilities must therefore be assigned explicitly between the organisation, the device manufacturer, the cloud provider and application developers.

2. Gateway and Edge Security

2.1 Functions and risks

An IoT gateway commonly performs protocol conversion, device authentication, message buffering, local filtering and remote administration. Edge computing places processing close to the source of data. These capabilities reduce latency and bandwidth use, but they make gateways attractive targets. Compromise of a gateway can expose many downstream devices at once.

Typical threats include:

  • default or weak administrative passwords;
  • exposed management interfaces;
  • outdated operating systems and libraries;
  • insecure protocol conversion;
  • malicious or unauthorised firmware;
  • unprotected local storage;
  • physical tampering;
  • insecure containers or virtual machines;
  • lateral movement from the gateway to enterprise networks.

2.2 Gateway hardening

A hardened gateway should be configured according to the principle of least functionality: services, ports, accounts and packages that are not required should be removed or disabled. Administrative access should use strong authentication, preferably phishing-resistant multi-factor authentication for human operators and certificate-based identity for machines.

Important controls include:

  1. Secure boot: the platform verifies that boot components are approved before execution.
  2. Signed firmware and updates: updates are authenticated and integrity-checked before installation.
  3. Disk encryption: sensitive local data is protected if storage is removed.
  4. Network segmentation: device networks, management networks and enterprise networks are separated.
  5. Allow-listing: only approved processes, images and connections are permitted.
  6. Secure time: reliable time sources support certificate validation and event correlation.
  7. Central logging: authentication, configuration changes, update events and failures are recorded.
  8. Recovery procedures: a known-good image and protected configuration backup are available.

Security should not depend on secrecy of a device’s network location. A gateway must authenticate each important request even when the request originates inside the local network.

2.3 Edge-specific considerations

Edge systems may operate intermittently or in physically exposed locations. They should therefore enforce local policy when the cloud is unavailable. For example, a safety controller may continue to reject dangerous commands even during loss of connectivity. Local data retention should be limited, and cached data should be encrypted and deleted according to a defined schedule.

Containerised edge workloads require image signing, vulnerability scanning, restricted privileges, read-only file systems where feasible and separate service identities. A container is not a security boundary equivalent to a separate physical machine; a compromised host can affect all containers on it.

3. Cloud Platform Security

Cloud security follows a shared-responsibility model. The provider normally secures the physical infrastructure and core platform, while the customer remains responsible for identities, configurations, data, application code and many network rules. The precise division differs between infrastructure-as-a-service, platform-as-a-service and software-as-a-service offerings.

3.1 Identity and access management

Cloud accounts should use central identity management, role-based access control and least privilege. Human users should receive only the permissions needed for their duties. Workloads should use short-lived service identities rather than embedded access keys. Privileged operations should require stronger authentication and generate audit records.

A useful access decision considers the subject, action, resource, context and purpose. For example, an edge service may be permitted to publish telemetry for one site but not to read another site’s historical data.

3.2 Secure cloud configuration

Common configuration errors include publicly readable storage, unrestricted network rules, excessive permissions, unencrypted databases, disabled audit logging and credentials stored in source code. Secure configuration baselines should be automated and continuously checked. Infrastructure-as-code can make approved settings repeatable, but the code itself must be reviewed and protected.

Cloud data should be encrypted in transit and at rest. Key management requires defined ownership, rotation, access control, backup and recovery. Encryption does not replace authorisation: a user who legitimately receives a decryption key may still misuse the data.

3.3 Resilience and monitoring

IoT services should be designed for failure. Replicated storage, backup testing, rate limits, queue-based ingestion and disaster-recovery exercises reduce the effect of outages and attacks. Monitoring should identify unusual publishing rates, impossible locations, repeated authentication failures, abnormal API calls and unexpected administrative actions.

4. Secure APIs

An API is a controlled interface through which software requests data or actions. In IoT, APIs connect devices, gateways, cloud services, mobile applications, partner systems and digital twins.

4.1 API security principles

A secure API should:

  • authenticate the calling identity;
  • authorise every sensitive operation;
  • validate type, length, range and format of input;
  • reject unexpected fields where appropriate;
  • protect against injection and deserialisation attacks;
  • limit request rates and payload sizes;
  • use secure transport such as TLS;
  • avoid exposing secrets, internal identifiers or unnecessary personal data;
  • return safe error messages;
  • record security-relevant events.

Authentication proves who is calling; authorisation determines what that caller may do. Confusing these functions is a common design error. A valid token must not automatically grant access to every device or tenant.

4.2 Tokens, certificates and sessions

OAuth 2.0-based systems commonly use access tokens for delegated access, while OpenID Connect adds an identity layer for users. Tokens should have limited scope, audience, lifetime and issuer. Refresh tokens require stronger protection because they can create new access tokens. For device-to-device communication, mutual TLS or signed messages may be more appropriate than user-oriented tokens.

API gateways can enforce authentication, schema validation, rate limits, routing, logging and threat detection. They are useful controls but must not become a single point of failure or a substitute for secure backend authorisation.

4.3 API versioning and lifecycle

Old API versions often remain active because IoT devices have long lifetimes. Each version must have an owner, support period and retirement plan. Deprecation notices, migration tools and device update mechanisms are essential. Sensitive commands should use explicit confirmation, anti-replay protections and, where appropriate, physical or operational interlocks.

5. Mobile Application Security

Mobile applications are often remote controls for IoT systems. A stolen phone, reverse-engineered application or compromised account can therefore affect physical equipment.

Security controls include secure device enrolment, strong user authentication, biometric or multi-factor protection, certificate validation, protected local storage and minimal permissions. Access tokens should not be stored in ordinary text files or logs. Debug interfaces, test credentials and verbose production logging must be disabled.

The mobile application must be treated as an untrusted client. Any control enforced only in the application can be bypassed by a modified application or a direct API call. Authorisation must be enforced on the server or device-side service as well.

Privacy-aware design is also important. An application should collect only data necessary for its stated function, explain permissions clearly and provide mechanisms for account deletion or data access where required by applicable law.

6. Digital Twin Security

A digital twin is a software representation of a physical asset, process or environment. It may contain current state, historical telemetry, maintenance information, configuration and simulation results. A twin can improve monitoring and predictive maintenance, but it can also reveal operational secrets or provide a route to physical control.

Security requirements include:

  • authenticated links between the twin and the real asset;
  • integrity protection for state changes;
  • separation of read-only observation from control authority;
  • time-stamped and traceable updates;
  • protection against replayed telemetry;
  • tenant isolation;
  • validation of commands against safety constraints;
  • clear ownership of twin data.

The twin should not automatically be considered authoritative. Sensor errors, delayed messages or malicious updates can make the virtual state inaccurate. High-risk commands should require independent verification and fail-safe behaviour.

7. Data Pipeline Security

IoT data passes through a lifecycle:

  1. collection;
  2. transmission;
  3. ingestion;
  4. processing and transformation;
  5. storage;
  6. sharing and analysis;
  7. archival or deletion.

Controls must cover every stage. Encryption only during transmission leaves collection devices, queues, databases and analysts’ workstations exposed.

7.1 Data classification and minimisation

Data should be classified according to sensitivity, such as public, internal, confidential or highly restricted. Personal data, location data, industrial recipes and safety records may require stricter controls. Collecting less data reduces both privacy risk and the consequences of a breach.

Data retention should have a business and legal justification. A retention schedule should specify the data owner, storage location, retention period, archive method and deletion method. Backups and replicas must be included in deletion planning.

7.2 Integrity and provenance

Pipeline integrity requires reliable source identity, timestamps, sequence information and validation rules. A receiving service should detect duplicated, delayed, malformed or out-of-range messages. Hashes and digital signatures can help detect alteration, but a hash alone does not prove who produced the data.

For analytical systems, provenance records should identify the source, transformations, software version and time associated with a dataset. This supports troubleshooting, audits and trustworthy AI.

7.3 Privacy and analytics

Data aggregation, pseudonymisation and access-controlled views can reduce exposure. Pseudonymisation is not the same as anonymisation: additional information may allow re-identification. Where appropriate, privacy-enhancing techniques such as aggregation, differential privacy or federated learning may be considered, but each introduces accuracy, complexity or governance trade-offs.

8. Applied Case: Illustrative Cold-Chain Monitoring System

Background

A food distributor uses temperature sensors in refrigerated vehicles. Gateways transmit measurements to a cloud platform, while managers use a mobile application. A digital twin represents each vehicle and shipment.

Problem

The original design uses shared gateway passwords, a cloud storage bucket exposed to the internet and an API that allows a logged-in user to request any vehicle’s data by changing an identifier in the URL. Temperature records are also retained indefinitely.

Analysis

The shared password prevents reliable accountability and allows compromise of one gateway to affect the fleet. Public storage creates a direct data-exposure risk. The API has an object-level authorisation failure: authentication is present, but the server does not verify whether the user is authorised to access the selected vehicle. Long retention increases privacy and operational risk.

Approach and solution

The organisation assigns each gateway a unique device identity and uses certificate-based authentication. Secure boot and signed firmware are enabled, unused services are removed, and gateways are placed on segmented networks. Cloud storage is made private, with access granted through short-lived service permissions. The API checks tenant and vehicle ownership on every request, validates identifiers, applies rate limits and logs access.

Temperature messages include device identity, sequence number and timestamp. The ingestion service rejects malformed or replayed messages. Data is encrypted in transit and at rest. A retention schedule keeps detailed location data only as long as operationally necessary, while aggregated compliance records are retained longer. The mobile application receives only the vehicles assigned to the user’s role.

Outcome

The revised design improves accountability, limits unauthorised data access and reduces the effect of gateway compromise. It also supports investigation because logs connect actions to identities and timestamps. The organisation recognises that security is continuous: certificates, firmware, cloud permissions, API versions and retention rules require regular review.

Learning points

  1. Authentication without object-level authorisation is insufficient.
  2. Cloud configuration errors can expose large datasets quickly.
  3. Device identity should be unique and manageable throughout the lifecycle.
  4. Data minimisation and retention control are security measures as well as privacy measures.
  5. Digital twins and mobile applications must be protected as parts of the physical-control system.

9. Governance, Ethics and Professional Practice

IoT security decisions may affect safety, employment, privacy and public trust. Organisations should define data ownership, acceptable use, incident-reporting duties and third-party responsibilities. Legal obligations vary by jurisdiction, but common governance themes include lawful processing, transparency, purpose limitation, security safeguards and rights of data subjects.

Professionals should avoid collecting data merely because storage is inexpensive. They should assess whether monitoring is proportionate, whether workers or residents are adequately informed and whether automated decisions can be challenged. Security testing must be authorised and carefully controlled, especially where systems operate machinery or critical services.

Security documentation should include asset inventories, data-flow diagrams, threat models, configuration baselines, incident procedures, recovery plans and evidence of testing. Standards and guidance from recognised bodies can support these activities, but compliance alone does not guarantee security.

10. Challenges and Limitations

Several practical difficulties remain:

  • legacy devices may not support modern cryptography;
  • intermittent connectivity complicates certificate validation and updates;
  • constrained devices have limited processing power and memory;
  • cloud services can create dependency and portability concerns;
  • long device lifecycles outlast vendor support;
  • security controls may conflict with latency, cost or usability;
  • operational technology cannot always be patched immediately;
  • privacy techniques can reduce analytical precision.

Risk-based prioritisation is therefore necessary. Safety-critical commands, identity systems, exposed APIs and central gateways usually deserve stronger controls than low-impact telemetry. Compensating controls, such as network isolation and monitoring, may be required when replacement or patching is impossible.

11. Best-Practice Checklist

A practical review should confirm that:

  • every device, gateway, service and user has a managed identity;
  • default credentials and unnecessary services are removed;
  • firmware, operating systems, libraries and containers are updated;
  • secure boot and signed updates are used where supported;
  • networks are segmented and management access is restricted;
  • data is encrypted in transit and at rest;
  • APIs enforce authentication, authorisation and input validation;
  • mobile clients are treated as untrusted;
  • cloud permissions and storage exposure are continuously assessed;
  • digital-twin commands are validated and traceable;
  • logs are protected, monitored and retained appropriately;
  • backups and recovery procedures are tested;
  • data collection, retention and deletion are documented;
  • incidents are rehearsed with technical and operational teams.

Chapter Summary

IoT security must protect a distributed computing continuum comprising devices, gateways, edge systems, cloud platforms, APIs, applications, digital twins and data pipelines. Gateways require hardening, unique identities, secure updates, segmentation and recovery capability. Cloud security depends on correctly applying the shared-responsibility model, strong identity management, protected data and continuous configuration monitoring.

APIs must separate authentication from authorisation, validate inputs and enforce permissions for every resource and operation. Mobile applications are untrusted clients and cannot be the sole enforcement point. Digital twins require integrity, provenance, tenant isolation and safeguards against unsafe commands. Data security must cover the complete lifecycle, including collection, transformation, storage, sharing, retention and deletion.

Effective protection is layered and risk-based. Technical safeguards must be supported by governance, privacy-aware design, monitoring, incident response and tested recovery.

Key Terms

API: A defined interface through which software systems exchange data or request actions.

Authentication: Verification of an entity’s claimed identity.

Authorisation: Determination of which actions or resources an authenticated entity may use.

Cloud computing: On-demand access to shared computing, storage and software services.

Digital twin: A software representation of a physical asset, process or environment.

Edge computing: Processing data near its source rather than exclusively in a distant cloud.

Gateway: A system that connects local IoT devices to other networks or services.

Least privilege: Giving an identity only the access required for its authorised tasks.

Mutual TLS: A TLS arrangement in which both communicating parties authenticate with certificates.

Network segmentation: Dividing a network into controlled zones to limit movement and exposure.

Nonce: A value used once to help prevent replay of a message or transaction.

Object-level authorisation: Checking whether a caller may access the particular resource requested.

Pseudonymisation: Replacing direct identifiers while retaining a controlled possibility of re-linking.

Secure boot: A process that permits execution only of approved boot software.

Shared responsibility: Division of security duties between a cloud provider and its customer.

Telemetry: Measurements or status information sent from devices or systems.

Token: A digitally represented credential used to grant or convey access.

Zero trust: A security approach that continuously verifies access rather than trusting network location.

Review Questions

Short Answer Questions

  1. What is the difference between authentication and authorisation?
  2. Why is network segmentation important for an IoT gateway?
  3. State two security requirements for a digital twin.
  4. Why should a mobile application be treated as an untrusted client?
  5. What is meant by data minimisation?

Long Answer Questions

  1. Explain a comprehensive hardening strategy for an IoT gateway and edge computer.
  2. Describe the main responsibilities of an IoT customer under the cloud shared-responsibility model.
  3. Discuss how API gateways, tokens, input validation and object-level authorisation work together.
  4. Explain security controls across the IoT data lifecycle.
  5. Analyse the security and privacy risks associated with digital twins and propose controls.

Analytical / Application Questions

  1. A logged-in operator can change a vehicle identifier in an API request and view another customer’s telemetry. Identify the vulnerability and design a correction.
  2. An edge gateway cannot be patched for three months because it controls a continuous industrial process. Propose compensating controls and explain their limitations.
  3. Design a layered security architecture for a smart-building system containing sensors, gateways, a cloud platform, a mobile application and a digital twin.

Multiple Choice Questions with Answers

Question 1

Which control most directly prevents an unauthorised person from booting modified gateway software?

A. Secure boot

B. Rate limiting

C. Data minimisation

D. API versioning

Correct Answer: A. Secure boot

Question 2

A user has successfully logged in but requests another tenant’s device record by changing an identifier. Which control has failed?

A. Encryption at rest

B. Object-level authorisation

C. Secure time synchronisation

D. Firmware signing

Correct Answer: B. Object-level authorisation

Question 3

Why should a mobile IoT application be treated as an untrusted client?

A. Mobile networks never provide encryption

B. The application can be modified or bypassed by a caller

C. Mobile devices cannot store any credentials

D. Cloud services cannot authenticate mobile users

Correct Answer: B. The application can be modified or bypassed by a caller

Question 4

Which practice best supports least privilege for a cloud workload?

A. Using one administrator account for all services

B. Embedding a permanent access key in source code

C. Assigning a narrowly scoped, short-lived service identity

D. Allowing all services to read every database

Correct Answer: C. Assigning a narrowly scoped, short-lived service identity

Question 5

Which property ensures that IoT data has not been improperly altered?

A. Integrity

B. Availability

C. Portability

D. Compression

Correct Answer: A. Integrity

Question 6

Which measure is most appropriate for reducing replayed telemetry?

A. Adding sequence numbers or nonces and validating them

B. Increasing the display resolution of dashboards

C. Removing timestamps from messages

D. Making all data publicly readable

Correct Answer: A. Adding sequence numbers or nonces and validating them

Question 7

What is a principal risk of an exposed cloud storage bucket containing IoT records?

A. Improved device battery life

B. Unauthorised disclosure of stored data

C. Automatic firmware verification

D. Reduced API latency

Correct Answer: B. Unauthorised disclosure of stored data

Question 8

Which statement about pseudonymisation is correct?

A. It always makes data permanently anonymous

B. It replaces identifiers but re-identification may remain possible

C. It eliminates the need for access control

D. It protects data only while it is in transit

Correct Answer: B. It replaces identifiers but re-identification may remain possible

Question 9

Why are signed firmware updates important?

A. They prove that an update is approved and has not been altered

B. They guarantee that the device will never fail

C. They remove the need for network segmentation

D. They make all device data public

Correct Answer: A. They prove that an update is approved and has not been altered

Question 10

Which principle requires security controls to be applied from collection through deletion?

A. Data lifecycle security

B. Single sign-on

C. Protocol translation

D. Container scheduling

Correct Answer: A. Data lifecycle security

IoT Security
Chapter 9 of 15