Location Research Breakthrough Possible @S-Logix pro@slogix.in

Controlling Unauthorized Bluetooth Low Energy GATT Command Access in ThingsBoard IoT Deployments Through Device Identity Validation and GATT Operation Authorization

Description

ThingsBoard is an open-source IoT platform used for device management, telemetry collection, data processing, and IoT application workflows. In a ThingsBoard deployment that integrates Bluetooth Low Energy (BLE) devices through a gateway or custom integration, BLE communication can provide an additional device-control interface.

Bluetooth Low Energy Generic Attribute Profile (GATT) defines services, characteristics, and operations through which a BLE client can interact with a BLE peripheral. Operations such as characteristic reads, writes, notifications, and service discovery can therefore become security-sensitive when they control IoT-device functions.

An unauthorized GATT command-access scenario occurs when a BLE client that has not been sufficiently authenticated or authorized attempts to access protected GATT characteristics or perform operations that should be restricted to an approved device or gateway.

In this use case, a controlled ThingsBoard IoT deployment is created on Ubuntu Linux inside an isolated VirtualBox laboratory. A BLE-capable laboratory device or simulated BLE peripheral represents the IoT endpoint, while a controlled gateway integration connects the BLE device with ThingsBoard.

The security architecture introduces device identity validation before protected GATT operations are accepted. After the BLE device identity is validated, a second authorization layer determines whether the identified device is permitted to perform the requested GATT operation. The authorization policy distinguishes permitted operations, such as approved characteristic reads, from restricted operations, such as protected characteristic writes.

Kali Linux is used as the controlled security-testing platform to generate authorized BLE/GATT test requests against the laboratory BLE endpoint. The testing is restricted to the isolated laboratory and does not target third-party Bluetooth devices.

The gateway/integration records the identity of the BLE device, requested GATT operation, target service and characteristic, authorization decision, and resulting action. Wazuh monitors the Ubuntu environment and security events, while OpenSearch provides centralized investigation and correlation.

The complete security workflow is: BLE Client → BLE Device/GATT Service → Device Identity Validation → GATT Operation Identification → Authorization Policy Evaluation → Allow / Deny → ThingsBoard Gateway Integration → Security Event Logging → Wazuh Monitoring → OpenSearch Investigation → Validation.

Existing Security Problem

Application: ThingsBoard IoT Deployment with BLE Gateway Integration

ThingsBoard provides the IoT device-management and application layer, while the BLE gateway/integration provides communication between the IoT platform and the BLE device. The BLE endpoint exposes GATT services and characteristics. Some characteristics may represent sensor information, device configuration, or control functions.

Existing Problem:

If GATT operations are accepted based only on the fact that a BLE client can reach the BLE service, an unauthorized device may attempt to read protected information or write to a control characteristic.

The security problem is therefore:

BLE Client → BLE Connection → GATT Service Discovery → Protected Characteristic Identified → GATT Read / Write Request → Insufficient Device Identity Validation → Insufficient Operation Authorization → Unauthorized GATT Operation → Potential IoT Device Control or Data Exposure

The proposed security architecture separates two security decisions: device identity validation determines whether the connecting BLE device is an approved laboratory device, and GATT operation authorization determines whether that identified device is permitted to perform the requested operation.

Attack

Specific Attack: Unauthorized Bluetooth Low Energy GATT Command Access

The controlled attack attempts to perform GATT operations from a BLE client that does not satisfy the laboratory device-identity and operation-authorization policy. The attack is performed against a synthetic BLE IoT endpoint associated with the ThingsBoard deployment. Controlled testing includes unauthorized attempts to access protected characteristics and perform restricted write operations. The objective is to determine whether the BLE integration verifies the requesting device identity and evaluates the requested GATT operation before allowing the operation to affect the IoT device.

Attack Behavior:
Unauthorized BLE Client
→
BLE Connection Attempt
→
GATT Service Discovery
→
Identify Protected Service / Characteristic
→
Submit GATT Read / Write Request
→
Device Identity Validation
→
Identity Not Authorized
→
GATT Operation Authorization
→
Operation Denied
→
Security Event Generated
→
Wazuh Monitoring
→
OpenSearch Investigation

Security Concept

Device Identity Validation and GATT Operation Authorization:

Device identity validation establishes whether a BLE device participating in the laboratory ThingsBoard deployment is an approved device.

The identity decision can be based on the controlled device identity associated with the BLE integration, such as the approved BLE address or another authenticated device identity mechanism supported by the selected BLE implementation. Identity validation alone is not sufficient. A valid device may still be restricted from performing sensitive operations. Therefore, the second security layer evaluates the requested GATT operation and target characteristic. For example, a device may be allowed to read a telemetry characteristic while being denied permission to write to a protected configuration or control characteristic.

The secure processing flow is:

BLE Connection
→
Device Identity Extraction
→
Device Identity Validation
→
Approved Device?
→
No → Reject Protected GATT Operation
→

Yes → Identify GATT Service and Characteristic
→
Identify Requested Operation
→
Authorization Policy Evaluation
→
Operation Permitted?
→
No → Deny GATT Operation
→

Yes → Execute Authorized Operation
→
Record Security Event
→
ThingsBoard Gateway Processing
→
Wazuh Monitoring
→
OpenSearch Investigation

Defensive Mechanism

BLE Device Identity Validation

The BLE integration validates the identity of the requesting laboratory device against the approved device-identity policy.

Purpose

Prevent unidentified or unauthorized BLE devices from accessing protected IoT operations.

Approved Device Registry

Approved laboratory BLE devices are maintained in a controlled identity registry.

Purpose

Establish an explicit trust boundary for BLE devices participating in the ThingsBoard deployment.

GATT Service Authorization

The security layer identifies the GATT service associated with the requested operation.

Purpose

Prevent unauthorized devices from accessing protected GATT services.

Characteristic-Level Authorization

Authorization is applied to individual GATT characteristics rather than treating the entire BLE service as equally trusted.

Purpose

Restrict access to sensitive IoT characteristics.

GATT Operation Authorization

The authorization layer distinguishes between GATT operations such as read and write.

Purpose

Prevent a device that is permitted to read information from automatically receiving permission to modify IoT-device state.

Protected Characteristic Write Control

Sensitive write characteristics require an explicit authorization decision before the write is executed.

Purpose

Prevent unauthorized GATT commands from modifying protected IoT-device functions.

Device-to-Operation Policy Mapping

Each approved BLE device is associated with a defined set of permitted GATT operations.

Purpose

Apply least-privilege authorization to BLE device interactions.

Unauthorized Operation Rejection

Requests that fail identity or operation authorization are rejected before reaching the protected device-control function.

Purpose

Prevent unauthorized GATT commands from reaching the IoT device.

GATT Security Event Logging

Identity failures and denied GATT operations are recorded with relevant request information.

Purpose

Provide traceable evidence of unauthorized BLE activity.

Security Monitoring

Wazuh monitors the laboratory environment and security events generated by the BLE integration.

Purpose

Detect repeated unauthorized GATT access attempts.

Centralized Security Investigation

OpenSearch provides centralized analysis of BLE authorization events and associated IoT activity.

Purpose

Correlate device identity failures, denied operations, and ThingsBoard activity.

Security Tools

IoT Platform: ThingsBoard

ThingsBoard provides the IoT device-management and application environment for the laboratory deployment.

Purpose
  • Manage laboratory IoT devices.
  • Receive device telemetry.
  • Integrate the BLE gateway.
  • Process IoT device data.
  • Provide the application layer for the security test.

BLE Gateway / Integration: Controlled BLE Gateway

The BLE gateway provides the communication boundary between the BLE devices and the ThingsBoard IoT platform.

Purpose
  • Discover laboratory BLE devices.
  • Receive GATT operations.
  • Validate device identity.
  • Apply GATT authorization.
  • Forward authorized IoT data to ThingsBoard.

BLE Device: Controlled BLE Peripheral

A controlled BLE peripheral represents the laboratory IoT device.

Purpose
  • Expose synthetic GATT services.
  • Provide test characteristics.
  • Accept authorized operations.
  • Reject unauthorized operations through the security layer.
  • Generate repeatable BLE security-test conditions.

BLE Testing Platform: Kali Linux

Kali Linux is used as the controlled security-testing platform for authorized BLE testing.

Purpose
  • Discover the laboratory BLE peripheral.
  • Establish controlled BLE connections.
  • Test GATT service access.
  • Test characteristic operations.
  • Validate authorization controls.

BLE Analysis Tool: BlueZ

BlueZ provides the Linux Bluetooth protocol stack and command-line tools used for laboratory BLE interaction.

Purpose
  • Provide Bluetooth functionality on Linux.
  • Discover BLE devices.
  • Establish controlled BLE connections.
  • Inspect GATT services.
  • Perform authorized laboratory GATT testing.

BLE GATT Testing Tool: bluetoothctl / BlueZ Tools

BlueZ command-line tools are used to perform controlled Bluetooth discovery and connection testing.

Purpose
  • Identify the laboratory BLE device.
  • Verify Bluetooth connectivity.
  • Inspect available GATT-related information.
  • Support controlled access testing.

Security Enforcement Component: GATT Authorization Module

A controlled authorization module is implemented at the BLE gateway/integration layer.

Purpose
  • Validate device identity.
  • Identify requested GATT operations.
  • Apply characteristic-level policies.
  • Allow authorized operations.
  • Deny unauthorized operations.

Security Monitoring Tool: Wazuh

Wazuh monitors the Ubuntu environment and relevant BLE authorization activity.

Purpose
  • Monitor security logs.
  • Detect repeated authorization failures.
  • Generate security alerts.
  • Monitor gateway activity.
  • Support incident investigation.

Security Analytics Tool: OpenSearch

OpenSearch provides centralized investigation of BLE and ThingsBoard security events.

Purpose
  • Search authorization failures.
  • Correlate BLE and ThingsBoard events.
  • Analyze repeated unauthorized requests.
  • Build an investigation timeline.
  • Preserve security evidence.

Operating System: Ubuntu Linux

Ubuntu provides the controlled ThingsBoard and BLE gateway environment.

Purpose
  • Host ThingsBoard.
  • Host the BLE gateway/integration.
  • Execute authorization logic.
  • Store security logs.
  • Provide host telemetry.

Virtualization Platform: VirtualBox

VirtualBox provides the isolated cybersecurity laboratory.

Purpose
  • Host Ubuntu and Kali Linux.
  • Isolate BLE security testing.
  • Provide controlled network connectivity.
  • Support repeatable experiments.
  • Prevent impact on external IoT environments.

Process

STEP 01

Step 1: Prepare the Isolated IoT Security Laboratory

  • Create the Ubuntu virtual machine for the ThingsBoard environment.
  • Prepare the Kali Linux security-testing environment.
  • Configure the authorized laboratory network.
  • Connect the required Bluetooth hardware to the appropriate laboratory system.
  • Verify that the BLE hardware is visible to the laboratory operating system.
  • Confirm that all Bluetooth testing is restricted to the controlled laboratory.
Tools: VirtualBox + Ubuntu + Kali Linux
STEP 02

Step 2: Deploy ThingsBoard

  • Install the ThingsBoard IoT platform on Ubuntu.
  • Start the required ThingsBoard services.
  • Verify access to the ThingsBoard administration interface.
  • Create the controlled laboratory tenant or environment.
  • Record the ThingsBoard version and configuration.
  • Confirm normal IoT device-management functionality.
Tools: ThingsBoard + Ubuntu
STEP 03

Step 3: Configure the BLE Gateway Environment

  • Install the required Linux Bluetooth components.
  • Configure the controlled BLE gateway or integration component.
  • Verify that the Bluetooth adapter is detected.
  • Verify that the gateway can communicate with the laboratory BLE peripheral.
  • Establish the communication path between the BLE integration and ThingsBoard.
  • Record the gateway configuration.
Tools: BlueZ + BLE Gateway + ThingsBoard + Ubuntu
STEP 04

Step 4: Create the Controlled BLE IoT Device

  • Prepare the laboratory BLE peripheral.
  • Assign a controlled device identity.
  • Configure the BLE advertising information.
  • Create synthetic IoT GATT services.
  • Create telemetry and control characteristics.
  • Ensure that the device contains no real-world sensitive information.
Tools: BLE Peripheral + GATT Service + Ubuntu
STEP 05

Step 5: Define the Laboratory GATT Services

  • Create a synthetic telemetry service.
  • Create a telemetry characteristic.
  • Create a controlled configuration characteristic.
  • Create a controlled device-command characteristic.
  • Define which characteristics are readable.
  • Define which characteristics require write authorization.
Tools: BLE GATT + Controlled BLE Device
STEP 06

Step 6: Establish the Normal BLE and ThingsBoard Baseline

  • Discover the laboratory BLE peripheral from the approved gateway.
  • Establish a normal BLE connection.
  • Perform authorized service discovery.
  • Read the permitted telemetry characteristic.
  • Execute an approved laboratory write operation where required.
  • Verify that the resulting device activity is reflected correctly in ThingsBoard.
Tools: BlueZ + BLE Gateway + ThingsBoard
STEP 07

Step 7: Create the Approved Device Identity Registry

  • Record the identity of the approved laboratory BLE device.
  • Associate the identity with the controlled IoT device.
  • Store the approved identity in the gateway authorization configuration.
  • Define the identity attributes used by the authorization component.
  • Verify that the approved device is recognized.
  • Record the identity-validation baseline.
Tools: GATT Authorization Module + BLE Gateway + Ubuntu
STEP 08

Step 8: Define GATT Operation Authorization Policies

  • Define the GATT services that require protection.
  • Define the characteristics that require protection.
  • Define permitted read operations.
  • Define permitted write operations.
  • Define denied operations for restricted devices.
  • Associate each permitted operation with the approved device identity.
Tools: GATT Authorization Module + BLE Gateway
STEP 09

Step 9: Implement Device Identity Validation

  • Inspect the identity associated with each incoming BLE request.
  • Compare the identity against the approved device registry.
  • Reject requests from unidentified laboratory test devices.
  • Permit recognized devices to continue to operation authorization.
  • Record identity-validation failures.
  • Verify that normal approved-device access continues.
Tools: BLE Gateway + GATT Authorization Module + Ubuntu
STEP 10

Step 10: Implement Characteristic-Level Authorization

  • Identify the GATT service requested by the BLE client.
  • Identify the target characteristic.
  • Identify the requested operation.
  • Compare the operation against the configured policy.
  • Permit authorized operations.
  • Reject unauthorized characteristic access.
Tools: GATT Authorization Module + BLE Gateway
STEP 11

Step 11: Implement Protected Write Authorization

  • Identify characteristics capable of changing device state.
  • Mark those characteristics as protected.
  • Require successful device identity validation.
  • Require successful operation authorization.
  • Reject unauthorized write requests.
  • Record each denied protected write.
Tools: BLE GATT + GATT Authorization Module
STEP 12

Step 12: Implement Security Event Logging

  • Record successful identity validation events.
  • Record failed identity validation events.
  • Record authorized GATT operations.
  • Record denied GATT operations.
  • Record the target service and characteristic.
  • Record timestamps and relevant device identity information.
Tools: GATT Authorization Module + Ubuntu Logging
STEP 13

Step 13: Configure Wazuh Monitoring

  • Configure Wazuh to collect BLE gateway security logs.
  • Monitor identity-validation failures.
  • Monitor denied GATT operations.
  • Detect repeated unauthorized access attempts.
  • Generate controlled security alerts.
  • Verify that the alerts contain sufficient investigation information.
Tools: Wazuh + Ubuntu + GATT Authorization Module
STEP 14

Step 14: Configure OpenSearch Investigation

  • Forward relevant Wazuh security events to OpenSearch.
  • Create searches for failed device identity validation.
  • Create searches for denied GATT operations.
  • Correlate BLE authorization events with ThingsBoard activity.
  • Verify that repeated unauthorized requests can be reconstructed.
  • Preserve the investigation timeline.
Tools: Wazuh + OpenSearch + ThingsBoard
STEP 15

Step 15: Generate the Controlled Unauthorized GATT Access Attempt

  • Use Kali Linux as the authorized BLE testing system.
  • Discover the controlled laboratory BLE peripheral.
  • Establish the controlled BLE test connection.
  • Attempt access to a protected GATT characteristic using an unauthorized laboratory identity.
  • Attempt a restricted GATT write operation where applicable.
  • Keep all testing restricted to the laboratory BLE device.
Tools: Kali Linux + BlueZ + Controlled BLE Peripheral
STEP 16

Step 16: Validate Device Identity Enforcement

  • Verify that the unauthorized device identity reaches the validation layer.
  • Verify that the identity is not present in the approved device registry.
  • Verify that protected operations are rejected.
  • Verify that the protected characteristic is not modified.
  • Verify that the identity failure is logged.
  • Verify that Wazuh receives the corresponding security event.
Tools: BLE Gateway + GATT Authorization Module + Wazuh
STEP 17

Step 17: Validate GATT Operation Authorization

  • Test an approved device against a permitted read operation.
  • Test the same approved device against a restricted operation.
  • Verify that the permitted operation succeeds.
  • Verify that the restricted operation is denied.
  • Verify that unauthorized writes do not change the controlled device state.
  • Confirm that each authorization decision is recorded.
Tools: GATT Authorization Module + BLE Peripheral + ThingsBoard
STEP 18

Step 18: Investigate and Remediate the Unauthorized Access Event

  • Review the BLE gateway authorization logs.
  • Review Wazuh alerts associated with the unauthorized access attempt.
  • Search OpenSearch for the device identity and target characteristic.
  • Correlate the denied GATT request with ThingsBoard activity.
  • Confirm that the protected characteristic remained unchanged.
  • Review and refine the authorization policy if required.
  • Repeat the controlled test after remediation.
Tools: Wazuh + OpenSearch + ThingsBoard + BLE Gateway
STEP 19

Step 19: Perform Final GATT Authorization Validation

  • Repeat the normal approved-device workflow.
  • Verify successful authorized telemetry access.
  • Verify successful permitted GATT operations.
  • Repeat the unauthorized device-identity test.
  • Verify rejection of unauthorized protected operations.
  • Repeat the restricted-characteristic test.
  • Verify denial of unauthorized writes.
  • Verify that ThingsBoard receives only authorized device activity.
  • Verify Wazuh security monitoring.
  • Verify OpenSearch investigation evidence.
  • Verify that the controlled BLE device remains protected.
  • Preserve the final configuration, logs, alerts, and validation evidence.
Tools: ThingsBoard + BLE Gateway + BlueZ + Kali Linux + Wazuh + OpenSearch + Ubuntu

Outcome

  1. A controlled ThingsBoard IoT deployment with BLE gateway integration is successfully established in an isolated Ubuntu and VirtualBox laboratory.
  2. A synthetic BLE IoT device with controlled GATT services and characteristics is successfully integrated into the laboratory ThingsBoard environment.
  3. A device-identity validation mechanism is implemented to distinguish approved laboratory BLE devices from unauthorized test identities.
  4. GATT authorization policies are implemented at the BLE gateway/integration boundary, allowing operation-specific access decisions rather than treating every connected BLE device as fully trusted.
  5. Protected GATT characteristics are restricted so that unauthorized read or write operations do not reach the protected IoT-device functionality.
  6. Authorized devices can continue to perform their permitted GATT operations while restricted operations are denied according to the configured policy.
  7. Unauthorized identity and GATT-operation events are recorded and monitored through Wazuh, providing security evidence for the controlled access attempts.
  8. OpenSearch provides centralized investigation and correlation of BLE identity failures, denied GATT operations, and associated ThingsBoard activity.
  9. Post-remediation testing confirms that the protected IoT device state remains unchanged by unauthorized GATT commands while legitimate ThingsBoard and BLE operations continue to function.
  10. The complete ThingsBoard BLE GATT unauthorized-access detection and prevention workflow is successfully demonstrated, covering BLE device identification, GATT service and characteristic protection, device identity validation, operation-specific authorization, unauthorized-access testing, protected-write prevention, Wazuh monitoring, OpenSearch investigation, remediation, and final validation.
← Previous Project
Project 7 of 7