Skip to content

astro-dally/side_channel_attack_detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ EdgeShield: Real-Time Side-Channel Detection at the Edge

EdgeShield is an edge-native system for detecting side-channel attacks using hardware performance counter (HPC) signals.

Instead of running detection in a centralized backend, EdgeShield deploys the entire pipeline on Cloudflare Workers, enabling real-time inference and mitigation directly at the edge.

This project bridges the gap between academic research and practical security systems by turning offline ML pipelines into a deployable, serverless security layer.


πŸ›‘οΈ EdgeShield

EdgeShield takes the side-channel detection pipeline from research and makes it usable in practice.

We collect hardware performance counter data using Linux perf, engineer features like cache miss rate and IPC, and run detection directly at the edge using Cloudflare Workers.

The system processes each request in milliseconds, explains why it was flagged, and can trigger mitigation actions such as rate limiting.

For safe and reproducible demos, EdgeShield includes a simulation layer based on real datasets, while also supporting live ingestion using a perf-based collector.


πŸ—οΈ Architecture

EdgeShield separates data collection from inference and runs detection at the edge:

HPC Data / Simulation
        ↓
Cloudflare Worker (Feature Engineering + Inference)
        ↓
KV (Thresholds + Attacker State)
        ↓
D1 (Detection Logs + Analytics)
        ↓
R2 (Optional Trace Storage)
        ↓
Dashboard (Real-Time Visualization)

Key Idea

Instead of sending data to a backend, detection happens instantly inside Cloudflare Workers, reducing latency and enabling immediate mitigation.


🌐 Cloudflare Usage

EdgeShield is built entirely on Cloudflare’s edge platform:

  • Workers β†’ Runs feature engineering and detection logic at the edge
  • D1 β†’ Stores detection logs and powers dashboard analytics
  • KV β†’ Stores thresholds and tracks repeat attacker behavior
  • R2 β†’ Optional storage for raw traces and replay

This allows the system to run without any traditional backend infrastructure.


⚑ Why Edge-Based Detection?

Side-channel attacks operate at extremely small time scales and rely on timing behavior.

Traditional approach:

  • Data β†’ Backend β†’ Analysis β†’ Response
  • High latency β†’ delayed detection

EdgeShield approach:

  • Data β†’ Edge β†’ Instant inference
  • Low latency β†’ immediate detection

Running detection at the edge ensures faster response and reduces the window of exploitation.


✨ Features

  • Real-time side-channel attack detection
  • Edge-native inference using Cloudflare Workers
  • Explainable detection (feature-level insights)
  • Simulation pipeline for reproducible testing
  • Dataset evaluation with accuracy metrics
  • Live dashboard with threat stream visualization
  • Optional raw trace storage and replay

πŸš€ Demo

Run EdgeShield locally:

cd edgeshield
npm install
npm run dev

Open: http://localhost:8787

You can:

  • simulate attack and benign traffic
  • view real-time detection
  • inspect feature-level explanations
  • evaluate datasets

πŸ“ Repository Structure

.
β”œβ”€β”€ edgeshield/                # Edge-native side-channel detection worker & UI dashboard
β”œβ”€β”€ Research_Results/          # Plots, figures, exported CSVs, and PDF report assets
β”œβ”€β”€ data/                      # Raw perf logs (large files – optional, .gitignore recommended)
β”œβ”€β”€ data_extraction_code/      # Scripts for data collection (collector.sh) & C programs (attacker.c, victim.c)
β”œβ”€β”€ documents/                 # Additional project documentation
β”œβ”€β”€ notebooks/                 # Jupyter notebooks (side_channel_attack_detection_pipeline.ipynb, generated HTMLs)
β”œβ”€β”€ presentation/              # HTML slide deck (progress_report_presentation.html) and assets
β”œβ”€β”€ report/                    # IEEE-style LaTeX paper (main.tex) and exported PDFs/HTMLs
β”œβ”€β”€ runtime/                   # Real-time monitoring script (realtime_hpc_monitor.py)
β”œβ”€β”€ generate_presentation.py   # Helper script to (re)generate the HTML deck
β”œβ”€β”€ Makefile                   # Build shortcuts for compiling the LaTeX report
β”œβ”€β”€ README.md                  # This file
β”œβ”€β”€ requirements.txt           # Python package dependencies
β”œβ”€β”€ .gitignore                 # Ignored files & directories
└── LICENSE                    # MIT License

βš™οΈ Getting Started

Prerequisites

  • Python 3.11+ with packages listed in requirements.txt (pandas, scikit-learn, torch, torchvision, matplotlib, seaborn, numpy, jupyter).
  • LaTeX distribution (TeX Live or MiKTeX) with latexmk and standard packages (IEEEtran, hyperref, graphicx).
  • Git for cloning the repository.
  • Node.js & npm (Required only for running the EdgeShield Cloudflare Worker).

Installation

# Clone the repo
git clone https://github.com/<your-username>/side_channel_attack_detection.git
cd side_channel_attack_detection

# Install Python dependencies (prefer a virtual environment)
python -m venv venv
source venv/bin/activate   # on macOS/Linux
pip install -r requirements.txt

πŸ“„ Building the Report

The LaTeX paper lives in report/. A simple Makefile target compiles it to PDF:

make pdf

The output report/main.pdf contains the IEEE-style paper with all figures linked from Research_Results/.


πŸ“Š Running the Presentation

Open the HTML deck directly in a browser or serve it locally:

# Quick local server (Python 3)
python -m http.server --directory presentation 8000
# Then navigate to http://localhost:8000/progress_report_presentation.html

Keyboard navigation (←/β†’ arrows) and the Previous / Next buttons work out-of-the-box.


πŸ’Ύ Data & Results

All generated figures are stored under Research_Results/. The repository does not track the large raw perf logs – they are listed in .gitignore to keep the repo lightweight. If you need the raw data, generate it using the scripts in data_extraction_code/ (see the notebook for the full workflow).


🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b my-feature).
  3. Make your changes and ensure the LaTeX builds (make pdf).
  4. Submit a Pull Request.

πŸ“ License

This project is licensed under the MIT License – see the LICENSE file for details.

About

EdgeShield is a serverless side-channel attack detection system that turns offline ML pipelines into a deployable security layer using Cloudflare infrastructure.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors