securing iot applications

48
Securing the Internet of Things Paul Fremantle CTO, WSO2 ([email protected] ) PhD researcher, Portsmouth University ([email protected] ) @pzfreo

Upload: wso2

Post on 15-Jan-2015

926 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Securing IoT Applications

Securing  the  Internet  of  Things  

Paul  Fremantle  CTO,  WSO2  ([email protected])  

PhD  researcher,  Portsmouth  University  ([email protected])    

@pzfreo  

Page 2: Securing IoT Applications

About  me  •  CTO  and  Co-­‐Founder  WSO2  – Open  Source  Middleware  plaLorm  

•  Part-­‐Mme  PhD  looking  at  security  

•  Working  in  Apache  for  14  years  

•  Working  with  Cloud,  SOA,  APIs,  MQTT,  IoT  

2  

Page 3: Securing IoT Applications

Firstly,  does  it  maQer?    

Page 4: Securing IoT Applications
Page 5: Securing IoT Applications
Page 6: Securing IoT Applications

“Google    Hacking”  

Page 7: Securing IoT Applications

hQp://www.forbes.com/sites/kashmirhill/2013/07/26/smart-­‐homes-­‐hack/    

Page 8: Securing IoT Applications
Page 9: Securing IoT Applications

hQp://freo.me/1pbUmof  

Page 10: Securing IoT Applications

So  what  is  different  about  IoT?  •  The  longevity  of  the  device  

–  Updates  are  harder  (or  impossible)  •  The  size  of  the  device  

–  CapabiliMes  are  limited  –  especially  around  crypto  •  The  fact  there  is  a  device  

–  Usually  no  UI  for  entering  userids  and  passwords  •  The  data  

–  O_en  highly  personal  •  The  mindset  

–  Appliance  manufacturers  don’t  think  like  security  experts  –  Embedded  systems  are  o_en  developed  by  grabbing  exisMng  chips,  designs,  etc  

Page 11: Securing IoT Applications

Physical  Hacks  

A  PracMcal  AQack  on  the  MIFARE  Classic:    hQp://www.cs.ru.nl/~flaviog/publicaMons/AQack.MIFARE.pdf    Karsten  Nohl  and  Henryk  Plotz.  MIFARE,  LiQle  Security,  Despite  Obscurity  

Page 12: Securing IoT Applications
Page 13: Securing IoT Applications

Or  try  this  at  home?  hQp://freo.me/1g15BiG    

Page 14: Securing IoT Applications

hQp://www.cl.cam.ac.uk/techreports/UCAM-­‐CL-­‐TR-­‐630.html    

Page 15: Securing IoT Applications

Hardware  recommendaMons  

•  Don’t  rely  on  obscurity    

Page 16: Securing IoT Applications

Hardware  recommendaMons  

•  Don’t  rely  on  obscurity  •  Don’t  rely  on  obscurity  •  Don’t  rely  on  obscurity  •  Don’t  rely  on  obscurity  •  Don’t  rely  on  obscurity  •  Don’t  rely  on  obscurity  •  Don’t  rely  on  obscurity    

Page 17: Securing IoT Applications

Hardware  RecommendaMon  #2    

•  Unlocking  a  single  device  should  risk  only  that  device’s  data  

Page 18: Securing IoT Applications

The  Network  

Page 19: Securing IoT Applications

Crypto  on  small  devices  

•  PracMcal  ConsideraMons  and  ImplementaMon  Experiences  in  Securing  Smart  Object  Networks  –  hQp://tools.ieL.org/html/dra_-­‐aks-­‐crypto-­‐sensors-­‐02  

Page 20: Securing IoT Applications

ROM  requirements  

Page 21: Securing IoT Applications

ECC  is  possible    (and  about  fast  enough)  

Page 22: Securing IoT Applications
Page 23: Securing IoT Applications

Crypto  

Borrowed  from  Chris  Swan:    hQp://www.slideshare.net/cpswan/security-­‐protocols-­‐in-­‐constrained-­‐environments/13    

Page 24: Securing IoT Applications

Won’t  ARM  just  solve  this  problem?  

Page 25: Securing IoT Applications

Cost  maQers  

8  bits  $5  retail  $1  or  less  to  embed  

32  bits  $25  retail  $??  to  embed  

Page 26: Securing IoT Applications

Another  opMon?  

Page 27: Securing IoT Applications

SIMON  and  SPECK  

hQps://www.schneier.com/blog/archives/2013/07/simon_and_speck.html    

Page 28: Securing IoT Applications

Datagram  Transport  Layer  Security  (DTLS)  

•  UDP  based  equivalent  to  TLS  •  hQps://tools.ieL.org/html/rfc4347  

Page 29: Securing IoT Applications

Key  distribuMon  

Page 30: Securing IoT Applications
Page 31: Securing IoT Applications

CoAP  

•  Constrained  ApplicaMon  Protocol  – hQp://tools.ieL.org/html/dra_-­‐ieL-­‐core-­‐coap-­‐18    – REST-­‐like  model  built  on  UDP  – Californium  project  coming  soon  to  Eclipse  IoT  

•  No  authenMcaMon  or  authorizaMon  – Relies  on  DLTS  or  data  in  the  body  

   

Page 32: Securing IoT Applications

MQTT  

Page 33: Securing IoT Applications

MQTT  

•  Very  lightweight  messaging  protocol  – Designed  for  8-­‐bit  controllers,  SCADA,  etc  –  Low  power,  low  bandwidth  –  Binary  header  of  2  bytes  –  Lots  of  implementaMons  

•  MosquiQo,  Paho,  RSMB  and  MoqueQe  from  Eclipse  –  Clients:  

•  Arduino,  Perl,  Python,  PHP,  C,  Java,  JS/Node.js,  .Net,  etc  •  Plus  an  even  lighter-­‐weight  version  for  Zigbee  – MQTT-­‐SN  (Sensor  Network)  

Page 34: Securing IoT Applications

MQTT  

•  Relies  on  TLS  for  confidenMality  •  Username/Password  field  

Page 35: Securing IoT Applications

Passwords  

•  Passwords  suck  for  humans  •  They  suck  even  more  for  devices    

Page 36: Securing IoT Applications

Tokens  

Page 37: Securing IoT Applications
Page 38: Securing IoT Applications

Why  OAuth2?  

•  Widely  implemented  •  PreQy  good    – Of  course  there  is  never  100%  agreement  – Or  certainty  with  security  protocols  

•  Not  just  HTTP:  – hQp://tools.ieL.org/html/dra_-­‐ieL-­‐kiQen-­‐sasl-­‐oauth-­‐12  

– OAuth2  used  with  SSL      

Page 39: Securing IoT Applications
Page 40: Securing IoT Applications
Page 41: Securing IoT Applications

Why  FIAM  for  IoT?  

•  Can  enable  a  meaningful  consent  mechanism  for  sharing  of  device  data  

•  Giving  a  device  a  token  to  use  on  API  calls  beQer  than  giving  it  a  password  – Revokable  – Granular  

•  May  be  relevant  for  both  – Device  to  cloud  – Cloud  to  app  

Page 42: Securing IoT Applications

Two  aspects  using  OAuth  with  IoT    

•  On  the  device  – Tokens  are  good  – LimiMng  the  access  of  the  device  

•  On  the  cloud  – Puvng  users  in  control  of  their  data  –  Just  good  current  pracMce  

•  Demo  with  MQTT    – But  not  just  for  MQTT  – Also  for  the  cloud,  CoAP,  and  other  protocols  too  

Page 43: Securing IoT Applications

Demo  components    

MosquiQo  (Open  Source  MQTT  

Broker)    

AcMng  as  “Resource  Server”  

 MosquiQo_py_auth  

 mqQ-­‐oauth2.py  

IdP    

WSO2  IdenMty  Server  

ESB  IntrospecMon  

API  

Refresher.py  

Arduino  

CreateToken.py  1

2

3

4

5

6

Page 44: Securing IoT Applications

WSO2  IdenMty  Server    

Page 45: Securing IoT Applications

Lessons  learnt  •  MQTT  and  MPU  /  I2C  code  is  97%  of  Duemilanove  

–  Adding  the  final  logic  to  do  OAuth2  flow  pushed  it  to  99%  –  No  TLS  in  this  demo  is  a  big  issue  

•  Different  Oauth2  implementaMons  behave  differently  (e.g.  changing  the  refresh  token  every  Mme  you  refresh)  

•  Need  to  be  able  to  update  the  scope  of  token  if  this  will  work  for  long  term  embedded  devices  

•  The  refresh  flow  should  not  really  go  via  the  Resource  server  –  Easy  fix    

•  MQTT  should  have  a  well  defined  model  for  sending  a  message  to  just  one  client  (securely)  

Page 46: Securing IoT Applications

What  I  haven’t  covered  enough  of  

Page 47: Securing IoT Applications

Summary  

•  Think  about  security  with  your  next  device  •  We  as  a  community  need  to  make  sure  that  the  next  generaMon  of  IoT  devices  are  secure  

•  We  need  to  create  exemplars  – Shields  – Libraries  – Server  so_ware  – Standards  

Page 48: Securing IoT Applications

QuesMons?