Using Trusted Execution Environments for Secure Stream Processing of Medical Data

Carlos Segarra, Ricard Delgado-Gonzalo, Mathieu Lemay, Pierre-Louis Aublin, Peter Pietzuch, Valerio SchiavoniarXiv 2019 · DOI · arXiv

TL;DR

This paper presents a secure, real-time stream processing architecture for sensitive medical data by leveraging Intel SGX (Software Guard Extensions). By building upon the SGX-SPARK framework, the authors demonstrate that it is possible to process high-frequency cardiac signals on untrusted public clouds with a practical performance overhead of only 4–5x compared to non-secure systems.

What Problem Does This Paper Address?

The proliferation of Internet of Things (IoT) health sensors—like smartwatches and chest bands—generates a massive, continuous stream of sensitive personal data. While public clouds offer the ideal infrastructure to process these streams, they are inherently "untrusted." A compromised cloud operator or a malicious co-hosted application could leak private medical information.

Existing solutions fall short:

  1. Homomorphic Encryption: While it allows computation on encrypted data, its massive computational overhead makes it unusable for real-time streaming.
  2. Rigid TEE Frameworks: Previous Trusted Execution Environment (TEE) solutions often require developers to rewrite their code in specific, low-level languages, hindering the adoption of industry-standard tools like Apache Spark.

The authors aim to bridge this gap by creating a system that provides strong hardware-level security guarantees while maintaining compatibility with the Spark ecosystem.

Methods

The authors designed a prototype that integrates wearable sensors with a secure cloud backend. The core of their approach is the use of Intel SGX, which creates hardware-isolated "enclaves" in memory that even a compromised Operating System cannot access.

Key Components:

  • SGX-SPARK: The system leverages SGX-SPARK, which uses a library OS (SGX-LKL) to run unmodified Java Virtual Machines (JVMs) inside enclaves. As shown in the architecture below, the system partitions the application: sensitive analytics run inside the enclave, while non-sensitive management tasks run outside.
  • Secure Communication: Data is encrypted at the sensor/gateway level and sent via SSH/SecureFTP. Inside the cloud node, communication between the "trusted" and "untrusted" parts of the JVM happens through encrypted shared memory.
  • Medical Analytics: The authors implemented two standard Heart Rate Variability (HRV) algorithms: SDNN (Standard Deviation of NN intervals) and HRVBands (frequency domain analysis). These are used to predict conditions like myocardial infarction.
Fig. 2: SGX-SPARK attacker model and collab- orative structure scheme.

Datasets

To evaluate the system, the authors used:

  • Realistic Cardiac Datasets: Data representing R-peak timestamps and RR intervals (the time between heartbeats) typically generated by ECG or PPG sensors.
  • Synthetic Data Generators: To stress-test the system beyond normal human physiological limits, they deployed a fleet of Docker containers to simulate hundreds of concurrent clients, scaling the input load from kilobytes to megabytes per second.
Fig. 3: Schematic representation of an ECG signal. It shows three normal beats and the informa- tion transferred from the sensor to the gateway. The most relevant part of the ECG wave are the R peaks and the time elapsed between them. The RR intervals together with the R peaks’ timestamp are sent from the sensor to the gateway.

Key Insights and Ideas

  • The "Near-Native" Promise: The execution workflow of SGX (see Figure 1) allows code to run at near-native speeds once inside the enclave. The primary overhead comes from the "context switching" (moving data in and out of the enclave) and memory encryption.
  • Transparency is Feasible: By using a library OS (SGX-LKL), the authors proved that complex, high-level frameworks like Apache Spark can be secured without forcing developers to abandon Java or Scala.
  • Practicality for Medical IoT: Because individual health sensors produce relatively low-throughput data (23–69 bytes/second), the 4–5x overhead of SGX is negligible for real-world medical monitoring, even when aggregating data from hundreds of users.
Fig. 1: INTEL SGX execution workflow.

Key Results

  • Modest Overhead: For typical workloads, the SGX-enabled system showed a 4x to 5x slowdown compared to vanilla Spark. While this sounds high, in the context of sub-second processing, it remains well within the requirements for real-time medical alerts.
  • Scalability: The system successfully scaled to hundreds of clients. Performance remained stable until reaching a "load threshold" of approximately 4–8 MB per second, at which point memory encryption overhead began to exponentiate.
  • Efficiency: The average batch processing time for streaming HRV analysis was found to be sufficient to satisfy most Service Level Agreements (SLAs) in production environments.

Limitations and Future Work

  • Side-Channel Vulnerabilities: The authors acknowledge that SGX is not a silver bullet; it remains susceptible to certain side-channel attacks (like Spectre or Foreshadow) that require hardware-level fixes from Intel.
  • Implementation Gaps: The current version of SGX-SPARK does not yet support the full StreamingContext inside the enclave, requiring some estimations for the streaming results based on batch performance.
  • Future Directions: The team plans to extend support to ARM TrustZone to secure the client-side (e.g., on a Raspberry Pi gateway) and to evaluate the financial cost of deploying these systems on public cloud offerings like AWS Confidential Computing.

Summary updated

Abstract

Processing sensitive data, such as those produced by body sensors, on third-party untrusted clouds is particularly challenging without compromising the privacy of the users generating it. Typically, these sensors generate large quantities of continuous data in a streaming fashion. Such vast amount of data must be processed efficiently and securely, even under strong adversarial models. The recent introduction in the mass-market of consumer-grade processors with Trusted Execution Environments (TEEs), such as Intel SGX, paves the way to implement solutions that overcome less flexible approaches, such as those atop homomorphic encryption. We present a secure streaming processing system built on top of Intel SGX to showcase the viability of this approach with a system specifically fitted for medical data. We design and fully implement a prototype system that we evaluate with several realistic datasets. Our experimental results show that the proposed system achieves modest overhead compared to vanilla Spark while offering additional protection guarantees under powerful attackers and threat models.
BibTeX
@misc{segarra2019using,
  author = {Carlos Segarra and Ricard Delgado-Gonzalo and Mathieu Lemay and Pierre-Louis Aublin and Peter Pietzuch and Valerio Schiavoni},
  title = {{Using Trusted Execution Environments for Secure Stream Processing of Medical Data}},
  year = {2019},
  eprint = {1906.07072},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1906.07072},
}

Loading related content...

Figure