+ All Categories
Home > Technology > Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Date post: 08-Feb-2017
Category:
Upload: aws-germany
View: 183 times
Download: 0 times
Share this document with a friend
42
Leveraging the Security of AWS's Own APIs for Your App Brian Wagner Solutions Architect Serverless Web Day June 23, 2016
Transcript
Page 1: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Leveraging the Security of AWS's Own APIs

for Your App

Brian Wagner

Solutions Architect

Serverless Web Day

June 23, 2016

Page 2: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

AWS API Requests

Page 3: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Access Key and Secret Key

(access key and secret key have been modified for the purpose of this presentation)

Page 4: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Access Key and Secret Key

[default]

aws_access_key_id = AKIAIGQIO52K3ASNZCDA

aws_secret_access_key = hAckrohCZd1yZKAA1RwC1Sr3boC0COVWMZJpskdh

Page 5: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Access Key and Secret Key

[default]

aws_access_key_id = AKIAIGQIO52K3ASNZCDA

aws_secret_access_key = hAckrohCZd1yZKAA1RwC1Sr3boC0COVWMZJpskdh

Page 6: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Access Key and Secret Key

[default]

aws_access_key_id = AKIAIGQIO52K3ASNZCDA

aws_secret_access_key = hAckrohCZd1yZKAA1RwC1Sr3boC0COVWMZJpskdh

Page 7: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

WHY

Page 8: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Signing AWS API Requests

>_

Page 9: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Why Requests Are Signed

Verify the identity of the requestor

Protect data in transit

Protect against potential replay attacks

Page 10: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Verify the identity of the requestor

unique

Page 11: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Protect data in transit

GET https://iam.amazonaws.com/?Action=ListUsers&Version=2010-05-08 HTTP/1.1

Authorization: AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-

1/iam/aws4_request, SignedHeaders=content-type;host;x-amz-date,

Signature=5d672d79c15b13162d9279b0855cfba6789a8edb4c82c400e06b5924a6f2b5d7

content-type: application/x-www-form-urlencoded; charset=utf-8

host: iam.amazonaws.com

x-amz-date: 20150830T123600Z

Page 12: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Protect data in transit

GET https://iam.amazonaws.com/?Action=ListUsers&Version=2010-05-08 HTTP/1.1

Authorization: AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-

1/iam/aws4_request, SignedHeaders=content-type;host;x-amz-date,

Signature=5d672d79c15b13162d9279b0855cfba6789a8edb4c82c400e06b5924a6f2b5d7

content-type: application/x-www-form-urlencoded; charset=utf-8

host: iam.amazonaws.com

x-amz-date: 20150830T123600Z

Page 13: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Protect against potential replay attacks

5 minutes

Page 14: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

What about your API?

Page 15: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Benefits of signing requests

Verify the identity of the requestor

Protect data in transit

Protect against potential replay attacks

Page 16: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Benefits of signing requests

Verify the identity of the requestor

Protect data in transit

Protect against potential replay attacks

Use IAM and access policies to authorize access to your APIs

Page 17: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Authorization: AWS_IAM

Page 18: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

IAM and access policies to authorize access to your APIs

{

"Effect": "Allow",

"Action": "execute-api:Invoke",

"Resource": [

“arn:aws:execute-api:us-east-1:111222333444:myapi/*”

]

}

Page 19: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

IAM and access policies to authorize access to your APIs

{

"Effect": "Allow",

"Action": "execute-api:Invoke",

"Resource": [

“arn:aws:execute-api:us-east-1:111222333444:myapi/*”

]

},

{

"Effect": "Deny",

"Action": "execute-api:Invoke",

"Resource": [

“arn:aws:execute-api:us-east-1:111222333444:myapi/admin/*”

]

}

Page 20: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Securing your API

Page 21: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
Page 22: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
Page 23: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
Page 24: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
Page 25: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
Page 26: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
Page 27: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
Page 28: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
Page 29: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

https://4kp2myvxmf.execute-api.us-east-1.amazonaws.com/prod/pets/

Page 30: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
Page 31: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
Page 32: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
Page 33: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
Page 34: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

IAM and access policies to authorize access to your APIs

{

"Version": "2012-10-17",

"Statement": [

{

"Sid": "Stmt1466674972000",

"Effect": "Allow",

“Action": "execute-api:Invoke",

"Resource": [

"arn:aws:execute-api:us-east-1:111222333444:4kp2myvxmf/*/GET/pets"

]

}

]

}

Page 35: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Access Key and Secret Key

(access key and secret key have been modified for the purpose of this presentation)

Page 36: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

https://docs.aws.amazon.com/es_es/general/latest/gr/sigv4-signed-

request-examples.html#sig-v4-examples-get-query-string

Page 37: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
Page 38: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

How do my apps sign requests?

Page 39: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

API Gateway

Cognito User and Federated Identities

Cognito User

Identities(Your User Pool)

User

Sign-in1

Returns Access

and ID Tokens2

Cognito Federated

Identities(Identity Pool)

Get AWS scoped

credentials

3

Access

to your API

4

DynamoDB S3

Page 40: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Manage authenticated

and guest users’ access

to your AWS resources

Federated Identities

Synchronize user’s data

across devices and

platforms via the cloud

Data Synchronization

Add sign-up and sign-in

with a fully managed

user directory

Your User Pool

GuestYour own auth

Amazon Cognito Identity Amazon Cognito Sync

Amazon Cognito Identity and Sync

k/v data

Page 41: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Verify the identity of the requestor

Protect data in transit

Protect against potential replay attacks

Use IAM and access policies to authorize access to your APIs

API Gateway and IAM: Best Friends Forever

+

Page 42: Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day

Leveraging the Security of AWS's Own APIs

for Your App

Brian Wagner

Solutions Architect

Serverless Web Day

June 23, 2016


Recommended