Securing IoT Connected Device Applications
Ian Massingham Technology Evangelist, AWS IanMmmm
Securing IoT Connected Device Applications Ian Massingham - - PowerPoint PPT Presentation
Securing IoT Connected Device Applications Ian Massingham Technology Evangelist, AWS IanMmmm IoT isnt a new use-case for AWS Amazon Amazon Kinesis Amazon AWS Lambda API Gateway Streaming Analytics DynamoDB Run Code in Build,
Ian Massingham Technology Evangelist, AWS IanMmmm
Amazon SNS Mobile Push and Notifications Amazon DynamoDB Predictable and Scalable NoSQL Data Store AWS Lambda Run Code in Response to Events Amazon Redshift Petabyte-Scale Data Warehouse
…and more
Amazon API Gateway Build, Deploy, and Manage APIs Amazon Kinesis Streaming Analytics Amazon Cognito User Identity and Data Synchronization
Amazon SNS Mobile Push and Notifications Amazon DynamoDB Predictable and Scalable NoSQL Data Store AWS Lambda Run Code in Response to Events Amazon Redshift Petabyte-Scale Data Warehouse
…and more
Amazon API Gateway Build, Deploy, and Manage APIs Amazon Kinesis Streaming Analytics Amazon Cognito User Identity and Data Synchronization AWS IoT Connect Devices to the Cloud
http://192.168.1.200:8080
http://192.168.1.200:8080
http://192.168.1.200:8080 http://a.public.address:8080
http://192.168.1.200:8080 http://a.public.address:8080
http://192.168.1.200:8080 http://a.public.address:8080
http://192.168.1.200:8080 http://a.public.address:8080
http://192.168.1.200:8080 http://a.public.address:8080
http://192.168.1.200:8080 http://a.public.address:8080
http://192.168.1.200:8080 http://a.public.address:8080
http://192.168.1.200:8080 http://a.public.address:8080
http://192.168.1.200:8080 http://a.public.address:8080
DADDY, WHERE DO BOTNETS COME FROM?
http://192.168.1.200:8080
http://192.168.1.200:8080
TLS/SSL MUTUAL TLS AUTHENTICATION
For same bits & level of security ECC keys are much smaller that RSA keys
Symmetric Key Size (bits) RSA Key Size (bits) Elliptic Curve Key size (bits) 80 1024 160 112 2048 224 128 3072 256 192 7680 384 256 15360 512
https://aws.amazon.com/blogs/iot/elliptic-curve-cryptography-and-forward-secrecy-support-in-aws-iot-3/
MQTT + Mutual Authn TLS AWS Authn + HTTPS Server Authn TLS + Cert TLS + Cert Client Authn TLS + Cert AWS API Keys Confidentiality TLS TLS Protocol MQTT HTTP
X.509 Certificates
https://aws.amazon.com/blogs/iot/just-in-time-registration-of-device-certificates-on-aws-iot/
Data Plane Control Plane Service Access Data Plane
{ "Version": "2012-10-17", "Statement": [ { "Sid": ”ManageCerts", "Action": [ "iot:CreateCertificateAndKeys", "iot:CreateCertificateFromCsr", "iot:DescribeCertificate", "iot:UpdateCertificate", "iot:DeleteCertificate", "iot:ListCertificates” ], "Effect": "Allow", "Resource": "*" } ] } { "Version": "2012-10-17", "Statement": [ { "Sid": "RevokeOneThing", "Action": [ "iot:UpdateCertificate" ], "Effect": "Allow", "Resource": "arn:aws:iot:us-east-1:123456972007:cert/d7677b0…SNIP…026d9", "Condition": { "IpAddress": { "aws:SourceIp": "192.168.42.54" } } } ] }
{ "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Action":[ "iot:Connect" ], "Resource":"*" }, { "Effect":"Allow", "Action":[ "iot:Publish" ], "Resource":[ "arn:aws:iot:us-east-1:123456972007: topic/$aws/things/MyThing/shadow/update"] }, { "Effect":"Allow", "Action":[ "iot:Subscribe", "iot:Receive" ], "Resource":[ "arn:aws:iot:us-east-1:123456972007: topicfilter/$aws/things/MyThing/shadow/*" ] } ] }
Source: https://www.hackster.io/youngd/ping-pong-showdown-eabaed
Source: www.theatlantic.com/notes/2016/07/make- every-week-2-a-silent-slack-powered-doorbell/ 490880/
Source: http://www.andrewmcgill.me/2016/08/19/make-every-week-sweetgreen-salad-button.html
Push a button to get directions to the right meal within your
weather, Google Directions, Yelp, and Stripe)
Source: https://medium.com/@_adeel/nerding-out-with-the-amazon-iot- button-84a6e14b6b28#.ekd5hsnez
Invoke a Lambda function Put object in an S3 bucket Insert, Update, Read from a DynamoDB table Publish to an SNS Topic
Publish to a Kinesis stream Kinesis Firehose > Redshift Republish to AWS IoT
AWS IoT
Raspberry Pi 3, 2, Model B+ with 40-Pin GPIO Extension Board & Jump Wires
Your own electronics/sensor build C (for embedded C)
http://wiringpi.com
Python Wrapper Module for WiringPI
https://github.com/WiringPi/WiringPi-Python
For the Sense Hat Python Module
https://github.com/RPi-Distro/python-sense-hat
Use the AWS Console to create your device Download the required crypto materials & save the C header file contents with your endpoint, cert, and key details Download & set up your chosen AWS IoT SDK Get them at : https://aws.amazon.com/iot/sdk/ Building the C SDK on the Raspberry Pi requires the CppUTest library from: https://github.com/cpputest/cpputest/releases/tag/v3.6 Get started with the sample applications that come with the AWS SDKs
Emulating the AWS IoT Button (C++) https://github.com/ianmas-aws/iot-button-emulator Controlling the Sense Hat via AWS IoT Device Shadow (Python) https://github.com/ianmas-aws/PiPyIoT
Ian Massingham Technology Evangelist, AWS IanMmmm
Lambda Function
AWS IoT Rules Engine
Policy Private Key & Certificate Button Rule SDK AWS IoT AWS Services Execution Role Policy
SNS Topic
Permission Action SNS Topic Subscription
Rule: “Select * from ‘iotbutton/+’
Event Source Function SMS or Email
DynamoDB
Rules Engine
Dashboard
S3 Website
Lambda Function
Policy Private Key & Certificate Button Rule SDK AWS IoT AWS Services Execution Role Policy Permission Action
Rule: “Select * from ‘iotbutton/+’
Event Source Function DynamoDB API Gateway
Lambda Function
Rules Engine
Policy Private Key & Certificate Thing/Device Rule SDK AWS IoT AWS Services Execution Role Policy
External Endpoint
Permission
Rule: Select * from ‘iotbutton/+’
Action
External API
LifX API