NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion...

29
NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram Bhatti, Maham Chaudhry, Vianney Lapotre, Guy Gogniat Contact: [email protected]

Transcript of NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion...

Page 1: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

NIGHTs-WATCH

A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters

Maria Mushtaq, Ayaz Akram, Khurram Bhatti, Maham Chaudhry, Vianney Lapotre, Guy Gogniat

Contact: [email protected]

Page 2: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

2 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Outline o  Cache-based Side-Channel Attacks

o  The Memory Footprint

o  Hardware Performance Counters (HPCs)

o  Machine Learning Models

o NIGHTs-WATCH o  The Big Picture

o  Selected HPCs & Machine Learning Models

o  Experimental Results o  Case Study-I: Flush+Reload on RSA

o  Case Study-II: Flush+Flush on AES

Page 3: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

3 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Motivation o  SCA defenses (mostly) offer all-weather protection

& (often) heavily trade-off performance for

protection

o Need-based protection could help –but accurate

and fast need assessment is crucial

o  Detection can be a first line of defense!

Page 4: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

4 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Side-Channel Attacks o  Cache-based SCAs exploit memory footprint

of the victim process

o  Memory Access Timing: Can reveal from where the data/

instructions are being accessed

o  Memory Access Pattern: Can reveal what exactly is being

processed

Figure: Courtesy Yarom et al.

Page 5: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

5 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Side-Channel Attacks o Memory Access Timing Information

Results measured on Intel i5 for F+R Attack implementation. CPU Cycles

Num

ber o

f Acc

esse

s

Cache access time

Memory Access time

Page 6: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

6 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Side-Channel Attacks o Memory Access Pattern Information

S M S S M S M S

1 0 1 1

Results measured on i7 for F+R attack on RSA: Cache hit pattern for Square, Multiply, and Barrett operations.

Page 7: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

7 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

SCA Detection o Attacks have their own memory footprint

too!

Figure: Courtesy Yarom et al. 3-Phases of F+R Attack implementation

Page 8: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

8 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

SCA Detection o  Hardware Performance Counters (HPCs)

o  Specialized HW registers for performance monitoring that reveal run-time behavioral information of software

# Scope Hardware Performance Counters 1

Cache Level 1

Data Cache Misses (L1-DCM)

2 Instruction Cache misses (L1-ICM)

3 Total cache misses (L1-TCM)

4

Cache Level 2

Instruction cache accesses (L2-ICA)

5 Instruction Cache misses (L2-ICM)

6 Total Cache accesses (L2-TCA)

7 Total cache misses (L2-TCM)

8

Cache Level 3

Instruction cache accesses (L3-ICA)

9 Total Cache accesses (L3-TCA)

10 Total cache misses (L3-TCM)

11 System-wide

Branch Miss Prediction (BR_MSP)

12 Total CPU Cycles (TOT_CYC)

Page 9: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

9 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

SCA Detection o  Hardware Performance Counters (HPCs)

Page 10: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

10 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

SCA Detection o  Hardware Performance Counters (HPCs)

Machine Learning Can Help!

Page 11: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

11 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Outline o  Cache-based Side-Channel Attacks

o  The Memory Footprint

o  Hardware Performance Counters (HPCs)

o  Machine Learning Models

o NIGHTs-WATCH o  The Big Picture

o  Selected HPCs & Machine Learning Models

o  Experimental Results o  Case Study-I: Flush+Reload on RSA

o  Case Study-II: Flush+Flush on AES

Page 12: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

12 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

NIGHTs-WATCH o The Big Picture

Variable Load Conditions Selected HPCs

Selected ML Models One-Time Training Process Scalable Set of ML Models

Trained ML Classifiers Real-time HPC Data

Run-time Classification

Page 13: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

13 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

NIGHTs-WATCH o Machine Learning Models

# Machine Learning Models 1 LR

2 LDA

3 Linear SVM

4 QDA

5 Nearest Centroid

6 Naïve Bayes

7 KNN

8 Perceptron

9 Decision Tree

10 Dummy

11 Random Forest

12 Neural Network

# Selected Machine Learning Models 1 Linear Regression (LR)

2 Linear Discriminant Analysis (LDA)

3 Linear Support Vector Machine (SVM)

o  Linear classifiers could do the job!

o  Light-weight for run-time detection

o  Easy to embedded with victim process

Page 14: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

14 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

o ML Models –accuracy for F+R attack detection

NIGHTs-WATCH

Page 15: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

15 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

o ML Models –accuracy for F+F attack detection

NIGHTs-WATCH

Page 16: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

16 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Outline o  Cache-based Side-Channel Attacks

o  The Memory Footprint

o  Hardware Performance Counters (HPCs)

o  Machine Learning Models

o NIGHTs-WATCH o  The Big Picture

o  Selected HPCs & Machine Learning Models

o  Experimental Results o  Case Study-I: Flush+Reload on RSA

o  Case Study-II: Flush+Flush on AES

Page 17: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

17 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Experiments o The Evaluation Metrics

①  Detection Accuracy

②  Runtime Detection Speed

③  Runtime Overhead

④  System Load Conditions

⑤  Distribution of Error (false positives & false negatives)

Page 18: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

18 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Experiments o Case Study-I: F+R Attack on RSA

Page 19: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

19 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Experiments o Case Study-I: F+R Attack on RSA –No Load

ML Model Accuracy (%) False Positives (%) False Negatives (%)

LDA 99.51 99.60 0.40

LR 99.51 100 0

SVM 98.82 33.72 66.28

Page 20: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

20 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Experiments o Case Study-I: F+R Attack on RSA –Av. Load

ML Model Accuracy (%) False Positives (%) False Negatives (%)

LDA 99.50 98.42 1.58

LR 99.50 98.82 1.18

SVM 90.01 1.70 98.30

Page 21: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

21 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Experiments o Case Study-I: F+R Attack on RSA –Full Load

ML Model Accuracy (%) False Positives (%) False Negatives (%)

LDA 99.44 87.76 12.24

LR 99.47 92.28 7.72

SVM 95.79 76.29 23.71

Page 22: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

22 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Experiments o Case Study-I: F+R Attack on RSA

o Speed

o Overhead ML Model Victim Slowdown (%)

LDA 0.94%

LR 1.63%

SVM 1.29%

ML Model No/Average/Full Load Conditions

LDA 0.98% of bits are encrypted within

single RSA round before successful detection of F+R

LR

SVM

Page 23: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

23 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Experiments o Case Study-II: F+F Attack on AES

Page 24: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

24 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Experiments o Case Study-II: F+F Attack on AES –No Load

ML Model Accuracy (%) False Positives (%) False Negatives (%)

LDA 99.97 75 25

LR 91.73 0 100

SVM 97.42 0 100

Page 25: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

25 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Experiments o Case Study-II: F+F Attack on AES –Av. Load

ML Model Accuracy (%) False Positives (%) False Negatives (%)

LDA 98.74 89.26 10.74

LR 83.09 84.32 15.68

SVM 70.64 94.56 5.44

Page 26: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

26 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Experiments o Case Study-II: F+F Attack on AES –Full Load

ML Model Accuracy (%) False Positives (%) False Negatives (%)

LDA 95.20 95.43 4.57

LR 75.86 98.39 1.61

SVM 63.16 98.14 1.86

Page 27: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

27 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Experiments o Case Study-II: F+F Attack on AES

o Speed

o Overhead ML Model Victim Slowdown (%)

LDA 1.18%

LR 1.10%

SVM 0.79%

Gruss et al. 2016. Flush+Flush: A Fast and Stealthy Cache Attack. In DIMVA. 279–299

ML Model No/Average/Full Load Conditions

LDA 12.5% of 400 AES encryptions are

performed before successful detection of F+F

LR

SVM

Page 28: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

28 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Concluding Remarks o  NIGHTs-WATCH offers fast runtime detection with high

accuracy for cache-based SCAs using machine learning

o  Results are consistent under variable load conditions

o  Provides detection for high-precision and stealthier attacks

on AES & RSA using real-time HPC data

o  Scalable for larger set of ML models and attacks

Page 29: NIGHTs-WATCH - Yale University · 2018-06-19 · NIGHTs-WATCH A Cache-Based Side-Channel Intrusion Detector using Hardware Performance Counters Maria Mushtaq, Ayaz Akram, Khurram

29 M. Mushtaq et al.| ISCA-HASP | June 02, 2018 | Los Angeles, CA, USA

www.eclab.itu.edu.pk

Thank You!

co-authors

Khurram (ITU)

Vianney (UBS) Guy (UBS)

Maria (UBS) Ayaz (WMICH)

Maham (ITU)