<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>B. W. Kilgour, K. R. Munkittrick, C. B. Portt, T. J. Arciszewski, G. C. Sbeglia, An adaptive environ-
mental efects monitoring framework for assessing the influences of liquid efluents on benthos,
water, and sediments in aquatic receiving environments, Integrated Environmental Assessment
and Management</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <article-id pub-id-type="doi">10.47363/JAICC/2024(3)310</article-id>
      <title-group>
        <article-title>Components of ensuring secure infrastructure for environmental monitoring systems using the LwM2M protocol</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Kyrylo Vadurin</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andrii Perekrest</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Dmytro Mamchur</string-name>
          <email>dgmamchur@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Serhii Vladov</string-name>
          <email>serhii.vladov@univd.edu.ua</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Engineering and Electronics, Kremenchuk Mykhailo Ostrohradskyi National University</institution>
          ,
          <addr-line>Universytetska Str., 20, Kremenchuk, 39600</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Kharkiv National University of Internal Afairs</institution>
          ,
          <addr-line>L. Landau Avenue, 27, Kharkiv, 61080</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2023</year>
      </pub-date>
      <volume>14</volume>
      <issue>2018</issue>
      <fpage>552</fpage>
      <lpage>566</lpage>
      <abstract>
        <p>This research focuses on the security processes within the infrastructure of environmental monitoring systems employing the LwM2M protocol. The main objective is to develop a set of technical solutions aimed at securing the infrastructure of LwM2M-based environmental monitoring systems. This includes risk assessment methods, anomaly detection models, and adaptive access control algorithms. The developed solutions are designed to enhance data protection and ensure reliable system operation under resource constraints and dynamic threat conditions. The work involves the analysis of existing scientific, practical, and design solutions, as well as relevant hardware and software in the field of environmental monitoring system security using the LwM2M protocol. A concept, method, models, and algorithms are developed to achieve the research objective. The technical aspects of implementing the proposed concept are considered, including the synthesis of a list of potential user interaction capabilities, the development of a solution class diagram.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;LwM2M protocol</kwd>
        <kwd>Internet of Things (IoT)</kwd>
        <kwd>environmental monitoring systems</kwd>
        <kwd>information security</kwd>
        <kwd>cybersecurity</kwd>
        <kwd>risk assessment</kwd>
        <kwd>anomaly detection</kwd>
        <kwd>access control</kwd>
        <kwd>secure bootstrapping</kwd>
        <kwd>network trafic analysis</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Currently, there is a discernible trend towards the active implementation of Internet of Things (IoT)
technologies across various domains, including environmental monitoring. This facilitates real-time
data acquisition, enhances the celerity of responses to environmental threats, and refines natural
resource management processes. The LwM2M protocol, designed for resource-constrained devices, is
becoming increasingly prevalent for constructing such systems. However, the extensive utilization of
IoT devices also introduces new challenges in the realm of information security.</p>
      <p>The pertinence of the planned research stems from the necessity to ensure robust protection of data
collected by environmental monitoring systems against unauthorized access, modification, or loss.
Compromise of such data can lead to an erroneous assessment of the ecological situation, the adoption
of inefective managerial decisions, and, consequently, to detrimental impacts on the environment and
public health. Considering the distributed nature of IoT systems and the limited resources of devices,
traditional information protection methods may prove insuficiently efective.</p>
      <p>Based on an analysis of works by other authors, it has been established that existing solutions
often concentrate on discrete aspects of security, such as communication channel protection or device
authentication. Nevertheless, to ensure comprehensive protection, it is imperative to consider all stages
of the data lifecycle, from collection to storage and analysis, as well as to ensure the adaptability of the
security system to evolving conditions and threats. Dificulties exist in integrating LwM2M with extant
systems that utilize other protocols, and also in managing security within large-scale and heterogeneous
IoT networks. Insuficient attention has been devoted to issues of information security risk assessment
and the development of efective mitigation strategies, considering economic aspects.</p>
      <p>The object of this work encompasses the processes of ensuring the security of the infrastructure
for environmental monitoring systems that employ the LwM2M protocol. The subject of this work
comprises the methods, models, and algorithms that allow for an enhancement of the data protection
level and ensure the reliable functioning of environmental monitoring systems based on the LwM2M
protocol. The aim of this work is to develop a comprehensive suite of technical solutions for ensuring
a secure infrastructure for environmental monitoring systems based on the LwM2M protocol. This
suite includes risk assessment methodologies, anomaly detection models, and adaptive access control
algorithms, and is designed to elevate the level of data security and ensure the reliable operation of the
system under conditions of limited resources and dynamic threats.</p>
      <p>The principal unresolved tasks at present are:
• Development of a mathematical model for information security risk assessment for LwM2M-based
environmental monitoring systems, enabling quantitative evaluation of potential threats and
justification for the selection of efective protective measures.
• Development of a mathematical model for anomaly detection in environmental monitoring data
using statistical methods and machine learning techniques, allowing for the identification of
atypical parameter values that may indicate cyberattacks or device malfunctions.
• Development of an algorithm for dynamic access control to LwM2M device resources based
on Attribute-Based Access Control (ABAC), facilitating flexible management of access rights
depending on user roles, system state, and other contextual factors.
• Development of an algorithm for secure bootstrapping of LwM2M devices, ensuring the
protected provisioning of credentials and configuration parameters on the device using mutual
authentication and encryption.
• Development of an algorithm for detecting anomalies in LwM2M trafic, which analyzes network
interaction characteristics (packet size, request frequency, operation types) to identify atypical
behavior that may indicate cyberattacks or device malfunctions.
2. Analysis of the subject area and formulation of work tasks</p>
      <sec id="sec-1-1">
        <title>2.1. Analysis of existing scientific and practical solutions</title>
        <p>
          Ensuring a secure infrastructure for environmental monitoring systems (EMS), particularly those
utilizing the Lightweight M2M (LwM2M) protocol, is crucial for environmental and public health
due to their reliance on accurate and secure data [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]. Internet of Things (IoT) technologies enable
real-time data collection, analysis, and forecasting in this domain [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]. LwM2M, designed for
resourceconstrained IoT devices, standardizes device and service management, facilitating environmental data
collection (e.g., air quality, temperature) and remote device control through its client-server architecture
[
          <xref ref-type="bibr" rid="ref2 ref3">2, 3</xref>
          ]. Interoperability is ensured via OMA LwM2M Registry Objects and Resources [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]. Security is a
fundamental aspect of LwM2M and EMS, with the protocol ofering secure communication through
authentication methods (PSK, RPK, X.509 certificates), data encryption, and granular access control
[
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]. Secure bootstrapping provisions client credentials, and DTLS/TLS protocols are employed for
secure data transmission [
          <xref ref-type="bibr" rid="ref4 ref5">4, 5</xref>
          ]. Despite these built-in security features, LwM2M and IoT devices
remain susceptible to vulnerabilities, including dificulties in implementing and managing security at
scale, inherent protocol or implementation weaknesses, network limitations afecting reliability, and
risks from incorrect configuration or integration [
          <xref ref-type="bibr" rid="ref1 ref6">6, 1</xref>
          ]. To enhance the security of LwM2M-based IoT
infrastructure, best practices emphasize prioritizing security from the design phase, optimizing for low
energy consumption, ensuring interoperability, planning for scalability, and continuous management
through updates and monitoring [
          <xref ref-type="bibr" rid="ref4 ref6">6, 4</xref>
          ]. Utilizing reliable tools, platforms, and cloud services (e.g., Eclipse
Wakaama, Leshan, AWS, Azure, Google Cloud) further strengthens security, alongside hardware security
measures like HSMs and secure boot [
          <xref ref-type="bibr" rid="ref7 ref8 ref9">7, 8, 9, 10, 11</xref>
          ]. EMS also employ diverse technologies for data
collection (sensors, satellite), transmission (ZigBee, LoRaWAN), and processing (edge/cloud computing,
AI, blockchain) [10, 12, 13]. Despite these advancements, challenges persist in areas such as optimal
sensor placement, mathematical modeling, LwM2M integration with existing systems, managing large
heterogeneous IoT networks, and ensuring regulatory compliance [
          <xref ref-type="bibr" rid="ref4">4, 11, 12</xref>
          ].
        </p>
      </sec>
      <sec id="sec-1-2">
        <title>2.2. Analysis of design solutions and software-hardware</title>
        <p>
          Designing a secure infrastructure for EMS using the LwM2M protocol primarily adopts a client-server
model, where EMS devices act as LwM2M clients and servers manage and collect data [
          <xref ref-type="bibr" rid="ref6 ref9">6, 9</xref>
          ]. This
architecture standardizes interactions and simplifies device integration into a cohesive ecosystem [
          <xref ref-type="bibr" rid="ref6">6, 14</xref>
          ].
LwM2M ofers standardized device management functions, including registration, bootstrapping, and
data exchange [
          <xref ref-type="bibr" rid="ref4 ref6">4, 6</xref>
          ]. Its hierarchical data structure, utilizing Objects, Object Instances, and Resources,
clearly defines device functionality and sensor data, while LwM2M gateways facilitate centralized
management by integrating devices that do not natively support the protocol [
          <xref ref-type="bibr" rid="ref7 ref9">7, 9</xref>
          ].
        </p>
        <p>
          Security is a paramount design consideration, leveraging LwM2M’s inherent mechanisms such
as authentication (PSK, RPK, X.509), communication encryption, and access control [
          <xref ref-type="bibr" rid="ref1 ref6">1, 6</xref>
          ]. Secure
bootstrapping is essential for reliable device setup and credential distribution [
          <xref ref-type="bibr" rid="ref2 ref6">2, 6</xref>
          ]. The hardware
components for EMS often include wireless microcontrollers with built-in security features like
encryption acceleration, secure boot, and Trusted Execution Environments (TEE), exemplified by components
from Microchip and NXP, ensuring device-level data confidentiality [ 11]. Wireless communication
relies on standards like IEEE 802.15.4, Wi-Fi, and LPWAN technologies such as LoRaWAN [
          <xref ref-type="bibr" rid="ref4">4, 11</xref>
          ].
Software components encompass open-source LwM2M client (e.g., wakaama, Leshan) and server
implementations (e.g., Leshan, SkyCase IoT Platform), embedded TLS/DTLS libraries (e.g., wolfSSL) for
secure transport, and specialized tools for microcontroller software development and network security
monitoring [
          <xref ref-type="bibr" rid="ref4 ref5 ref7">4, 5, 11, 7</xref>
          ]. The LwM2M protocol brings several security advantages to EMS. Its design
prioritizes resource-constrained devices, enabling energy-eficient communication crucial for distributed
sensor networks [
          <xref ref-type="bibr" rid="ref6 ref9">6, 9</xref>
          ]. LwM2M also provides standardized device lifecycle management, including
remote firmware updates, status monitoring, and diagnostics, which are vital for maintaining security
throughout a device’s operational life [
          <xref ref-type="bibr" rid="ref6 ref9">6, 9</xref>
          ]. Its native security features—authentication, encryption, and
access control—efectively safeguard data against unauthorized access and interception [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. Furthermore,
LwM2M simplifies development by standardizing data formats and streamlining complex authentication,
allowing developers to concentrate on core system functionality while ensuring reliability and security
[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. This integration of LwM2M with appropriate hardware and software forms a robust foundation for
scalable, flexible, and secure EMS [15].
        </p>
      </sec>
      <sec id="sec-1-3">
        <title>2.3. Analysis of methods used in similar works</title>
        <p>
          Securing environmental EMS, particularly those leveraging the LwM2M protocol, is a complex endeavor
that integrates various technologies. Innovations such as IoT, sensor networks, artificial intelligence,
modeling, and Geographic Information Systems (GIS) are crucial for efective environmental
security monitoring and management [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]. The infrastructure of EMS typically features a multi-layered
architecture, encompassing a physical layer with intelligent sensors and communication interfaces, an
operating system abstraction layer, middleware, and an application layer [12]. Cloud storage, fortified
with security measures, is widely used for data reliability, while GIS aids in managing and
visualizing geographically referenced environmental data [11]. Hardware security mechanisms, including
embedded security modules and TrustZone technology, are also being explored to enhance trust and
protect critical operations within these monitoring systems [11]. The LwM2M protocol, designed for
resource-constrained devices, operates with an LwM2M client on the end device, an LwM2M Server
for management, and an LwM2M Bootstrap Server for authentication and configuration [
          <xref ref-type="bibr" rid="ref7 ref9">7, 9</xref>
          ]. It
standardizes data formats using concepts like objects, object instances, and resources, simplifying IoT
solution development [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. Originally based on CoAP over UDP with DTLS for security, later versions
of LwM2M expanded to support CoAP over TCP/TLS, MQTT, and HTTP, alongside updates for TLS
and DTLS 1.3 [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]. LwM2M implements security at both transport (DTLS for UDP or TLS for TCP)
and application (optional OSCORE) levels, which can collectively provide end-to-end security [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. It
supports various client-server authentication modes, including Pre-Shared Key (PSK) and certificate
mode, and incorporates key security mechanisms such as authentication, communication encryption,
access control, and secure bootstrapping to protect data [
          <xref ref-type="bibr" rid="ref6 ref9">6, 9</xref>
          ]. Mandatory LwM2M objects like Security
Object (/0), Server Object (/1), and Device Object (/3) manage credentials, secure communication, and
device information [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ].
        </p>
        <p>
          Despite its built-in security features, LwM2M implementation in environmental monitoring faces
challenges, including the complexity of managing security in large-scale deployments, network
limitations afecting communication reliability, inherent protocol vulnerabilities requiring updates, and
dificulties in integrating LwM2M with existing systems [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. To address these, best practices recommend
prioritizing security from a project’s inception, which involves secure bootstrapping with mutual
authentication and encryption, encrypting all device-server communication, and implementing detailed
access control policies [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. Additionally, optimizing for low energy consumption, carefully selecting
appropriate tools and platforms—including reliable LwM2M client/server software, development
frameworks, and cloud integration—is crucial [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. Thorough testing, including environment simulation and
security assessments, along with continuous management such as regular firmware updates, device
status monitoring, and security policy reviews, are essential to maintain robust security against evolving
threats [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ].
2.4. Consolidated review of the subject area and identification of research gaps
Ensuring a secure infrastructure for EMS, particularly those utilizing the LwM2M protocol, is critically
important due to their role in environmental and public health, relying heavily on data reliability and
security. IoT technologies facilitate real-time data collection, analysis, and forecasting in this domain.
The LwM2M protocol, designed for resource-constrained IoT devices, provides a standardized approach
to device and service management, which is highly beneficial for EMS. Its client-server architecture,
based on standardized Objects and Resources, ensures interoperability and simplifies device integration
into a unified ecosystem, even allowing for LwM2M gateways to incorporate devices that do not directly
support the protocol. Security is a paramount aspect of LwM2M and EMS. The LwM2M protocol
incorporates a suite of built-in security mechanisms, including various authentication methods (PSK,
RPK, X.509 certificates), communication encryption for data protection, detailed access control to
resources, and a secure bootstrapping process for reliable device setup and credential distribution.
Secure data transmission is achieved at the transport layer using DTLS and TLS protocols, and at the
application layer via OSCORE. However, despite these features, vulnerabilities and challenges exist,
such as the complexity of implementing and managing security in large-scale deployments, weaknesses
in the protocol or its implementation requiring regular updates, network limitations afecting reliability,
incorrect configuration, and dificulties in integrating LwM2M with existing systems that use other
protocols. To achieve the necessary security level for LwM2M-based IoT infrastructure, adherence to
best practices is crucial. This involves prioritizing security throughout the system lifecycle, including
secure device bootstrapping, mandatory encryption of all communications, implementing granular
access control policies, and optimizing device operation for energy eficiency. Thorough system testing
and continuous management, including regular updates and monitoring, are also essential. Furthermore,
leveraging reliable tools, platforms, cloud services, and hardware security measures like Hardware
Security Modules (HSMs) and secure boot technologies significantly enhances protection. While various
methods and technologies, such as sensors, AI, GIS, and blockchain, are employed in EMS, unresolved
challenges persist, including optimal spatial placement of monitoring stations, improving mathematical
modeling, and managing security in large, heterogeneous IoT networks, alongside ensuring compliance
with regulatory requirements.
3. Development of concept, method, models, and algorithms aimed at
achieving the work’s goal
        </p>
      </sec>
      <sec id="sec-1-4">
        <title>3.1. Formalization of the solution concept</title>
        <p>
          The concept for securing EMS, particularly those using the LwM2M protocol, is built upon a
comprehensive approach. This approach integrates the protocol’s built-in security mechanisms, cryptographic
protection methods, best practices for device and data security, and advanced analytical methods
for cyber threat detection and prevention. This comprehensive strategy is vital due to the critical
importance of reliable and secure environmental monitoring data for public health and environmental
preservation [
          <xref ref-type="bibr" rid="ref3 ref8">3, 10, 11, 8</xref>
          ]. The LwM2M protocol’s application ofers a standardized way to interact
with resource-constrained IoT devices, providing consistent management and data collection [15]. The
concept is defined by three fundamental principles. Firstly, security mechanisms must be integrated
at every level of the EMS, from sensor devices to the management server, to ensure end-to-end data
protection [
          <xref ref-type="bibr" rid="ref6 ref9">6, 9</xref>
          ]. This involves reinforcing LwM2M’s authentication, encryption, and access control
features throughout the system to address vulnerabilities across data processing and transmission stages
[
          <xref ref-type="bibr" rid="ref6 ref8 ref9">6, 9, 8</xref>
          ]. Secondly, the concept advocates for adaptive protection methods that dynamically adjust
security parameters based on current risk levels and available resources, optimizing energy consumption
and computational power while maintaining necessary protection in diverse IoT environments [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ].
Thirdly, the EMS must comply with regulatory requirements and industry standards for information
security, particularly given the critical nature of environmental data, necessitating careful
implementation of technical and organizational measures [16]. Structural elements crucial for implementing this
concept include secure sensor devices, a secure LwM2M server, and a robust security monitoring and
management system. Secure sensor devices should feature built-in hardware and software protection,
such as encryption modules and secure boot, alongside LwM2M client implementations that support
secure modes like DTLS/TLS and OSCORE [
          <xref ref-type="bibr" rid="ref6 ref9">11, 9, 6</xref>
          ]. The secure LwM2M server serves as a central
hub, ensuring reliable device authentication, encrypted communications, strict access control, and
secure data storage, while also managing device lifecycles including secure bootstrapping and firmware
updates [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. The security monitoring and management system provides intrusion detection, security
event analysis, and incident response capabilities, tracking component security status and responding to
anomalies [17, 18]. The concept’s key formulations can be formalized through mathematical models and
algorithms. A mathematical model for information security risk assessment evaluates potential threats,
aiding in prioritizing security measures and allocating resources efectively [
          <xref ref-type="bibr" rid="ref6">11, 6</xref>
          ]. While not directly a
security model, a mathematical model for optimizing sensor placement considers constraints like energy
consumption and network bandwidth, indirectly influencing system availability and resilience [
          <xref ref-type="bibr" rid="ref4 ref6">4, 6</xref>
          ].
Furthermore, a mathematical model for anomaly detection in environmental monitoring data, utilizing
statistical methods or machine learning, identifies atypical values that could indicate natural events or
cyberattacks like data spoofing [
          <xref ref-type="bibr" rid="ref3 ref9">3, 12, 11, 9</xref>
          ]. Practical algorithms supporting this concept include a
secure bootstrapping algorithm for reliable device connection and credential provisioning, a dynamic
access control algorithm for flexible management of LwM2M resource rights (e.g., using ABAC), and an
algorithm for detecting anomalies in LwM2M trafic to identify unusual network behavior indicative of
cyber threats [
          <xref ref-type="bibr" rid="ref3 ref6 ref9">6, 9, 11, 3, 12</xref>
          ].
        </p>
      </sec>
      <sec id="sec-1-5">
        <title>3.2. Planning the structural scheme of the solution</title>
        <p>The structural scheme for a secure EMS solution using the LwM2M protocol is built on a comprehensive
approach. This includes leveraging LwM2M’s built-in security, cryptographic protection, best practices
for device and data security, and integrating cyber threat detection and prevention methods. This
no,reconsider</p>
        <p>Secure
Infrastructure
Concept
(LwM2M)
Principles: End-to-End,
Adaptive,Compliance
UseLwM2M
built-insecurity?
Adaptiveprotectionneeded?
Regulatorycompliancerequired?
KeyStructural
Elements?
no
no
no
no
no
no,reconsider</p>
        <p>UseFormalModels?
ImplementSecurityAlgorithms?
yes
yes
yes
yes
yes
yes</p>
        <p>Auth,Encryption,
AccessControl
Dynamic
risk-based
parameters
Standards&amp;Legal
Requirements
SecureDevices,
LwM2MServer,
MonitoringSystem
Risk,Placement,</p>
        <p>Anomaly
DetectionModels</p>
        <p>
          Bootstrapping,
AccessControl,
TrafficAnalysis
approach is necessitated by the critical importance of reliable and secure environmental monitoring
data for public health and environmental preservation [
          <xref ref-type="bibr" rid="ref3">3, 10</xref>
          ]. The solution concept integrates security
mechanisms at every system level, employs adaptive protection methods, and ensures compliance
with relevant regulatory documents and industry standards. Based on the analysis, the core structural
elements include secure LwM2M-enabled sensor devices, a secure LwM2M server, and a dedicated
security monitoring and management system [
          <xref ref-type="bibr" rid="ref6 ref7">6, 7</xref>
          ].
        </p>
        <p>
          For sensor device implementation, the Espressif ESP32 WROOM 32E microcontroller was selected due
to its accessibility, communication capabilities (Wi-Fi, Bluetooth), and suficient resources for LwM2M
client and cryptographic operations [11]. Integrated environmental sensors include those for air
quality (MQ135), temperature/humidity (DHT22), and dust (PM2.5), chosen based on typical monitoring
tasks [
          <xref ref-type="bibr" rid="ref3">3, 10, 11</xref>
          ]. While initial implementation uses ESP32, the concept acknowledges the value of
microcontrollers with built-in hardware encryption accelerators and secure boot functions, such as
Microchip PIC32CM5164LS60064 or NXP LPC55S3x, for enhanced data confidentiality and integrity [ 11].
Device communication with the server utilizes Wi-Fi, with CoAP/LwM2M protocols secured via DTLS
for encrypted data transmission [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. At the software level for sensor devices, open-source LwM2M client
implementations like wakaama or Zephyr OS were chosen for their lightweight nature and suitability
for resource-constrained environments [
          <xref ref-type="bibr" rid="ref7 ref9">7, 9</xref>
          ]. The wolfSSL library was integrated to provide optimized
DTLS/TLS for secure transport layer communications in embedded systems [
          <xref ref-type="bibr" rid="ref1">1, 11</xref>
          ]. This software
facilitates data collection from sensors, formats it according to the LwM2M object model, and securely
transmits it to the LwM2M server using LwM2M security profiles (PSK, RPK, or certificates), aligning
with the concept’s emphasis on utilizing built-in protocol security mechanisms [
          <xref ref-type="bibr" rid="ref6 ref9">6, 9</xref>
          ]. For the LwM2M
server, the Eclipse Foundation’s open-source Leshan platform was selected, supporting all necessary
LwM2M operations and security mechanisms (DTLS with PSK, RPK, X.509) [
          <xref ref-type="bibr" rid="ref7 ref9">7, 9</xref>
          ]. Data collected by the
server is stored securely in either a relational (e.g., PostgreSQL) or document-oriented (e.g., MongoDB)
database [12]. The security monitoring and management system is implemented as a separate
Pythonbased module that interacts with the LwM2M server, analyzing security logs and detecting anomalies in
environmental data and network trafic [
          <xref ref-type="bibr" rid="ref3">3, 12</xref>
          ]. This module integrates mathematical models for anomaly
detection, based on statistical methods or machine learning, and algorithms for detecting anomalies in
LwM2M trafic to identify atypical behavior [
          <xref ref-type="bibr" rid="ref3">3, 12</xref>
          ]. Key algorithms like secure bootstrapping, which
ensures protected provisioning of credentials using mutual authentication and encryption, and dynamic
access control to LwM2M device resources, are implemented or supported on the server side [
          <xref ref-type="bibr" rid="ref6 ref9">6, 9</xref>
          ]. A
mathematical model for information security risk assessment guides the selection of security measures,
while a model for optimizing sensor placement informs system deployment to maximize coverage and
minimize costs [11].
3.3. Collection and formalization of mathematical models of the solution
3.3.1. Mathematical model for information security risk assessment in LwM2M
environmental monitoring systems
A mathematical model for assessing information security risks for LwM2M-based environmental
monitoring systems is designed for the quantitative or qualitative evaluation of potential losses from
the realization of information security threats and takes into account the cost of measures aimed at
mitigating these risks. The model is based on the classical approach to risk assessment, which defines
risk as a function of the probability of threat realization and the magnitude of potential impact. However,
for the purposes of this work, the model is expanded by detailing the impact components and including
the economic aspect – the cost of security measures.
        </p>
        <p>The mathematical model is described by a set of components and equations that allow for the
calculation of the risk level for the system or its individual components. The main components of
the model are: the probability of threat realization, the impact of threat realization on confidentiality,
integrity, and availability of data/system, and the cost of implementing and maintaining security
measures.</p>
        <p>The probability of threat realization () is determined for each identified threat  that is relevant to
the LwM2M-based environmental monitoring system. This indicator reflects the frequency or likelihood
that a specific threat will be successfully realized within a defined time period. The value of  can
be determined based on statistical data, expert assessments, or analysis of system vulnerabilities and
attacker activity. The probability takes values in the range from 0 to 1.</p>
        <p>The impact of threat realization is assessed across three main aspects of information security:
confidentiality (, ), integrity (, ), and availability (,). For each threat , the degree of impact on each of
these aspects is determined. Impact can be measured on quantitative (e.g., financial losses, downtime) or
qualitative (e.g., low, medium, high) scales. For use in the mathematical model, qualitative assessments
can be converted into numerical values, normalized to the range. For example, , , , , , represent
the normalized impact values of threat  on confidentiality, integrity, and availability, respectively.</p>
        <p>The aggregate impact of threat  () can be calculated as a weighted sum of impacts on confidentiality,
integrity, and availability. The equation used is:
 =  ·  , +  ·  , +  ·  ,
(1)
where  ,  ,  are weighting coeficients reflecting the relative importance of confidentiality,
integrity, and availability for the specific environmental monitoring system. The sum of weighting
coeficients usually equals 1 (  +  +  = 1). The values of the weighting coeficients are
determined during the system security requirements analysis phase.</p>
        <p>The risk associated with an individual threat  (Risk) is calculated as the product of the probability of
realization of this threat and its aggregate impact. The formula for calculating the risk of an individual
threat is:</p>
        <p>Risk =  ·   =  · (  ·  , +  ·  , +  ·  ,)</p>
        <p>The total risk for the system () can be determined as the sum of risks of all identified relevant
threats  ∈  , where  is the set of all considered threats. The equation for calculating the total system
risk is:
 = ∑︁ Risk = ∑︁  · (  ·  , +  ·  , +  ·  ,)
∈ ∈
(2)
(3)</p>
        <p>This indicator  represents an integral assessment of the system’s information security level before the
implementation of additional security measures (initial risk).</p>
        <p>The cost of implementing and maintaining security measures () is an important component
of the model, used to evaluate the efectiveness and economic feasibility of various risk mitigation
strategies. For each security measure , its cost is determined, which may include expenses for
purchasing equipment/software, installation, configuration, personnel training, as well as ongoing costs
for maintenance and support over a certain period. The cost  is measured in financial units.</p>
        <p>The implementation of a security measure  or a set of measures  (where  is a subset of the
set of all possible measures ) leads to a change in the probabilities of threat realization and/or their
impact. The probability of threat  realization after implementing measures  is denoted as (), and
the impact as (,), (,), (,). Typically, it is expected that () ≤   and (,) ≤  ,.</p>
        <p>The residual risk for the system after implementing a set of measures  (()) is calculated similarly
to the total risk, but using probability and impact indicators that account for the efect of these measures:
(4)
(5)
() = ∑︁ () · (  ·  (,) +  ·  ,</p>
        <p>() +  ·  (,))
∈</p>
        <p>The total cost of implementing and supporting a set of measures  (( )) is the sum of the costs
of individual measures in this set:
( ) = ∑︁</p>
        <p>∈</p>
        <p>The mathematical model allows for evaluating diferent security provision scenarios by comparing
the initial risk ((0)), residual risk (()) after implementing various sets of measures  , and the
corresponding cost ( ). The efectiveness of measures can be assessed by analyzing the risk reduction
(∆ () = (0) −  ()) relative to the costs ( ). This allows for determining the most economically
efective risk mitigation strategies for LwM2M-based environmental monitoring systems.
3.3.2. Mathematical model for optimal placement of environmental monitoring sensor
devices
Applying this model to LwM2M-based environmental monitoring systems requires specification of
threats characteristic of IoT devices and the LwM2M protocol (e.g., unauthorized access to sensor
data, data spoofing, DDoS attacks on the management server, device compromise), assessment of their
realization probabilities under system operation conditions, determination of the impact of these threats
on monitoring data and system functioning, and calculation of the cost of specific security measures (e.g.,
implementation of LwM2M authentication and authorization mechanisms, data encryption, network
segmentation, security monitoring).</p>
        <p>
          The formulation of the sensor placement optimization problem involves defining a set of potential
locations for installing devices within the territory subject to monitoring. Each potential location is
associated with certain characteristics, such as installation cost, availability of power sources, or specifics
of wireless signal propagation. The monitoring territory can be discretized into a set of target points
or areas for which coverage and data collection with the required accuracy must be ensured. Sensor
devices that can be used in the system include various types of sensors for measuring environmental
parameters, such as air quality, pollution levels, temperature, and humidity [10], as well as sensors for
monitoring the condition of equipment afecting the environment [
          <xref ref-type="bibr" rid="ref6">6, 11</xref>
          ].
        </p>
        <p>The mathematical model can be formulated as an integer linear programming problem or its extension.
Let  be the set of potential placement locations and  be the set of target monitoring points. Binary
decision variables  ∈ {0, 1} are defined for each potential location  ∈ , where  = 1 if a sensor
device is installed at location , and  = 0 otherwise.</p>
        <p>The objective function of the model is multi-objective, aimed at maximizing coverage and minimizing
costs. This can be realized by minimizing costs subject to achieving a required level of coverage, or
maximizing coverage within a given budget and technical constraints. Let us consider the option of
minimizing total deployment and operation costs. The costs associated with location  are denoted as
. The total costs are defined as ∑︀∈ .</p>
        <p>The model constraints include:
1. Constraints on territory coverage and measurement accuracy: Each sensor placed at location
 can provide coverage for a certain subset of target points  ⊆  . Coverage of point  ∈  is
considered ensured if at least one deployed sensor can cover it. A binary parameter  ∈ {0, 1}
is introduced, where  = 1 if a sensor at location  can cover point  with the required accuracy,
and  = 0 otherwise. Measurement accuracy depends on the sensor type, distance to the
monitoring object, and signal propagation conditions [11]. The constraint may require that each
target point  ∈  is covered: ∑︀∈   ≥ 1 for all  ∈  . Alternatively, achieving a certain
minimum percentage or area of covered territory may be required.
2. Constraints on energy consumption: Sensor devices operate on limited energy sources, especially
in remote or wireless deployments [12]. The energy consumption of a sensor at location  over
a certain period is denoted as . This consumption depends on the sensor’s operating mode,
frequency of measurements, and data transmission. The total energy consumption of all deployed
sensors must not exceed the total available energy budget of the system max: ∑︀∈  ≤  max.
3. Constraints on network bandwidth: Data collected by sensors are transmitted through a
communication network, which may have limited bandwidth [11]. In a system using the LwM2M
protocol, sensors can connect to gateways or base stations that aggregate data before transmitting
it to a central platform [12]. Let  be the set of gateways, and  be the average bandwidth
required for data transmission from a sensor at location . If sensor  connects to gateway ,
this can be represented by a binary variable  ∈ {0, 1}. Then, the total bandwidth arriving at
gateway  must not exceed its maximum capacity cap,: ∑︀∈  ≤  cap, for all  ∈ . It
must also be ensured that if a sensor is deployed, it connects to one gateway: ∑︀∈  =  for
all  ∈ .</p>
        <p>Thus, the mathematical model can be formulated as: Minimize ∑︀∈  Subject to:
∑︁   ≥ 1
∈
∑︁  ≤  max
∈</p>
        <p>∀ ∈ 
∑︁  ≤  cap, ∀ ∈ 
∈
∑︁  =  ∀ ∈ 
∈
 ∈ {0, 1}
 ∈ {0, 1}
∀ ∈ 
∀ ∈ ,  ∈ 
(6)
(7)
(8)
(9)
(10)
(11)</p>
        <p>
          This model allows for determining the optimal set of locations for placing sensor devices, considering
the given constraints and objectives. The result of solving the model is the determination of the set of
locations  for which  = 1. Such optimized placement forms the basis for further deployment of the
physical layer of the environmental monitoring system, where devices managed by the LwM2M protocol
will collect and transmit data, ensuring efective monitoring and analysis of the environmental state
[10, 11]. The application of LwM2M for managing these devices allows for remote configuration, status
monitoring, and data collection, which is important for operating a distributed sensor network [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. The
developed model contributes to creating a more eficient, reliable, and resource-saving infrastructure
for environmental monitoring.
3.3.3. Mathematical model for anomaly detection in environmental monitoring data
Efective functioning of environmental monitoring systems necessitates not only reliable data
transmission but also the ability to promptly detect atypical situations arising from natural events, man-made
incidents, or malicious actions like cyberattacks on sensor infrastructure. In the context of intelligent
monitoring systems, as highlighted by [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ], modern data analysis methods are crucial. To identify
atypical environmental parameter values, a mathematical model for anomaly detection in environmental
monitoring data is being developed, utilizing statistical methods, machine learning, or a combination
thereof. This model analyzes multidimensional time series data from various sensors (e.g., temperature,
humidity, air pollution) to automatically detect deviations from the "normal" data behavior, signaling
potential problems. The input data, X = (1,, 2,, . . . , ,), represents the measurements of 
diferent environmental parameters at time , collected from the physical layer of the monitoring system
[12]. The core idea is to define a "normal" behavioral profile based on historical data and identify
observations that significantly deviate from it.
        </p>
        <p>The mathematical model can employ statistical methods, machine learning, or a combination.
Statistical methods often assume specific data distributions. A simple approach involves analyzing each
parameter separately, where an anomaly is detected if the current value , deviates from the mean   by
more than a certain multiple of the standard deviation  , i.e., |, − | &gt;  · . More complex statistical
methods, such as multivariate analysis, can use the Mahalanobis distance  (X) to measure the
deviation of an observation vector X from the mean vector  of the "normal" data’s multivariate distribution,
√︁
considering their covariance matrix Σ. The formula is  (X) = (X − )  Σ−1 (X − ) . A high
 (X) value indicates a low probability within the "normal" distribution, signaling an anomaly.</p>
        <p>Machine learning methods ofer more flexible anomaly detection, particularly for complex or unknown
data distributions. Given the rarity of anomalies and potential lack of labeled data, unsupervised learning
methods are commonly applied. These include clustering, where anomalies appear as isolated points
or small clusters, and density estimation methods like Local Outlier Factor (LOF). Another efective
approach is using data reconstruction methods such as Autoencoders, trained on "normal" data to
compress and reconstruct representations. A significantly larger reconstruction error for anomalous
data indicates abnormality, with detection occurring if this error exceeds a threshold. If suficient
labeled anomaly examples are available, supervised learning methods, like classification algorithms (e.g.,
Support Vector Machines, neural networks), can be used to distinguish "normal" from "anomalous" states.
Combined approaches can leverage the strengths of both statistical and machine learning methods, for
instance, by using statistical indicators as features for machine learning models or confirming machine
learning detections with statistical tests.</p>
        <p>When developing anomaly detection models for environmental monitoring data, it is crucial to
consider the specifics of time series, including temporal dependencies, seasonality, and trends, ensuring
the model adapts or accounts for these changes. The correlation between diferent measured parameters
also highlights the importance of multivariate analysis. Additionally, the model must address data
quality issues such as missing values, noise, or sensor drift, which can mimic or mask anomalies. The
model’s output typically identifies time points or periods of anomalous parameter values, providing
a binary flag, an anomaly score, or indicating contributing parameters. This detection serves as a
signal for further analysis and interpretation, as atypical values could be caused by environmental
events, equipment malfunctions, or cyberattacks aimed at data falsification, often requiring additional
information and expert analysis to distinguish between these scenarios.</p>
      </sec>
      <sec id="sec-1-6">
        <title>3.4. Synthesis of methods and algorithms of the solution</title>
        <p>3.4.1. Algorithm for secure bootstrapping of an LwM2M device
For constructing secure infrastructures for environmental monitoring systems, where the collection
and transmission of sensitive data from numerous devices are critically important, ensuring security at
all stages of the device lifecycle assumes paramount significance. A fundamental stage is the LwM2M
device bootstrapping process, which establishes trust and configures parameters for a secure connection
with the management server. This process is designed to prevent unauthorized access and compromise
of configuration data, ensuring foundational security for sensitive environmental data. The LwM2M
device bootstrapping process provides devices with essential configuration information, enabling a
Establish secure DTLS channel with Bootstrap Server</p>
        <p>Start bootstrapping process
Mutual authentication using
configured security mode
(PSK, Certificate, RPK)
Authentication successful?</p>
        <p>Yes
Trans/m0i/tx/c0on(fSiegruvreartiUoRnI)d,ata:</p>
        <p>/0/x/1 (Credentials)
Terminate connection with Bootstrap Server</p>
        <p>Establish secure connection with LwM2M Server
Register device: send ID, credentials, object list</p>
        <p>Bootstrapping complete</p>
        <p>No</p>
        <p>
          Abort bootstrapping
secure connection to an LwM2M Server [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. Instead of connecting directly to the main LwM2M Server,
the device initially communicates with a specialized Bootstrap Server [12]. This dedicated server
provides initial configuration parameters and security credentials, typically including the address of the
subsequent LwM2M Server and the necessary security credentials for establishing a secure connection
with it [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ].
        </p>
        <p>
          To ensure security during this bootstrapping phase, methods of mutual authentication and encryption
are employed [
          <xref ref-type="bibr" rid="ref4 ref6">4, 6</xref>
          ]. Mutual authentication verifies the legitimacy of both the device and the Bootstrap
Server before any confidential information exchange. The LwM2M standard supports various security
modes, including Pre-Shared Key (PSK) mode, which uses a pre-distributed secret key for symmetric
encryption and authentication, and Certificate mode, which relies on asymmetric cryptography with
public keys and X.509 certificates for authentication and encryption [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. Support for Raw Public Key
and Public Key Infrastructure (PKI) deployment is also available [12]. The bootstrapping procedure
typically begins with the device establishing a secure communication channel, often using the DTLS
(Datagram Transport Layer Security) protocol, with its known Bootstrap Server [12]. DTLS ensures
data confidentiality and integrity at the transport layer, protecting transmitted configuration. Within
this secure channel, mutual authentication occurs using the chosen security mode. Upon successful
authentication, the Bootstrap Server transmits critical configuration parameters, such as the LwM2M
Server URI and associated security credentials [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. The LwM2M Server can later initiate new bootstrap
requests to update device credentials or server addresses, enabling dynamic security management
throughout the device’s lifecycle [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. After bootstrapping, the device disconnects from the Bootstrap
Server and uses the obtained credentials to establish a secure connection with the main LwM2M Server,
preceding its registration process [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ].
3.4.2. Algorithm for dynamic access control to LwM2M device resources
In research on securing environmental monitoring systems (EMS) using the LwM2M protocol, access
control mechanisms are paramount. While LwM2M ofers basic access control, its flexibility can be
limited for complex EMS scenarios where access rights may depend on context beyond simple user
or device identification, such as user role, system state, time, or data from other sensors [
          <xref ref-type="bibr" rid="ref6">6, 10</xref>
          ]. To
address this, a dynamic access control algorithm for LwM2M device resources has been developed,
founded on ABAC principles. This allows for defining access rights based on attributes of the subject,
object, action, and environment, ofering a higher degree of granularity and dynamism than traditional
models like Role-Based Access Control (RBAC). The algorithm’s functioning involves several key stages,
        </p>
        <p>Collect Attributes AUttpridbauttees
(Subject, Object, Action, Environment) and Policies</p>
        <p>(DAeBfAiCneRu&amp;leSstoRreepPoosiltiocireys) of AtDtyrniabmuitcesUp&amp;daPtoelicies
(GaAtchceerssAtRterqiubeusttesEv&amp;alEuvaatliuoante) aAnUdttprPidboaulittceeiess</p>
        <p>Decision Obtained</p>
        <p>Permit
Permit: Forward Request to Device</p>
        <p>Deny</p>
        <p>
          Deny: Reject Request &amp; Send Denial
starting with attribute collection. For an LwM2M EMS, subject attributes might include roles (e.g.,
"system administrator"), object attributes relate to the LwM2M resource (e.g., "temperature" type, sensor
location), and action attributes correspond to LwM2M operations like Read or Write [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ].
        </p>
        <p>
          Environment attributes encompass contextual factors such as time, device state (e.g., "normal
operation"), or data from other monitoring devices [10]. The second stage involves defining and storing
access policies as rules linking these attributes to permissions or denials. For instance, a policy might
permit "monitoring engineers" to "Read" "temperature" data during "normal operation" within "working
hours." These policies are centrally stored, typically on the LwM2M server or a dedicated security
management component. The third stage is access request evaluation. When a subject requests an
action on an LwM2M resource, the access control system intercepts it. It collects all relevant attributes
(subject, object, action, and environment) and passes them to a policy evaluation engine. This engine
analyzes defined access policies against the collected attributes to yield a "Permit" or "Deny" decision.
The fourth stage is decision enforcement: if "Permit," the requested action is executed on the LwM2M
device; if "Deny," the request is rejected, and the subject receives an access denial message. A crucial
aspect of this algorithm is its support for dynamism. Since environment attributes, device states, or user
roles can change, the algorithm includes mechanisms for updating attribute information. This allows
the access control system to react promptly to context changes; for example, if an EMS device enters
maintenance mode, the system can automatically restrict access to certain resources for all users except
maintenance personnel. Implementing this algorithm within an LwM2M EMS infrastructure requires
integrating attribute collection components, a policy store, a policy evaluation engine, and a policy
enforcement point, usually located on the LwM2M server, with communications between components
secured by LwM2M’s authentication and encryption mechanisms [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ].
3.4.3. Algorithm for anomaly detection in LwM2M trafic based on network interaction
characteristics
Ensuring security and operational reliability is paramount in rapidly developing IoT applications like
environmental monitoring systems, where sensitive data collection and transmission from numerous
devices are critical. The LwM2M protocol standardizes IoT device management, but LwM2M-based
systems remain vulnerable to cyberattacks and malfunctions that can distort data or cause system
failure [
          <xref ref-type="bibr" rid="ref6">6, 17</xref>
          ]. To efectively counter these threats, timely detection of atypical behavior is crucial.
This work focuses on an algorithm for detecting anomalies in LwM2M trafic, which analyzes network
interaction characteristics and employs machine learning methods. The LwM2M protocol, based on an
Object/Instance/Resource (O/I/R) model, facilitates device interaction via operations like Read, Write,
and Execute, primarily using UDP with a DTLS security layer [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. Anomaly detection in LwM2M trafic
involves collecting and processing data reflecting network interaction specifics, particularly packet size,
request frequency, and operation types. These parameters can be obtained through passive network
        </p>
        <p>Collect &amp; Preprocess Traffic Data
(Packet Size, Timestamp, Operation Type)</p>
        <p>Feature Engineering
(Windowing &amp; Statistical Metrics)</p>
        <p>Train ML Model
(Unsupervised/Semi-supervised)</p>
        <p>Perform Anomaly Detection</p>
        <p>
          Interpret &amp; Respond
(Alerts, Isolation, Diagnostics)
monitoring or by collecting metrics directly from the LwM2M server [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. Atypically large or small
packet sizes can signal anomalies like data exfiltration or malicious data formats. Deviations in request
frequency, such as a sharp increase (DoS attempt) or unexpected cessation (malfunction/compromise),
are strong indicators of anomalous behavior, as are changes in expected Observe notification frequencies
[17]. Additionally, atypical sequences or ratios of operation types (e.g., excessive Write operations on
usually read-only resources) can suggest unauthorized access attempts or manipulation, even with
LwM2M’s built-in access control [
          <xref ref-type="bibr" rid="ref6 ref8 ref9">6, 8, 9</xref>
          ].
        </p>
        <p>
          The algorithm utilizes machine learning to analyze these trafic characteristics, identifying deviations
from normal behavior through several stages. First, LwM2M network trafic data is collected and
preprocessed, extracting relevant characteristics like packet size, timestamps, and LwM2M operation
types [17]. Second, feature engineering aggregates raw trafic data over specific time windows,
calculating statistical indicators such as average packet size, total packets, and frequency/distribution of
each operation type to form a multidimensional feature vector [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. Third, a machine learning model
is trained, typically using unsupervised or semi-supervised learning methods (e.g., Isolation Forest,
One-Class SVM, Autoencoders) on normal trafic data to learn patterns and define boundaries between
typical and atypical behavior. Finally, direct anomaly detection occurs as new, real-time feature vectors
are fed into the trained model, which calculates an "anomaly score" or classifies the behavior as "normal"
or "anomalous." A high anomaly score or "anomalous" classification signals a potentially dangerous
situation or failure. Anomalous trafic patterns are then compared against known attack scenarios
(e.g., DDoS, scanning, unauthorized access) or failure types (e.g., sensor malfunction, software error).
Upon detection, appropriate response measures are initiated, which may include generating alerts,
automatically blocking/isolating compromised devices, enhancing monitoring, or initiating device
diagnostic procedures, leveraging LwM2M’s capabilities for monitoring and diagnostics [
          <xref ref-type="bibr" rid="ref6">6, 17</xref>
          ].
3.5. Synopsis of conceptual and methodological developments
It was established that the implementation of this concept requires a comprehensive approach,
encompassing security provision at every level of the system – from sensor devices to the server infrastructure.
This entails the use of adaptive protection methods that consider the limited resources of devices and
the dynamic nature of threats, as well as ensuring the system’s compliance with the requirements of
regulatory documents and industry standards in information security.
        </p>
        <p>To implement the formulated concept, key structural elements were identified, including secure sensor
devices with LwM2M support, a secure LwM2M server, and a security monitoring and management
system. A software-hardware configuration that can be used to build these elements was described,
including the selection of microcontrollers, sensors, LwM2M client and server implementations, as well
as the integration of libraries for cryptographic protection and the development of modules for security
analysis. Justification for the choice of specific technologies and components was provided, considering
security requirements and resource constraints of IoT devices.</p>
        <p>For the purpose of formalizing key security aspects and optimizing system functionality, a series of
mathematical models were developed. A mathematical model for information security risk assessment
was presented, enabling quantitative evaluation of potential threats considering their probability of
realization, impact on data confidentiality, integrity, and availability, as well as the cost of security
measures. This model serves as a tool for substantiating and prioritizing protection measures. A
mathematical model for optimizing sensor device placement was considered, which, although not
directly a security model, accounts for constraints on energy consumption and network bandwidth,
indirectly afecting system availability and resilience. A mathematical model for detecting anomalies
in environmental monitoring data was developed, utilizing statistical methods and machine learning
techniques to identify atypical parameter values that may indicate either environmental events or
cyberattacks.</p>
        <p>
          Based on the developed models and structural elements, algorithms ensuring the implementation
of key security functions were presented. An algorithm for secure bootstrapping of LwM2M devices
was described, guaranteeing protected provisioning of credentials and configuration parameters using
mutual authentication and encryption. An algorithm for dynamic access control to LwM2M device
resources was developed, based on ABAC principles, providing flexible and granular management
of access rights depending on context. An algorithm for detecting anomalies in LwM2M trafic was
presented, which analyzes network interaction characteristics (packet size, request frequency, operation
types) using machine learning methods to identify atypical behavior that may indicate cyberattacks or
malfunctions.
4. Technical aspects of implementing the concept proposed in the
work
4.1. Synthesis of a list of potential user interaction capabilities with the solution
The solution for a secure LwM2M-based environmental monitoring system provides users with
functional capabilities through its software components, primarily the LwM2M server and the security
monitoring and management system. This enables efective use of environmental data, device
management, and overall system security. Users can view current sensor readings in near real-time, leveraging
LwM2M’s Read and Observe operations [17]. Sensor devices, acting as LwM2M clients, collect
environmental parameters, represented as resources within LwM2M objects [11, 17]. The LwM2M server
establishes secure connections via DTLS/TLS and sends Read requests or initiates Observe sessions
to receive updates, with end-to-end communication encryption and access control ensuring
security [
          <xref ref-type="bibr" rid="ref6 ref9">6, 9, 17</xref>
          ]. Beyond current data, users can access historical monitoring data stored securely in a
database [12]. The security monitoring and management system provides access to this archival data,
allowing users to query information for specific periods, devices, or sensor types, enabling analysis of
environmental parameter dynamics and trend identification. The reliability of this historical data is
maintained through cryptographic protection and data integrity mechanisms applied during collection,
transmission, and storage [12]. Furthermore, the system allows for changing device configuration
parameters via LwM2M’s Write operations, including adjusting measurement periods, trigger thresholds,
operating modes, or firmware updates [
          <xref ref-type="bibr" rid="ref1 ref6">1, 6, 16, 17</xref>
          ]. All such operations are subject to rigorous access
control, potentially using a dynamic access control algorithm that considers user, device, and contextual
attributes, with DTLS/TLS encryption securing command transmission [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ].
        </p>
        <p>
          An important function is managing user access rights, crucial for protecting sensitive environmental
data and infrastructure from unauthorized interference. Users with administrative privileges can define
access permissions for other users or groups to specific system functions, device data, or configuration
changes. This is implemented using granular access control models like ABAC, with policies stored
and enforced on the LwM2M server and security management system [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. The security monitoring
and management system also enables users to view and analyze security event logs, which record
User
Interaction
View current
sensor
readings
histoVriiceawl data
Configure
device
settings
Manage user
access rights
        </p>
        <p>View
security logs
Generate
reports
Respond to
anomalies
LwM2M
Server
Secure
Database
Access
Control
System</p>
        <p>Security
Monitoring &amp;
Management</p>
        <p>Secure
Database
Analytics
Module</p>
        <p>Operations
Read/Observe
Store/Retrieve
Write/Execute
ABAC Policies
Log Analysis</p>
        <p>Report
Generation
DTLS/TLS
Access
Control
Crypto
Protection
Integrity
Checks
Incident
Notification
User
Response
Actions
device connection attempts, authentication results, operations performed, communication errors, and
events detected by the anomaly detection system [10, 11]. The integrated algorithm for detecting
anomalies in LwM2M trafic enhances this process by identifying atypical network behavior that
simple log review might miss [11]. Finally, the system provides capabilities for generating reports on
the monitoring system’s state, encompassing data statistics, device operability, detected anomalies,
and security incidents [10, 11]. This provides summarized information vital for managerial decisions
and regulatory compliance. Crucially, the system supports responding to detected anomalies and
security incidents, utilizing mathematical models for anomaly detection in data and trafic [11]. Upon
detecting an anomaly (e.g., failed authentication, atypical trafic, sharp sensor deviation), the system
can automatically notify the user [13]. Users can then initiate response actions through the interface,
such as remote device diagnostics, configuration changes, temporary device blocking, or launching
predefined cyber incident response procedures, including automatically adjusting measurement periods
when pollutant standards are exceeded [10, 13].</p>
      </sec>
      <sec id="sec-1-7">
        <title>4.2. Development of a class diagram for the solution</title>
        <p>The proposed solution for a secure LwM2M-based environmental monitoring system is built upon
a layered architecture of interconnected software classes, each dedicated to a specific functional or
security aspect. This design ensures comprehensive data protection and eficient device management.
A central component on the end-device side is the LwM2MClient class, which handles the LwM2M
client functionality directly on the sensor device. Its responsibilities include device registration,
collecting and transmitting environmental data according to the LwM2M object model, and executing
commands received from the LwM2M server, while also monitoring device resource status. Conversely,
the LwM2MServer class represents the central management and data collection node. It manages
connected devices, including their registration, bootstrapping, and de-registration processes. This class
is responsible for processing requests from LwM2M clients (e.g., read, write, execute, observe) and
securely storing collected environmental monitoring data. Crucially, the LwM2MServer class plays
a vital role in security by controlling client authentication and authorization, ensuring the secure
interaction between devices and the central platform. Overall system security management is handled
by the SecurityManager class, which coordinates and implements security mechanisms at a system-wide
level. Its functions include managing encryption keys, configuring authentication and authorization
policies, monitoring security events, and coordinating responses to cyberattacks. The SecurityManager
interacts with other system components, especially the LwM2MServer, to enforce defined security
policies. For complex access control, the AccessControlPolicyManager class implements dynamic
access control based on ABAC principles. This allows for granular access rights defined by contextual
attributes like user role, resource type, and time, with the AccessControlPolicyManager evaluating
+ connect(serverUri, securityCredentials): void
+ registerWithServer(): void
+ deregisterFromServer(): void
+ collectSensorData(sensorId): Data
+ sendObservation(objectId, instanceId, resourceId, value): void
+ handleReadRequest(objectId, instanceId, resourceId): Data
+ handleWriteRequest(objectId, instanceId, resourceId, value): void
+ handleExecuteRequest(objectId, instanceId, resourceId, args): void
+ handleObserveRequest(objectId, instanceId, resourceId): void
+ notifyServer(objectId, instanceId, resourceId, value): void
+ updateResourceStatus(resourceId, status): void
+ getDeviceResources(): List
+ performFirmwareUpdate(firmwarePackageUri): void
+ rebootDevice(): void</p>
        <p>SecurityManager
+ keyManagementSystem: KeyStore
+ authenticationPolicies: List
+ authorizationPolicies: List
+ securityEventLog: List
+ incidentResponsePlaybooks: Map
+ generateEncryptionKey(keyType, keyLength): Key
+ storeEncryptionKey(keyId, keyMaterial, metadata): void
+ retrieveEncryptionKey(keyId): Key
+ rotateEncryptionKey(keyId): void
+ revokeEncryptionKey(keyId): void
+ setAuthenticationPolicy(policyDetails): void
+ setAuthorizationPolicy(policyDetails): void
+ logSecurityEvent(timestamp, eventType, source, details): void
+ getSecurityEventLogs(filter): List
+ detectSecurityThreat(eventData): Threat
+ initiateCountermeasure(threatType, target, action): void
+ updateSecurityConfiguration(configParameters): void
+ performSecurityAudit(): Report</p>
        <p>AccessControlPolicyManager
+ policyStore: Map
+ attributeFinderModules: List
+ pdpEngine: PDP
+ definePolicy(policyId, rules): void
+ deletePolicy(policyId): void
+ getPolicy(policyId): Policy
+ listPolicies(): List
+ evaluateAccessRequest(subjectAttrs, resourceAttrs, actionAttrs, envAttrs): Decision
+ getAttribute(attributeName, entityType, entityId): Value
+ updateAttributeSource(sourceName, sourceConfig): void</p>
        <p>LwM2MServer
+ registeredClients: Map
+ dataStoreInterface: Database
+ securityManagerRef: SecurityManager
+ accessControlPolicyManagerRef: AccessControlPolicyManager
+ serverSecurityConfig: Config
requests and enforcing decisions through, for example, the LwM2MServer. For analytical processing
and problem detection, the architecture includes classes implementing mathematical models. The
RiskAssessmentModel class quantifies potential information security threats, considering probability,
impact, and protection costs, aiding in prioritizing security measures. The AnomalyDetectionModel
class analyzes sensor data using statistical and machine learning methods to identify deviations from
normal environmental behavior, which could indicate real events or cyberattacks. Complementing this,
the NetworkTraficAnalyzer class monitors LwM2M network trafic for anomalies in characteristics like
packet size and request frequency, detecting potential unauthorized access or DDoS attacks. Together,
these classes form a cohesive and secure infrastructure for efective environmental monitoring, with
secure client-server interactions and integrated analytical and security management functions.
5. Plans for further work and practical implementation
Subsequent research endeavors will concentrate on the extensive validation and empirical testing of
the developed conceptual framework and its constituent elements. A pivotal direction for further work
involves the practical implementation of the proposed structural scheme and the software architecture
articulated through the detailed class diagram, transitioning from theoretical constructs to operational
prototypes. The mathematical models for risk assessment, sensor placement optimization, and anomaly
detection necessitate refinement through application to real-world environmental monitoring data.
Building upon advancements in forecasting information systems for environmental monitoring [19] and
information-analytical systems for processing air pollution data [20], future eforts will aim to integrate
these analytical capabilities to enhance the predictive accuracy and utility of our security models. The
practical eficacy of the developed algorithms will be rigorously tested, drawing from experiences
in developing systems for municipal-level air quality data collection, such as those involving Vaisala
stations [21], and for intellectual analysis within industrial enterprises [22].</p>
        <p>Significant attention will be directed towards addressing unresolved challenges, including the
optimization of sensor network deployment and the secure integration with heterogeneous existing
monitoring systems and databases, such as those developed for storing atmospheric air quality
indicators for utility companies [23]. Future work will also explore secure pathways for incorporating data
from corporate IoT networks used in environmental research [24, 25]. The development of secure and
reliable automated reporting mechanisms, for instance, on the exceedance of established atmospheric
air marker standards [26], will be pursued within the secure LwM2M framework.</p>
        <p>Future investigations must also thoroughly evaluate the performance characteristics of the
implemented security mechanisms, particularly under conditions of constrained device resources and varying
network loads. The adaptation and extension of the proposed security solutions to other Internet
of Things application domains exhibiting similar constraints and security requirements represent a
valuable avenue for continued research. Further studies will focus on the scalability of the system,
examining its capacity to accommodate an increasing number of devices and data streams without
degradation in performance or security posture. The developed algorithms for secure bootstrapping,
dynamic access control, and LwM2M trafic anomaly detection will undergo iterative refinement based
on empirical data gathered from experimental setups and pilot deployments.</p>
        <p>There is a recognized need for the development of intuitive user interfaces for the security
monitoring and management system, facilitating efective interaction for operators and administrators.
Comprehensive field trials of the complete integrated system are planned to assess its robustness,
usability, and efectiveness in realistic environmental monitoring scenarios. Ongoing research will
explore the integration of emerging security technologies, such as advanced cryptographic primitives
and distributed ledger technologies for enhanced data integrity and auditability. Finally, a thorough
investigation into the economic viability and cost-benefit analysis of implementing the comprehensive
suite of security measures will be undertaken to provide practical guidance for deployment decisions.</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>6. Conclusions</title>
      <p>The conducted research has culminated in the development of a comprehensive suite of technical
solutions meticulously designed to ensure a secure infrastructure for environmental monitoring systems
predicated on the LwM2M protocol. A significant achievement of this work is the formulation of an
integrated security concept that addresses the multifaceted challenges inherent in protecting distributed
IoT systems, from the sensor device level through to data management and analysis.</p>
      <p>The analysis of the subject area unequivocally confirmed the critical relevance of robust security
measures for environmental monitoring and underscored the specific vulnerabilities associated with
LwM2M-based deployments, which the present work systematically addresses. The proposed structural
scheme provides a coherent framework for organizing the necessary hardware and software components,
thereby facilitating a structured approach to system design and implementation.</p>
      <p>A core contribution of this research lies in the development and formalization of specific mathematical
models tailored to the security requirements of LwM2M environmental monitoring systems. These
include a quantitative model for information security risk assessment, a model for optimizing the
physical placement of sensor devices considering operational constraints, and a sophisticated model
for detecting anomalies within the collected environmental data streams using statistical and machine
learning methodologies. Furthermore, a set of novel algorithms has been synthesized to address critical
security functionalities: an algorithm for secure LwM2M device bootstrapping ensures the protected
provisioning of credentials; an algorithm for dynamic, attribute-based access control enables
finegrained and context-aware authorization; and an algorithm for LwM2M trafic anomaly detection
identifies suspicious network behavior indicative of potential cyberattacks or device malfunctions.
These components collectively enhance data protection, ensure the reliability of monitoring operations,
and support adaptive security management under conditions of limited device resources and dynamic
threat landscapes. The detailed class diagram ofers a concrete blueprint for the software realization of
the proposed system, outlining the interrelationships and responsibilities of key software modules.</p>
      <p>The investigation into potential user interaction capabilities further illustrates the practical
utility and operational relevance of the developed solution. In essence, this work establishes a robust
theoretical and methodological foundation for the engineering of secure, reliable, and eficient
LwM2Mbased environmental monitoring systems, contributing significantly to the advancement of secure IoT
applications.</p>
    </sec>
    <sec id="sec-3">
      <title>Declaration on Generative AI</title>
      <p>The authors have not employed any Generative AI tools.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Hammad</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Abd</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Ahmed</surname>
          </string-name>
          ,
          <article-title>Detecting cyber threats in iot networks: A machine learning approach</article-title>
          ,
          <source>International Journal of Computing and Digital Systems</source>
          <volume>17</volume>
          (
          <year>2024</year>
          )
          <fpage>1</fpage>
          -
          <lpage>25</lpage>
          . doi:
          <volume>10</volume>
          .12785/ ijcds/1571020041.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>S.</given-names>
            <surname>Raza</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Misra</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>He</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Voigt</surname>
          </string-name>
          ,
          <article-title>Lightweight m2m (lwm2m): A new kid on the block for iot device management and bootstrapping</article-title>
          ,
          <source>IEEE Communications Standards Magazine</source>
          <volume>1</volume>
          (
          <year>2017</year>
          )
          <fpage>42</fpage>
          -
          <lpage>47</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M. A.</given-names>
            <surname>Naeem</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>An</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K. H.</given-names>
            <surname>Kim</surname>
          </string-name>
          ,
          <article-title>Security and privacy in lwm2m based iot systems: A survey and research challenges</article-title>
          ,
          <source>Journal of Network and Computer Applications</source>
          <volume>168</volume>
          (
          <year>2020</year>
          )
          <fpage>102745</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>R.</given-names>
            <surname>Dvorak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Jabloncik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mikulasek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Štůsek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Masek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Mozny</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Ometov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Mlynek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Cika</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. Hosek,</surname>
          </string-name>
          <article-title>Lwm2m for cellular iot: Protocol implementation and performance evaluation,</article-title>
          <year>2023</year>
          , pp.
          <fpage>212</fpage>
          -
          <lpage>218</lpage>
          . doi:
          <volume>10</volume>
          .1109/ICUMT61075.
          <year>2023</year>
          .
          <volume>10333286</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>S.</given-names>
            <surname>Rao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Chendanda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Deshpande</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Lakkundi</surname>
          </string-name>
          ,
          <source>Implementing lwm2m in constrained iot devices</source>
          ,
          <year>2015</year>
          . doi:
          <volume>10</volume>
          .1109/ICWISE.
          <year>2015</year>
          .
          <volume>7380353</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>S.</given-names>
            <surname>Bakhare</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. S. W.</given-names>
            <surname>Mohod</surname>
          </string-name>
          ,
          <article-title>A review on real-time network trafic monitoring and anomaly detection system : A comprehensive study with user-friendly interface and historical analysis capabilities</article-title>
          ,
          <source>International Journal of Scientific Research in Science, Engineering and Technology</source>
          <volume>11</volume>
          (
          <year>2024</year>
          )
          <fpage>23</fpage>
          -
          <lpage>41</lpage>
          . doi:
          <volume>10</volume>
          .32628/IJSRSET.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>C.</given-names>
            <surname>Gilbert</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gilbert</surname>
          </string-name>
          ,
          <article-title>Ai-driven threat detection in the internet of things (iot), exploring opportunities and vulnerabilities</article-title>
          ,
          <source>International Journal of Research Publication and Reviews</source>
          <volume>5</volume>
          (
          <year>2024</year>
          )
          <fpage>219</fpage>
          -
          <lpage>236</lpage>
          . doi:
          <volume>10</volume>
          .2139/ssrn.5259702.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>A.</given-names>
            <surname>Abidin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Marquet</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Moeyersons</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Limani</surname>
          </string-name>
          , E. Pohle,
          <string-name>
            <surname>M. Van Kenhove</surname>
            ,
            <given-names>J. M.</given-names>
          </string-name>
          <string-name>
            <surname>Marquez-Barja</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          <string-name>
            <surname>Slamnik-Kriještorac</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          <string-name>
            <surname>Volckaert</surname>
            ,
            <given-names>Mozaik:</given-names>
          </string-name>
          <article-title>An end-to-end secure data sharing platform</article-title>
          ,
          <source>in: Data Economy (DE '23)</source>
          , ACM,
          <year>2023</year>
          . URL: https://www.mdpi.com/2076-3417/15/2/499.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Clark</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Rajabion</surname>
          </string-name>
          ,
          <article-title>A strategic approach to iot security by working towards a secure iot future</article-title>
          ,
          <source>International Journal of Hyperconnectivity and the Internet of Things</source>
          <volume>7</volume>
          (
          <year>2023</year>
          )
          <fpage>1</fpage>
          -
          <lpage>18</lpage>
          . doi:
          <volume>10</volume>
          .4018/IJHIoT.317088.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>